[MINC-users] default slice min/max in mincreshape?

Peter Neelin peter.neelin at gmail.com
Sun Jun 3 07:45:13 EDT 2012


On May 31, 2012 11:53 PM, "Alex Zijdenbos" <zijdenbos at gmail.com> wrote:
> however when I call mincreshape on that volume to pad it, i.e., add
> empty slices, the added slices receive a max value of 1; so the
> resulting image shows, after adding 5 slices:

mincreshape is trying to avoid having a range of zero which could
potentially lead to divide by zero situations for less-than-perfect apps
reading the output file. Unfortunately, the arbitrary value that it picks
is too big for your file.

The guilty code is in progs/mincreshape/copy_data.c, function
get_block_min_and_max(). There is a block of code in there that sets
variable default_extreme to 1.0 for the maximum and 0.0 for the minimum.
This could either be changed to a much smaller number (to preserve the
original intention), or mincreshape could scan all of the min and max to
determine a file-specific default min and max (although you probably don't
want to use the global max here - probably 1% of the range or something).
Note that the choice of 0.0 for the min could also be a problem for files
that have are shifted up and have a narrow range.

Anyway, I'll leave it to you guys to figure out how you want to fix this.

Peter
--
Peter Neelin
peter.neelin at gmail.com


More information about the MINC-users mailing list