<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
 <div style="font-size: 14px; "><br></div><div style="font-size: 14px; "><br></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Good evening, Luis, Mathieu.  Thank you both for your responses.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">To address your comments,</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Luis - The source-code (compiled against version 3.4 of ITK) makes use of the itk::OrientedImage class.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Mathieu - The  itk::DICOMSeriesFileNames class is being used to generate the ordered filename sequence.  The current MR data-set is made up of two Series Unique IDentifiers (UIDs;  apparently a result of acquiring the images on three to four year old MR equipment - from what I have been told), while the current CT data-set is made up of a single UID.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Based on the ITK documentation (excerpts for both series filename classes noted are appended at the end of this e-mail), it appears the itk::DICOMSeriesFileNames class is better suited to handle multiple series identifier cases;  it is noted that the itk::GDCMSeriesFileNames class handles only one series identifier.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">I should note that the itk::ImageSeriesReader uses the itk::GDCMImageIO class as the image-type by passing a pointer of this IO-type to the reader-object using the SetImage method.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Given the apparent need to use the itk::DICOMSeriesFileNames to handle the multiple series identifiers making up the volume, perhaps the itk::DicomImageIO class should be used in place of the itk::GDCMImageIO class?  I do not have knowledge and working experiences with DICOM images, so I would speculate the need for consistency - (DICOM series, DICOM reader) or (GDCM series, GDCM reader).  Or, in most cases, are these two image-IO types inter-changeable?</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Thank you again,</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Michael.</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Michael Wirtzfeld</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Robarts Imaging</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">London, Ontario - Canada</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">-----------------------------</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> itk::GDCMSeriesFileNames</span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Generate a sequence of filenames from a </span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> series.</span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">This class generate a sequence of files whose filenames points to a DICOM file. The ordering is based on the following strategy: Read all images in the directory (assuming there is only one study/serie)</span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">1. Extract Image Orientation &amp; Image Position from DICOM images, and then calculate the ordering based on the 3D coordinate of the slice 2. If for some reason this information is not found or failed, another strategy is used: the ordering is based on 'Image Number' 3. If this strategy also failed, then the filenames are ordered by lexicographical order.</span></font></font></div></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><span class="Apple-style-span" style="font-size: 14px; ">-----------------------------</span></div><div style=""><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">itk::DICOMSeriesFileNames</span></font></font></div></div><div style=""><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style=""><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">Generate an ordered sequence of filenames.</span></font></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" style="font: 12.0px Helvetica"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">This class generates an ordered sequence of filenames based on the DICOM tags in the files. Files can be sorted based on image number, slice location, or patient position. The files in the specified directory are grouped by SeriesUID. The list of SeriesUIDs can be queried and the filenames for a specific series extracted. </span></font></font></div></div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; "><br></div><div style="font-size: 14px; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><span class="Apple-style-span" style="font-size: 14px; ">-----------------------------</span></span></font></div><div style="font-size: 14px; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div style="font-size: 14px; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><div style="font-size: 14px; "><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div><br style="font-size: 14px; "><div style="font-size: 14px; "><div>On 8-Jul-08, at 3:23 PM, Luis Ibanez wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Hi Michael,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">                </span>Welcome to ITK !</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Thanks for the detailed description of your problem.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">With that, you are starting with a good precedent<span class="Apple-converted-space">  </span>:-)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">If you are finding necessary to play with the order of</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">reading the DICOM slices in order to get the anatomical</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">orientation of the images to match, then chances are that</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">the image have been acquired with different orientations.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The good news for you is that ITK provides classes for</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">correctly taking image orientation into account.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">What you want to do first is to replace the use of</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">"itk::Image" in your code, with "itk::OrientedImage".</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">The OrientedImage will make sure that the image orientation</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">that is encoded in the direction cosines stored in the</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">DICOM header, is propagated and taking into consideration</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">at every step of the image registration process.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Once you introduce the itk::OrientedImage in replacement</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for the itk::Image, you shouldn't need to manipulate the</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">slice order in the ImageSeriesReader class.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Note that for this,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">You should use ITK 3.6 or a later CVS version.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Please give it a try and let us know if you find any</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">problems.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">   </span>Thanks</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><span class="Apple-converted-space">      </span>Luis</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">-------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">M. Wirtzfeld wrote:</div> <blockquote type="cite"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Good afternoon,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">We are currently writing registration code to handle mono-modality and multi-modality image registration using CT and MR data-sets.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">At the present time, the code is able to perform registration using both of these data-sets.<span class="Apple-converted-space">  </span>The fixed-image is two-dimensional (treated as three-dimensional image-type by the code) and the moving-image is a volume created from a sequence of two-dimensional DICOM slices.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Using the itk::ImageSeriesReader class, mono-modality CT registration requires the SetReverseOrder method of this class to be called with a "true" boolean value and MR registration requires a "false" boolean value when the respective volumes are created.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I have ensured that the maximum-step used by the optimizer is properly set in both cases.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I believe the root of this requirement lies in the meta-data of the DICOM images that comprise the CT and MR data-sets, but I do not know why or what to look for in order to help find an answer.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">I have not used ITK extensively and this is my first experience with image-processing.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Any help is greatly appreciated,</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Michael.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Michael Wirtzfeld</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Robarts Research</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">"Prefer the standard to the offbeat." - Strunk &amp; White</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">------------------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Insight-users mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a></div> </blockquote></blockquote></div><br style="font-size: 14px; "><div style="font-size: 14px; "> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>M. Wirtzfeld</div><div><br></div><div>"Prefer the standard to the offbeat." - Strunk &amp; White</div><div><br></div><div><br></div></div></div></span><br class="Apple-interchange-newline"> </div><br style="font-size: 14px; "></body></html>