ObjectInfo and min/max Palette

Questions about BrainVisa usage and installation

Moderators: denghien, riviere

Post Reply
Manik
Posts: 99
Joined: Fri Mar 05, 2004 1:00 pm
Location: INSERM U836, Grenoble

ObjectInfo and min/max Palette

Post by Manik »

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 !
Manik Bhattacharjee
INSERM U836
User avatar
riviere
Site Admin
Posts: 1361
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Post by riviere »

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
Manik
Posts: 99
Joined: Fri Mar 05, 2004 1:00 pm
Location: INSERM U836, Grenoble

Post by Manik »

In fact, I just tried to use the 'palette' key, and I should have tried the 'texture' properties, as you said.
Everything works now !
Thanks,
Manik Bhattacharjee
INSERM U836
Post Reply