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

Vural Özbudak dvozbudak at gmail.com
Thu Apr 16 13:26:55 EDT 2009


Hello Luis,

Thanks so much for the solution you offered. I actually figured out that I
missed the Update() method in the VTK2ITKconnector, but it didn't have an
Update() function, so I called VTK2ITKconnector->GetImporter()->Update();
That solved the empty FixedImageRegion problem.

Then I encountered another error which is
itk::InvalidRequestedRegionError'
  what():  /usr/local/ITK/ITK/Code/Common/itkDataObject.cxx:397:
Requested region is (at least partially) outside the largest possible
region.

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

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

I appreciate your warning about the DICOM reader, but I don'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.

My salutations,

Vural


On Thu, Apr 16, 2009 at 7:47 PM, Luis Ibanez <luis.ibanez at kitware.com>wrote:

>
> 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
>>
>


-- 
Vural Ozbudak
Bogazici University, Istanbul
vavlab.ee.boun.edu.tr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090416/3adba1d5/attachment.htm>


More information about the Insight-users mailing list