[MINC-development] label volumes

Andrew Janke a.janke at gmail.com
Tue Jul 31 10:28:22 EDT 2007


On 8/1/07, Claude LEPAGE <claude at bic.mni.mcgill.ca> wrote:
> 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).

Ooops, sorry yes, that "use mincreshape" comment of mine should only
be used as Claude points out if you are using floats in between as I
usually do...

But if what you are asking amounts to merely amounts to setting the
range for each slice/chunk with some pre-determined number is this not
what:

   minccalc -range 0 255 ...

does?  If not I have always suspected that this was the intended
purpose of this option. Again, if it is not I do not see why we cannot
override this functionality within voxel whoop and have it do exactly
as you are saying and set the maximum and minimum values for each
slice.

Can anyone see any problems with doing this?


a


More information about the MINC-development mailing list