[Insight-users] Using saved deformation fields on any given Image

Raj, Rejitha rejitha.raj at philips.com
Thu Feb 26 22:11:36 EST 2009


Hi,
  I am trying to save the deformation field from some images and the apply the same deformation field on another set of images. For saving the deformation field I am using a file write and saving it as .mhd file as given in the example DeformableRegistration5.cxx

  typedef itk::ImageFileWriter< DeformationFieldType > FieldWriterType;
  FieldWriterType::Pointer fieldWriter = FieldWriterType::New();
  fieldWriter->SetFileName("DeformationFieldBuffer.mhd");
  fieldWriter->SetInput( filter->GetDeformationField() ); ///here filter is LevelSetMotionRegistrationFilter type
  DeformationFieldType::Pointer deformationMap = filter->GetDeformationField();

  fieldWriter->Update();

 Then I am trying to apply the same on another image as following here reader is imagefilereader for an image of type .mha.

  warper1->SetInput( reader->GetOutput() );
  warper1->SetInterpolator( interpolator1 );
  warper1->SetOutputSpacing( reader->GetOutput()->GetSpacing() );
  warper1->SetOutputOrigin( reader->GetOutput()->GetOrigin() );

  warper1->SetDeformationField(deformationMap);
  warper1->Update();


   typedef itk::ImageFileWriter< ImageType > WriterType;
   WriterType::Pointer writer = WriterType::New();
   writer->SetFileName("Result.mha"  );
   writer->SetInput( warper1->GetOutput()   );
    writer->Update();


The update fails for warper1 as well as writer. I want to know how can I implement this? Can I use the Image DeformationFieldBuffer.mhd for setting the deformation field for the test image and for that whether I need to create another filter?

Regards,
Rejitha



________________________________
The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090227/4c73ab63/attachment-0001.htm>


More information about the Insight-users mailing list