[MINC-users] mincmorph output data type

Claude LEPAGE claude at bic.mni.mcgill.ca
Wed Feb 16 13:27:53 EST 2011


Hi,

Any reason why mincmorph is always writing its output in signed float?

Here is the code:

#define INTERNAL_PREC NC_FLOAT         /* should be NC_FLOAT or NC_DOUBLE */

   input_volume(infile, MAX_VAR_DIMS, axis_order,
                INTERNAL_PREC, TRUE, 0.0, 0.0, TRUE, volume, NULL);

   output_modified_volume(op->outfile, MI_ORIGINAL_TYPE, 0,
                          // dtype, is_signed,
                          0.0, 0.0, *volume, infile, arg_string, NULL);

The input is always read internally in float, thus MI_ORIGINAL_TYPE gives 
float on output, regardless of what the user wants.

Why has someone chosen to ignore dtype as specified by the user? Any good
reason to do so? I can almost think of one, which is related to what I'm
trying to do. When using -group, the number of groups could exceed the 
storage capacity of the integer data type (byte or short). With float,
we can safely say that the number of groups will fit. However, it's not
really convenient to have group labels like 14.45 (non-integral numbers).

Claude



More information about the MINC-users mailing list