Hi all,
I would like the user of my BrainVisa process to choose a threshold for an MRI, so I use the following method in my process :
- open the MRI in Anatomist
- popupPalette to open the palette window (by the way, the window appears outside the screen except for a small part of it)
- the user chooses the min value of the "DoubleThreshold" palette to see a certain pattern
- the user clicks "ok" on a small dialog box (opened with context.ask).
- the process reads mri.objectInfo()['palette']['min'], and gets a float value between 0 and 1.
The problem is that I am using an external program to process the MRI, which needs the "real" value of the min :
- if the MRI is expressed in unsigned 8 bits, I want the threshold to be between 0 and 256,
- if it is a signed 16 bits, I want it between -32000 and +32000...
Is there a way to get this value from anatomist (which displays it in the palette window), or should I check the type of data of the MRI and compute the right value for U8, S8, U16... ?
Thanks !
ObjectInfo and min/max Palette
ObjectInfo and min/max Palette
Manik Bhattacharjee
INSERM U836
INSERM U836
- riviere
- Site Admin
- Posts: 1361
- Joined: Tue Jan 06, 2004 12:21 pm
- Location: CEA NeuroSpin, Saint Aubin, France
- Contact:
Hi Manik,
Palettes thresholds are normalized (generally between 0 and 1 but they can be outside these bounds), but ObjectInfo should also provide texture extrema information: there should be 'textureMin' and 'textureMax' properties. You just have to apply a scaling factor with these extrema (0 for palette means textureMin value, and 1 means textureMax) to get an absolute threshold.
Does it help ?
Denis
Palettes thresholds are normalized (generally between 0 and 1 but they can be outside these bounds), but ObjectInfo should also provide texture extrema information: there should be 'textureMin' and 'textureMax' properties. You just have to apply a scaling factor with these extrema (0 for palette means textureMin value, and 1 means textureMax) to get an absolute threshold.
Does it help ?
Denis