[ITK Community] [Insight-users] Making a deformation field denser in order to deform points
Yago Diez
yagodiezdonoso at gmail.com
Sat Dec 7 10:48:33 EST 2013
First of all, thanks a lot for your answer and sorry I couldn't solve the
problem on my own. I have been fighting for a while with this but so far I
have not had much success. At least I am now a bit more aware of how many
things I don't know.
First of all, I realise what I want to do boils down to :
typename CompositeTransformType::Pointer compositeTransform =
CompositeTransformType::New();
compositeTransform->AddTransform( deffield);
compositeTransform->TransformPoint( p0 );
The problem now is that *my deformation field is not recognised as a valid
transformation*.
My deformation field which is the output of demons registration and it is
stored in a file in mha format. I read it like this (as a vector image as
used to be done in itk3):
typedef float PixelType;
> typedef float VectorComponentType;
>
> const unsigned int Dimension = 3;
>
> typedef itk::Vector< PixelType, Dimension > VectorPixelType;
> typedef itk::Image< VectorPixelType, Dimension > DeformationFieldType;
> typedef itk::ImageFileReader< DeformationFieldType > ReaderType;
>
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName(argv[1]);
> reader->Update();
> DeformationFieldType::Pointer deffield = reader->GetOutput();
>
When I try to add it to the composite transform, however, I get the error:
/media/disc4/code/newTransformPoints.cxx:112:47: error: no matching
function for call to ‘itk::CompositeTransform<float,
3u>::AddTransform(itk::Image<itk::Vector<float, 3u>, 3u>::Pointer&)’
/media/disc4/code/newTransformPoints.cxx:112:47: note: candidate is:
/usr/local/include/ITK-4.4/itkMultiTransform.h:145:16: note: void
itk::MultiTransform<TScalar, NDimensions,
NSubDimensions>::AddTransform(itk::MultiTransform<TScalar, NDimensions,
NSubDimensions>::TransformType*) [with TScalar = float, unsigned int
NDimensions = 3u, unsigned int NSubDimensions = 3u,
itk::MultiTransform<TScalar, NDimensions, NSubDimensions>::TransformType =
itk::Transform<float, 3u, 3u>]
/usr/local/include/ITK-4.4/itkMultiTransform.h:145:16: note: no known
conversion for argument 1 from ‘itk::Image<itk::Vector<float, 3u>,
3u>::Pointer {aka itk::SmartPointer<itk::Image<itk::Vector<float, 3u>, 3u>
>}’ to ‘itk::MultiTransform<float, 3u, 3u>::TransformType* {aka
itk::Transform<float, 3u, 3u>*}’
More information about the Community
mailing list