Hello Luis, <br><br>Thanks so much for the solution you offered. I actually figured out that I missed the Update() method in the VTK2ITKconnector, but it didn&#39;t have an Update() function, so I called VTK2ITKconnector-&gt;GetImporter()-&gt;Update();<br>

That solved the empty FixedImageRegion problem.<br><br>Then I encountered another error which is <br>itk::InvalidRequestedRegionError&#39;<br>  what():  /usr/local/ITK/ITK/Code/Common/itkDataObject.cxx:397:<br>Requested region is (at least partially) outside the largest possible region.<br>

<br>When I googled for this error, the people have gotten over this by using UpdateLargestPossibleRegion(); instead of Update();<br>Is this a reasonable solution to InvalidRequestedRegionError? Should I use this just once in the end of the VTK2ITKconnectors or in the whole code?<br>

<br>--------------------------<br><br>I appreciate your warning about the DICOM reader, but I don&#39;t lose the orientation information in the file header, the CT object holds the relevant data in it, like the patient position and orientation. I just call the scalar intensity values  of CT as an input for the 3D Rigid registration part because I know that the data are in the same orientation. I can recall the orientation info when I need to implement a transformation type that uses the orientation. Thanks for your warning again.<br>

<br>My salutations,<br><br>Vural<br><br><br><div class="gmail_quote">On Thu, Apr 16, 2009 at 7:47 PM, Luis Ibanez <span dir="ltr">&lt;<a href="mailto:luis.ibanez@kitware.com">luis.ibanez@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hi Vural,<br>
<br>
It seems that you are missing to call Update() in the<br>
connector, before you pass the image to the registration<br>
process.<br>
<br>
Try adding something like:<br>
<br>
&gt;     VTK2ITKconnector-&gt;SetInput(...)<br>
&gt;     VTK2ITKconnector-&gt;Update();<br>
&gt;     VTK2ITKconnector-&gt;GetOutput()-&gt;Print( std::cout );<br>
<br>
---------------------------------------------------------<br>
<br>
BTW:<br>
<br>
Why are you using a DICOM reader that loads a vtkImage ?<br>
<br>
         This is quite unsafe...  :-/<br>
<br>
Note that vtkImage doesn&#39;t have a representation for<br>
orientations, and therefore the direction cosines from<br>
the DICOM header will be lost.<br>
<br>
Direction cosines are quite important for the purpose<br>
of the registration process. Lossing them is not a good<br>
idea.<br>
<br>
I would encourage you to use ITK for reading the DICOM<br>
series. (this will in turn use GDCM underneath).<br>
<br>
<br>
     Regards,<br>
<br>
<br>
        Luis<br>
<br>
<br>
----------------------<br>
Vural Özbudak wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">
Hello everyone,<br>
<br>
I am working on 3D rigid transformation, I basically use the example code ImageRegistration8.cxx. The difference is that I load my dicom data with a loader which returns a vtkImage, then convert it to itk::Image with itk::VTKImageToImageFilter (VTK2ITKconnector). I replaced the output of fixedImageReader (I am no longer using ImageFileReader) with the output of VTK2ITKconnector and I encountered such a problem:<br>


<br>
ExceptionObject caught !<br>
<br>
itk::ExceptionObject (0xa9a9490)<br>
Location: &quot;void itk::ImageToImageMetric&lt;TFixedImage, TMovingImage&gt;::Initialize() [with TFixedImage = itk::Image&lt;double, 3u&gt;, TMovingImage = itk::Image&lt;double, 3u&gt;]&quot;<br>
File: /usr/local/ITK/ITK/Code/Algorithms/itkImageToImageMetric.txx<br>
Line: 93<br>
Description: itk::ERROR: MeanSquaresImageToImageMetric(0xa9a9b70): FixedImageRegion is empty<br>
<br>
<br>
Is this error stemming from the VTK2ITKconnector or the loader? I guess the loader works fine as I checked its output with a renderer. Here is the code for the VTK2ITKconnector:<br>
<br>
    typedef itk::Image&lt; double, 3 &gt; InputImageType;<br>
    typedef itk::VTKImageToImageFilter&lt; InputImageType &gt;  VTK2ITKConnectorFilterType;<br>
    VTK2ITKConnectorFilterType::Pointer VTK2ITKconnector = VTK2ITKConnectorFilterType::New();<br>
    VTK2ITKconnector-&gt;SetInput( CT -&gt; dataScalar -&gt; getImageArray() );                                                 // The expression in the paranthesis is actually a vtkImage.<br>
<br>
I appreciate your answers in advance.<br>
<br>
<br>
-- <br>
Vural Ozbudak<br>
Bogazici University, Istanbul<br>
</div></div><a href="http://vavlab.ee.boun.edu.tr" target="_blank">vavlab.ee.boun.edu.tr</a> &lt;<a href="http://vavlab.ee.boun.edu.tr" target="_blank">http://vavlab.ee.boun.edu.tr</a>&gt;<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote>
</blockquote></div><br><br clear="all"><br>-- <br>Vural Ozbudak<br>Bogazici University, Istanbul<br><a href="http://vavlab.ee.boun.edu.tr">vavlab.ee.boun.edu.tr</a><br>