[MINC-users] Which parameters for normalization ?

Vladimir S. Fonov vladimir.fonov at gmail.com
Thu Sep 13 10:01:06 EDT 2012


Hello Antoine,

take a look on how it's done in ezminc:
https://github.com/BIC-MNI/minc/blob/develop/ezminc/minc_1_rw.cpp#L1073


P.S. It is easier API to use then MINC directly, see examples in
https://github.com/BIC-MNI/minc/tree/develop/ezminc/examples
and in tests:
https://github.com/BIC-MNI/minc/tree/develop/ezminc/tests

On 13/09/2012 6:25 AM, antoine pattin wrote:
> 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.
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


-- 
Best regards,

  Vladimir S. Fonov ~ vladimir <dot> fonov <at> gmail <dot> com


More information about the MINC-users mailing list