[MINC-users] Scaling troubles solved

Peter NEELIN minc-users@bic.mni.mcgill.ca
Tue, 20 May 2003 20:41:16 -0400


On Fri, 16 May 2003, James Dessart wrote:

> I decided to fiddle a little with the variables, and the like... I
> moved some dim conversion assignments until after other ICV
> assignments, put MI_ICV_VALID_MAX before MI_ICV_VALID_MIN, and turned
> normalization on, and the streaks are gone.  If I turn it off, the
> streaks come back.

I don't think that the order should matter, but turning normalization on
is important to have all of the slices normalized the same way. Many minc
files have slices scaled differently (this allows programs to use less
memory), so turning normalization on will ensure that all slices are
scaled in the same way and you will not see streaking. I re-read your
original e-mail, and I noticed that you said "normalization turned" - I
had assumed "on", but I'm guessing that you meant "off".

If minc 0.3 produced a non-streaked result on exactly the same minc file,
then I have to admit to being mystified. If it produced a non-streaked
result on a different file, then that would be because the other file did
not have separate slice scalings. That's up to the program that produces
the output file. That is why the normalization option exists - so that you
can turn it on and not worry about have to rescale things yourself.

> What seems to be happening is that when I have normalization off, the
> values are stretched to fit the byte range (the values are supposed to
> be shorts from 0 to 4095, but they go from 0 to 256).

Because the program indicates that it wants bytes internally, it rescales
the values from [0,4095] to [0,255]. But it does not stretch them to fit
the [0,255] - the stretching was already done in the file (stretched to
the range [0,4095]). Turning normalization on will "unstretch" the range,
while keeping things in the range [0,255].

> As a result,
> some slices were getting their intensities scaled.

As I mentioned, they had already been scaled by the program that produced
the files.


> But when I do
> normalization (without setting the user normalization) it works.

That's why it is there.

            Peter
----
            Peter Neelin (neelin@bic.mni.mcgill.ca)