[Insight-users] Problems with the InverseDeformationFieldImageFilter

Marta Schmidt t_s_80 at gmx.de
Fri Mar 27 12:34:22 EDT 2009


Hello,

I have some trouble using the itkInverseDeformationFieldImageFilter.  
I'm using the BSplineWarping1.cxx example to generate a deformation  
field and it is working fine.
I can show the deformation field in paraview and it has a size of  
448KB. But now I need the inverse.
So I tried to use the itkInverseDeformationFieldImageFilter:

..
static const int Dimension = 2;
typedef itk::Vector< float, Dimension > VectorImagePixelType;
typedef itk::Image< VectorImagePixelType, Dimension > VectorImageType;

//read the deformation field produced by BSplineWarping1.cxx
typedef itk::ImageFileReader< VectorImageType > FieldReaderType;
FieldReaderType::Pointer fieldReader = FieldReaderType::New( );
fieldReader->SetFileName( "deformationField.vtk" );

//create the inverse
typedef itk::InverseDeformationFieldImageFilter< VectorImageType,  
VectorImageType > InverseDeformationFieldFilterType;
InverseDeformationFieldFilterType::Pointer inverseDeformFilter =  
InverseDeformationFieldFilterType::New( );
inverseDeformFilter->SetInput( fieldReader->GetOutput( ) );

//save the inverse	
typedef itk::ImageFileWriter< VectorImageType > FieldWriterType;
FieldWriterType::Pointer fieldWriter = FieldWriterType::New( );
fieldWriter->SetFileName( "deformationFieldInverse.vtk" );
fieldWriter->SetInput( inverseDeformFilter->GetOutput( ) );
fieldWriter->Update( );
..

But the resulting deformation field is empty if I use paraview to show  
it. The size is also just 4KB.
Can somebody tell me what I did wrong?

Best regards,
Marta



More information about the Insight-users mailing list