[MINC-users] Which parameters for normalization ?

antoine pattin antoine.pattin at gmail.com
Thu Sep 13 06:25:34 EDT 2012


Hello everyone !

I'm struggling to normalize data extracted from a MINC file using the
miicv_get and miicv_set functions (image conversion variable functions).

My objective is to read separately each frame from my MINC volume.
In the minc file, data are stored as signed short but I would like to read
it in a float buffer.
The extraction works without trouble but I never obtain the expected values.


Here are the details about my last try :

/* I create the icv and set the personalised normalization */
icv = miicv_create();
(void) miicv_setint(icv, MI_ICV_DO_NORM, TRUE);
(void) miicv_setint(icv, MI_ICV_USER_NORM, TRUE);

/* the data will be read as signed shorts and stored as floats */
(void) miicv_setint(icv, MI_ICV_TYPE, NC_SHORT);
(void) miicv_setstr(icv, MI_ICV_SIGN, MI_SIGNED);

/* I don't know how to set the valid range, should it be the float data
range or the short data range [-32768; 32767] ?
 (void) miicv_setint(icv, MI_ICV_VALID_MAX, 32000);
 (void) miicv_setint(icv, MI_ICV_VALID_MIN, 0);
 /* I want to read each frame separately so I set my user image range the
same as the range of data in the frame */
  float frame_min = 1033;
  float frame_max = 2835;
  (void) miicv_setint(icv, MI_ICV_IMAGE_MAX, frame_max);
  (void) miicv_setint(icv, MI_ICV_IMAGE_MIN, frame_min);

and then begins the extraction.


Should I use miicv_setdbl functions instead of miicvset_int ?
If I want to compare the data over all the frame, should I set the image
range to the minc min and minc max instead of frame min and frame max ?
What should be my valid range and am I calling miicv_set functions in the
right order ?

I know this is a lot of questions but even after reading the "example
reading values" from the minc documentation I still can't understand.
I thank you for your help and for your time.

Best regards,
Antoine.


More information about the MINC-users mailing list