[Insight-users] 3D Rigid Registration - FixedImageRegion problem

Luis Ibanez luis.ibanez at kitware.com
Thu Apr 16 12:47:22 EDT 2009


Hi Vural,

It seems that you are missing to call Update() in the
connector, before you pass the image to the registration
process.

Try adding something like:

 >     VTK2ITKconnector->SetInput(...)
 >     VTK2ITKconnector->Update();
 >     VTK2ITKconnector->GetOutput()->Print( std::cout );

---------------------------------------------------------

BTW:

Why are you using a DICOM reader that loads a vtkImage ?

          This is quite unsafe...  :-/

Note that vtkImage doesn't have a representation for
orientations, and therefore the direction cosines from
the DICOM header will be lost.

Direction cosines are quite important for the purpose
of the registration process. Lossing them is not a good
idea.

I would encourage you to use ITK for reading the DICOM
series. (this will in turn use GDCM underneath).


      Regards,


         Luis


----------------------
Vural Özbudak wrote:
> Hello everyone,
> 
> 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:
> 
> ExceptionObject caught !
> 
> itk::ExceptionObject (0xa9a9490)
> Location: "void itk::ImageToImageMetric<TFixedImage, 
> TMovingImage>::Initialize() [with TFixedImage = itk::Image<double, 3u>, 
> TMovingImage = itk::Image<double, 3u>]"
> File: /usr/local/ITK/ITK/Code/Algorithms/itkImageToImageMetric.txx
> Line: 93
> Description: itk::ERROR: MeanSquaresImageToImageMetric(0xa9a9b70): 
> FixedImageRegion is empty
> 
> 
> 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:
> 
>     typedef itk::Image< double, 3 > InputImageType;
>     typedef itk::VTKImageToImageFilter< InputImageType >  
> VTK2ITKConnectorFilterType;
>     VTK2ITKConnectorFilterType::Pointer VTK2ITKconnector = 
> VTK2ITKConnectorFilterType::New();
>     VTK2ITKconnector->SetInput( CT -> dataScalar -> getImageArray() 
> );                                                 // The expression in 
> the paranthesis is actually a vtkImage.
> 
> I appreciate your answers in advance.
> 
> 
> -- 
> Vural Ozbudak
> Bogazici University, Istanbul
> vavlab.ee.boun.edu.tr <http://vavlab.ee.boun.edu.tr>
> 
> 
> ------------------------------------------------------------------------
> 
> _____________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list