<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello everyone,<div class=""><br class=""></div><div class="">       I have got this problem when reading a Minc2 file. I’m currently on the verge of completing the transition of ITK 3 to ITK 4 but realized on testing some of our minc2 files (Unit test) which previously passed in 3 seem to fail in 4. On further investigation of both codes (ITK 3 & 4) I noticed the reason for this failure was that for example reading a specific file I was expecting the Component Type returned to be SHORT whereas I was getting FLOAT.</div><div class=""><br class=""></div><div class="">Note: am running ITK git master</div><div class=""><br class=""></div><div class="">// snippet</div><div class=""><br class=""></div><div class="">// In ITK 4 (ITK git master)</div><div class="">// ITK file name : itkMINCImageIO.cxx</div><div class="">// function -> ReadImageInformation</div><div class="">// Minc2 test file :  <span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class="">mni_icbm152_t1_tal_nlin_asym_09c.mnc</span></div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class="">// set the file data type</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">  <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">if</span>(slice_scaling_flag || global_scaling_flag)</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">    {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">    <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">switch</span> ( volume_data_type )</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      {</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> MI_TYPE_FLOAT:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">this</span>->SetComponentType(FLOAT);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> MI_TYPE_DOUBLE:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">this</span>->SetComponentType(DOUBLE);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> MI_TYPE_FCOMPLEX:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">this</span>->SetComponentType(FLOAT);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">case</span> MI_TYPE_DCOMPLEX:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">this</span>->SetComponentType(DOUBLE);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">      <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">default</span>:</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">this</span>->SetComponentType(FLOAT);</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">        <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">break</span>;</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">      } </span>//end of switch</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">        </span>//file will have do</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class="">    }</div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">  </span>else</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">// In ITK 3 (3.20.1)</div><div class="">// ITK file name : itkMINC2ImageIO.cxx</div><div class=""><div class="">// function -> ReadImageInformation</div><div class="">// Minc2 test file :  <span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class="">mni_icbm152_t1_tal_nlin_asym_09c.mnc</span></div></div></div><div class=""><span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class=""><br class=""></span></div><div class=""><span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class="">// lines 397 onwards</span></div><div class=""><span style="color: rgb(209, 47, 27); font-family: Menlo; font-size: 11px;" class=""><div class="">// set the file data type</div><div class="">  switch (volume_data_type)</div><div class="">    {</div><div class="">    case MI_TYPE_BYTE:</div><div class="">      this->SetComponentType(CHAR);</div><div class="">      break;</div><div class="">    case MI_TYPE_UBYTE:</div><div class="">      this->SetComponentType(UCHAR);</div><div class="">      break;</div><div class="">    case MI_TYPE_SHORT:</div><div class="">      this->SetComponentType(SHORT);</div><div class="">      break;</div><div class="">    case MI_TYPE_USHORT:</div><div class="">      this->SetComponentType(USHORT);</div><div class="">      break;</div><div class="">    case MI_TYPE_INT:</div><div class="">      this->SetComponentType(INT);</div><div class="">      break;</div><div class="">    case MI_TYPE_UINT:</div><div class="">      this->SetComponentType(UINT);</div><div class="">      break;</div><div class="">    case MI_TYPE_FLOAT:</div><div class="">      this->SetComponentType(FLOAT);</div><div class="">      break;</div><div class="">    case MI_TYPE_DOUBLE:</div><div class="">      this->SetComponentType(DOUBLE);</div><div class="">      break;</div><div class="">    case MI_TYPE_SCOMPLEX:</div><div class="">      this->SetComponentType(SHORT);</div><div class="">      break;</div><div class="">    case MI_TYPE_ICOMPLEX:</div><div class="">      this->SetComponentType(INT);</div><div class="">      break;</div><div class="">    case MI_TYPE_FCOMPLEX:</div><div class="">      this->SetComponentType(FLOAT);</div><div class="">      break;</div><div class="">    case MI_TYPE_DCOMPLEX:</div><div class="">      this->SetComponentType(DOUBLE);</div><div class="">      break;</div><div class="">    default:</div><div class="">      itkDebugMacro("Bad data type ");</div><div class="">      return;</div><div class="">    } //end of switch</div><div class=""><br class=""></div><div class=""><br class=""></div></span></div><div class="">Note that in ITK 3 the slice_scaling_flag is set to way above the snippet but is never used as a condition for setting the ComponentType so in my case I get back the SHORT I was expecting whereas in ITK 4 (see code above) the slice_scaling_flag is always set to 1 and the ComponentType is redefined as FLOAT which isn’t what I’m expecting. Lastly, I have also confirmed that indeed it’s expected to be a SHORT not FLOAT by using Minc Info to examine the above file named test file. So my question is could this have been a mistake in ITK 4 which means the way ITK 3 went about handling the file was correct or could it have been the other way around.</div><div class=""><br class=""></div><div class="">Thanks </div><div class=""><br class=""></div><div class="">Regards,</div><div class="">   Seun</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>