<div dir="ltr">Hi all,<br><br>I'm trying to implement the itkTransformMeshFilter and i run into some problems. I have a deformation field (bspline parameters from an image to image registration) and I want to deform a mesh using the Bspline transform and its final parameters. I also tried using an affine transform and it gave me the same error on the .txx file. I tried the same thing using the Identity Transform and the filter compiled with no problems. I was wondering if I can get some help on what I'm doing wrong or just on how I can deform a mesh using my registration results. I attached the code and the error below. <br>
<br>Thanks,<br><br>.txx line where error appears:<br><br>m_Transform->TransformPoint( inputPoint.Value() );<br><br>e:\Federico\CT\Source\Insight\Code\BasicFilters\itkTransformMeshFilter.txx(96) : error C2664: 'itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::OutputPointType itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::TransformPoint(const itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::InputPointType &) const' : cannot convert parameter 1 from 'const itk::MapContainer<TElementIdentifier,TElement>::Element' to 'const itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::InputPointType &'<br>
<br><br><br><br><br>Here's the code:<br><br> typedef itk::BSplineDeformableTransform< CoordinateRepType, SpaceDimension, SplineOrder > BsplineTransformType;<br> BsplineTransformType::Pointer bsplineFinalTransform = BsplineTransformType::New();<br>
RegistrationType2::ParametersType finalPar = registration2->GetLastTransformParameters();<br> bsplineFinalTransform->SetParameters( finalPar );<br><br> //Transform Meshes<br> typedef itk::TransformMeshFilter< HeartMeshType, HeartMeshType, BsplineTransformType > TransformHeartMeshFilterType;<br>
TransformHeartMeshFilterType::Pointer transformHeartMesh = TransformHeartMeshFilterType::New();<br><br> transformHeartMesh->SetInput( heartMesh );<br> transformHeartMesh->SetTransform( bsplineFinalTransform );<br>
transformHeartMesh->Update();<br><br>The error:<br>e:\Federico\CT\Source\Insight\Code\BasicFilters\itkTransformMeshFilter.txx(96) : error C2664: 'itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::OutputPointType itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::TransformPoint(const itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::InputPointType &) const' : cannot convert parameter 1 from 'const itk::MapContainer<TElementIdentifier,TElement>::Element' to 'const itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::InputPointType &'<br>
with<br> [<br> TScalarType=CoordinateRepType,<br> NDimensions=3,<br> VSplineOrder=3<br> ]<br> and<br> [<br> TElementIdentifier=itk::DefaultDynamicMeshTraits<float,3,3>::PointIdentifier,<br>
TElement=itk::DefaultDynamicMeshTraits<float,3,3>::PointType<br> ]<br> and<br> [<br> TScalarType=CoordinateRepType,<br> NDimensions=3,<br> VSplineOrder=3<br>
]<br> Reason: cannot convert from 'const itk::MapContainer<TElementIdentifier,TElement>::Element' to 'const itk::BSplineDeformableTransform<TScalarType,NDimensions,VSplineOrder>::InputPointType'<br>
with<br> [<br> TElementIdentifier=itk::DefaultDynamicMeshTraits<float,3,3>::PointIdentifier,<br> TElement=itk::DefaultDynamicMeshTraits<float,3,3>::PointType<br> ]<br>
and<br> [<br> TScalarType=CoordinateRepType,<br> NDimensions=3,<br> VSplineOrder=3<br> ]<br> No constructor could take the source type, or constructor overload resolution was ambiguous<br>
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\xtree(267) : while compiling class-template member function 'void itk::TransformMeshFilter<TInputMesh,TOutputMesh,TTransform>::GenerateData(void)'<br>
with<br> [<br> TInputMesh=HeartMeshType,<br> TOutputMesh=HeartMeshType,<br> TTransform=TransformType3<br> ]<br> \Federico\CT\C\DeformHeart3D\DeformHeart3D.cxx(467) : see reference to class template instantiation 'itk::TransformMeshFilter<TInputMesh,TOutputMesh,TTransform>' being compiled<br>
with<br> [<br> TInputMesh=HeartMeshType,<br> TOutputMesh=HeartMeshType,<br> TTransform=TransformType3<br> ]<br><br clear="all"><br>-- <br>Federico J. Lopez Bertoni<br>
Graduate Research Assistant<br>Duke University<br>Department of Biomedical Engineering<br>Office: 1373 CIEMAS<br>Phone: 919-660-5125<br><a href="mailto:fjlb@duke.edu">fjlb@duke.edu</a><br>
</div>