[Insight-users] Applying a transform? PointSet registration?

Atwood, Robert C r.atwood at imperial.ac.uk
Mon May 23 15:07:15 EDT 2005


Hi Luis,
Thanks for your help and insight :0 but back to basics, I have actually tried to apply the transform and I am having some very basic trouble.
I included the header for itkTransformMeshFilter.h and templated such a filter, modifying Examples/Patented/IterativeClosestPoint2.cxx for this purpose as this one is used in the users guide. 
Once an instance of the transform filter is created , the program will not compile. 
Below  is the diff from the original example (only 3 lines different ) I have tried changing PointSet <float,Dimension> to PointSet<double,Dimension>  (line 54 in the original) with similar results;
 
Thanks again,
Robert
 

 
 
Diff from the example:
 
 
[rcatwood at xe01 itk_examples]$ diff ../itk_examples_src/IterativeClosestPoint2.cxx /sources/local/ITK_cvs/Examples/Patented/IterativeClosestPoint2.cxx
36d35
< #include "itkTransformMeshFilter.h"
142,143d140
<   typedef itk::TransformMeshFilter<PointSetType,PointSetType,TransformType> MoverType;
<   MoverType::Pointer mover = MoverType::New();
[rcatwood at xe01 itk_examples]$

 
 
This generates the errors below:
 
 
[rcatwood at xe01 itk_examples]$ make
Building object file IterativeClosestPoint2.o...
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx: In
   member function `void itk::TransformMeshFilter<TInputMesh, TOutputMesh,
   TTransform>::GenerateData() [with TInputMesh = main(int,
   char**)::PointSetType, TOutputMesh = main(int, char**)::PointSetType,
   TTransform = main(int, char**)::TransformType]':
/usr/include/c++/3.2.3/bits/locale_facets.h:115:   instantiated from here
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:95: no
   matching function for call to `itk::Euler3DTransform<double>::TransformPoint
   (const itk::Point<float, 3>&)'
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkMatrixOffsetTransformBase.txx:197: candidates
   are: itk::Point<TScalarType, itk::MatrixOffsetTransformBase<TScalarType,
   NInputDimensions, NOutputDimensions>::OutputSpaceDimension>
   itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
   NOutputDimensions>::TransformPoint(const itk::Point<TScalarType,
   itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,
   NOutputDimensions>::InputSpaceDimension>&) const [with TScalarType = double,
   unsigned int NInputDimensions = 3, unsigned int NOutputDimensions = 3]
/usr/include/c++/3.2.3/bits/locale_facets.h:115:   instantiated from here
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:107: no
   matching function for call to `itk::PointSet<float, 3,
   itk::DefaultStaticMeshTraits<float, 3, 3, float, float, float> >::
   GetCellLinks()'
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:109: no
   matching function for call to `itk::PointSet<float, 3,
   itk::DefaultStaticMeshTraits<float, 3, 3, float, float, float> >::GetCells()
   '
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:110: no
   matching function for call to `itk::PointSet<float, 3,
   itk::DefaultStaticMeshTraits<float, 3, 3, float, float, float> >::
   GetCellData()'
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:113: `
   MaxTopologicalDimension' is not a member of type `main(int,
   char**)::PointSetType'
/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:117: no
   matching function for call to `itk::PointSet<float, 3,
   itk::DefaultStaticMeshTraits<float, 3, 3, float, float, float> >::
   GetBoundaryAssignments(unsigned int&)'
make[1]: *** [IterativeClosestPoint2.o] Error 1
make: *** [default_target] Error 2
[rcatwood at xe01 itk_examples]$

________________________________

From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
Sent: Thu 19/05/2005 03:51
To: Atwood, Robert C
Cc: ITK Users
Subject: Re: [Insight-users] Applying a transform? PointSet registration?





Hi Robert,



1) You are right, the current name of the TransformMeshFilter is
    misleading. It should  probably be called TransformPointSetFilter.


2) You can transform a single point. Just call the TransformPoint()
    method of any Transform.  There is no need for creating a Point
    Set of a single point.


3) The reason why you are being asked for a MultipleValued optimizer
    is that you took code from a point set optimization where the
    cost function is multivalue. E.g. the cost function "value" is
    an array of N values. (N= number of points in the point set).

    You can simply change the PointSet metric for another one that
    computes things like the sum of square distances between the points.


4) Yeap,... in principle, the registration framework lets you
    mix any type of opmizer. However in practice, not all combinations
    make sense.  For example, As you just found. It doesn't makes sense
    to use a SingleValued optimizer for optimizing a MultipleValues
    cost function.

    Some optimizers are quite tailored to particular cases. For example,
    the VersorRigid3DOptimizer is intended to be used *ONLY* with the
    VersorRigid3DTransform.





  Regards,


      Luis



------------------------
Atwood, Robert C wrote:

> Thanks Luis! I thought was something like that ,but for some reason it
> was not clear to me that a PointSet is able to be used where a 'mesh
> type' is asked for. I had looked at this doxygen page but assumed it had
> to be a mesh (with polygons, edges etc) I guess you meant
> TransformMeshFilter when you typed TransformMeshImageFilter.
>
> Can a transform be applied to a single point, or would you create a
> pointset with one point in it ? More generally , how do I know what
> types of class can go in TInputMesh?
>
> itk::TransformMeshFilter< TInputMesh, TOutputMesh, TTransform > Class
> Template Reference
>
> Next question: Since I successfully used VersorRigid3dTransform for
> registering 3D image files I thought I could use this transform for
> registring point sets that may be offset and rotated. However, if I try
> to plug the special Versor optimizer into the registration method, it
> comlains that it requires a MultipleValuedNonLinearOptimizer. I don't
> know exactly what that means in this context, but follwing the example
> in the Software Guide I used Euler3dTransform instead. So far so good...
>
> But, when looking in the Doxygen pages for
> PointSetToPOintSetRegistrationMethod it says:
>
> "The registration method also support a generic optimizer that can be
> selected at run-time. The only restriction for the optimizer is that it
> should be able to operate in single-valued cost functions given that the
> metrics used to compare PointSet with PointSets provide a single value
> as output."
>
> Then, when I look at the optimizer used in the example
> LevenbergMarquardtOptimizer , and go to its parent class,
> MultipleValuedNonLinearVnlOptimizer, it says:
>
> "This class is a base for the Optimization methods that optimize a
> single valued function."
>
> Its parent class says:
>
> MultipleValuedNonLinearOptimizer
> "This class is a base for the Optimization methods that optimize a
> multiple valued function."
>
> So I am confused about when it is, or just what is, "single" or
> "multiple" valued and then how to decide which optimizer will work with
> which registration method?
>
> I am thinking about future uses as I think the Levenberg-Marquardt with
> Euler3d will work for this purpose. For example we might wish to
> register images and/or point-scans of the prosthsis to various medical
> images of the patient  , then I would need to use other registration
> methods and figure out which optimizer works with it!
>
>
> Thanks again.
> Robert
>
>
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Fri 5/13/2005 1:48 PM
> To: Atwood, Robert C
> Cc: ITK Users
> Subject: Re: [Insight-users] Applying a transform? PointSet registration?
>
>
> Hi Robert,
>
>
> The class that you are looking for is the:
>
> TransformMeshImageFilter:
> http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformMeshFilter.html
>
> Simply instantiate this filter using your PointSet<> as template
> parameter. Then connect as inputs your Transform and your input
> PointSet.
>
> The filter will apply the Transform to all the Points in your PointSet.
>
>
>    Regards,
>
>
>       Luis
>
>
>
> --------------------------------------------------------------------------------
> Atwood, Robert C wrote:
>  > I have been poring through the software guide and the Doxygen for hours,
>  > and I cannot see how to apply a transform to a point or a PointSet? I
>  > know how to apply to an image, you create a resample image filter and
>  > set the transform , is there a similar filter for PointSets (and what is
>  > it called) or is the process different?
>  >
>  >
>  > The immediate goal is to register two point sets, then somehow quantify
>  > the difference between them. I believe that this would be enabled by
>  > transforming one of the point set into the space of the other according
>  > to the result of the registration.
>  >
>  > The overall goal is to quantify (and eventually minimize) the misfit of
>  > certain prostheses introduced at certain stages during the manufacturing
>  > process, by scanning 'before' and 'after' examples. The scan method
>  > produces a point set. The point set is not necessarily any sort of
>  > regular grid. (The points are in  3-d by the way) The 2 sets should
>  > generally be reasonably close to each other to start with (by placing
>  > the example in the same location and orientation)
>  >
>  >
>  >
>  > Thanks,
>  > Robert
>  >
>  >
>  >
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > _______________________________________________
>  > Insight-users mailing list
>  > Insight-users at itk.org
>  > http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050523/c039f2bd/attachment.htm


More information about the Insight-users mailing list