[MINC-development] label volumes

Claude LEPAGE claude at bic.mni.mcgill.ca
Tue Jul 31 10:21:55 EDT 2007


Hi,

> Correct, the way I have always done this is do a mincreshape to files
> that are misbehaving..
> 
>    mincreshape -image_range 0 255 -valid_range 0 255 ...

This does not correct the problem if the min/max are set per slice and that
they vary for each slice. Once a label file has been "decimalized" by the
ranges, there is no way to recover the original values by the above 
operation.

For example:
   Take a label = 10, with voxel value of 10 if there is a one-to-one 
correspondence with voxel range and image real. Now assume that the slice
has a min=0 and a max=61. That's 62 values over a 256 range, so each bin
has a value of 62/256=0.2421875. The label 10 will be best approximated 
by the 41th bin with value 41*0.2421 = 9.9297. (There might be some
ajustment to do if the values are range-centered, but my argument is still
valid.) Setting back max=255 for the slice will not recover the original
label 10. Now keep doing this repeatedly (minccalc, mincmath, etc) and 
some labels will change value (10 drifts to 9, for example). 

The option -keep_real_range in mincresample does the trick as the global
min/max of the image are applied to each slice, thus not changing the 
internal voxel values. minccalc (which uses voxel_loop as AJ pointed out)
does not.

Despite being ugly, I also think that working in floats might be the best
compromise (on the temporary files, of course).

Claude



More information about the MINC-development mailing list