<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Re: [Insight-users] Applying a transform? PointSet registration?</TITLE>
</HEAD>
<BODY>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>I found the doxygen for
itkDefaultMeshTraits, and tried using this to ensure that the coordinate
representation matched the transform scalar type. However, I then get a problem
where the TransformMeshFilter tries to access the GetCellLinks method of the
PointSet, which does not exist. (at least that is how I interpret it) Here is
the entire new, minimal, example, followed by the error messages I get from
it.</FONT></DIV>
<DIV dir=ltr><PRE dir=ltr>------------The Program------------------------------------------------</PRE></DIV><PRE dir=ltr>#include "itkDefaultStaticMeshTraits.h"<BR>#include "itkPointSet.h"<BR>#include "itkEuler3DTransform.h"<BR>#include "itkTransformMeshFilter.h"<BR>#include <iostream><BR>#include <fstream><BR>int main(int argc, char * argv[] )<BR>{<BR> const unsigned int Dimension = 3;<BR> typedef float MyScalar;<BR> typedef itk::DefaultStaticMeshTraits<MyScalar,Dimension,Dimension,MyScalar,MyScalar,MyScalar> MyTraits;<BR> typedef itk::PointSet< MyScalar, Dimension,MyTraits > PointSetType;<BR> typedef itk::Euler3DTransform< MyScalar > TransformType;<BR> TransformType::Pointer transform = TransformType::New();<BR> typedef itk::TransformMeshFilter<PointSetType,PointSetType,TransformType> MoverType;<BR> MoverType::Pointer mover = MoverType::New();<BR> return EXIT_SUCCESS;<BR>}</PRE>
<DIV dir=ltr><FONT face=Arial size=2>--------------------------------The
Errors-----------------------------------------------------------------------------------------</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>[rcatwood@xe01 itk_examples]$
make<BR>Building dependencies cmake.check_depends...<BR>Building object file
IterativeClosestPoint2.o...<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:
In<BR> member function `void itk::TransformMeshFilter<TInputMesh,
TOutputMesh,<BR> TTransform>::GenerateData() [with TInputMesh =
main(int,<BR> char**)::PointSetType, TOutputMesh = main(int,
char**)::PointSetType,<BR> TTransform = main(int,
char**)::TransformType]':<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkPointLocator.txx:161:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:107:
no<BR> matching function for call to `itk::PointSet<MyScalar, 3,
main(int,<BR>
char**)::MyTraits>::GetCellLinks()'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkPointLocator.txx:161:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:109:
no<BR> matching function for call to `itk::PointSet<MyScalar, 3,
main(int,<BR>
char**)::MyTraits>::GetCells()'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkPointLocator.txx:161:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:110:
no<BR> matching function for call to `itk::PointSet<MyScalar, 3,
main(int,<BR>
char**)::MyTraits>::GetCellData()'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkPointLocator.txx:161:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:113:
`<BR> MaxTopologicalDimension' is not a member of type
`main(int,<BR>
char**)::PointSetType'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkPointLocator.txx:161:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:117:
no<BR> matching function for call to `itk::PointSet<MyScalar, 3,
main(int,<BR> char**)::MyTraits>::GetBoundaryAssignments(unsigned
int&)'<BR>make[1]: *** [IterativeClosestPoint2.o] Error 1<BR>make: ***
[default_target] Error 2<BR>[rcatwood@xe01 itk_examples]$<BR></FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV dir=ltr><BR></FONT>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Luis Ibanez
[mailto:luis.ibanez@kitware.com]<BR><B>Sent:</B> Thu 19/05/2005
03:51<BR><B>To:</B> Atwood, Robert C<BR><B>Cc:</B> ITK Users<BR><B>Subject:</B>
Re: [Insight-users] Applying a transform? PointSet
registration?<BR></FONT><BR></DIV>
<DIV><BR><BR>
<P><FONT size=2>Hi Robert,<BR><BR><BR><BR>1) You are right, the current name of
the TransformMeshFilter is<BR> misleading. It should
probably be called TransformPointSetFilter.<BR><BR><BR>2) You can transform a
single point. Just call the TransformPoint()<BR> method of any
Transform. There is no need for creating a Point<BR> Set
of a single point.<BR><BR><BR>3) The reason why you are being asked for a
MultipleValued optimizer<BR> is that you took code from a
point set optimization where the<BR> cost function is
multivalue. E.g. the cost function "value" is<BR> an array of
N values. (N= number of points in the point set).<BR><BR> You
can simply change the PointSet metric for another one that<BR>
computes things like the sum of square distances between the
points.<BR><BR><BR>4) Yeap,... in principle, the registration framework lets
you<BR> mix any type of opmizer. However in practice, not all
combinations<BR> make sense. For example, As you just
found. It doesn't makes sense<BR> to use a SingleValued
optimizer for optimizing a MultipleValues<BR> cost
function.<BR><BR> Some optimizers are quite tailored to
particular cases. For example,<BR> the VersorRigid3DOptimizer
is intended to be used *ONLY* with the<BR>
VersorRigid3DTransform.<BR><BR><BR><BR><BR><BR>
Regards,<BR><BR><BR>
Luis<BR><BR><BR><BR>------------------------<BR>Atwood, Robert C
wrote:<BR><BR>> Thanks Luis! I thought was something like that ,but for some
reason it<BR>> was not clear to me that a PointSet is able to be used where a
'mesh<BR>> type' is asked for. I had looked at this doxygen page but assumed
it had<BR>> to be a mesh (with polygons, edges etc) I guess you meant<BR>>
TransformMeshFilter when you typed TransformMeshImageFilter.<BR>><BR>> Can
a transform be applied to a single point, or would you create a<BR>> pointset
with one point in it ? More generally , how do I know what<BR>> types of
class can go in TInputMesh?<BR>><BR>> itk::TransformMeshFilter<
TInputMesh, TOutputMesh, TTransform > Class<BR>> Template
Reference<BR>><BR>> Next question: Since I successfully used
VersorRigid3dTransform for<BR>> registering 3D image files I thought I could
use this transform for<BR>> registring point sets that may be offset and
rotated. However, if I try<BR>> to plug the special Versor optimizer into the
registration method, it<BR>> comlains that it requires a
MultipleValuedNonLinearOptimizer. I don't<BR>> know exactly what that means
in this context, but follwing the example<BR>> in the Software Guide I used
Euler3dTransform instead. So far so good...<BR>><BR>> But, when looking in
the Doxygen pages for<BR>> PointSetToPOintSetRegistrationMethod it
says:<BR>><BR>> "The registration method also support a generic optimizer
that can be<BR>> selected at run-time. The only restriction for the optimizer
is that it<BR>> should be able to operate in single-valued cost functions
given that the<BR>> metrics used to compare PointSet with PointSets provide a
single value<BR>> as output."<BR>><BR>> Then, when I look at the
optimizer used in the example<BR>> LevenbergMarquardtOptimizer , and go to
its parent class,<BR>> MultipleValuedNonLinearVnlOptimizer, it
says:<BR>><BR>> "This class is a base for the Optimization methods that
optimize a<BR>> single valued function."<BR>><BR>> Its parent class
says:<BR>><BR>> MultipleValuedNonLinearOptimizer<BR>> "This class is a
base for the Optimization methods that optimize a<BR>> multiple valued
function."<BR>><BR>> So I am confused about when it is, or just what is,
"single" or<BR>> "multiple" valued and then how to decide which optimizer
will work with<BR>> which registration method?<BR>><BR>> I am thinking
about future uses as I think the Levenberg-Marquardt with<BR>> Euler3d will
work for this purpose. For example we might wish to<BR>> register images
and/or point-scans of the prosthsis to various medical<BR>> images of the
patient , then I would need to use other registration<BR>> methods and
figure out which optimizer works with it!<BR>><BR>><BR>> Thanks
again.<BR>> Robert<BR>><BR>><BR>><BR>> -----Original
Message-----<BR>> From: Luis Ibanez [<A
href="mailto:luis.ibanez@kitware.com">mailto:luis.ibanez@kitware.com</A>]<BR>>
Sent: Fri 5/13/2005 1:48 PM<BR>> To: Atwood, Robert C<BR>> Cc: ITK
Users<BR>> Subject: Re: [Insight-users] Applying a transform? PointSet
registration?<BR>><BR>><BR>> Hi Robert,<BR>><BR>><BR>> The
class that you are looking for is the:<BR>><BR>>
TransformMeshImageFilter:<BR>> <A
href="http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformMeshFilter.html">http://www.itk.org/Insight/Doxygen/html/classitk_1_1TransformMeshFilter.html</A><BR>><BR>>
Simply instantiate this filter using your PointSet<> as template<BR>>
parameter. Then connect as inputs your Transform and your input<BR>>
PointSet.<BR>><BR>> The filter will apply the Transform to all the Points
in your PointSet.<BR>><BR>><BR>>
Regards,<BR>><BR>><BR>>
Luis<BR>><BR>><BR>><BR>>
--------------------------------------------------------------------------------<BR>>
Atwood, Robert C wrote:<BR>> > I have been poring through the
software guide and the Doxygen for hours,<BR>> > and I cannot see
how to apply a transform to a point or a PointSet? I<BR>> > know how
to apply to an image, you create a resample image filter and<BR>> >
set the transform , is there a similar filter for PointSets (and what
is<BR>> > it called) or is the process different?<BR>>
><BR>> ><BR>> > The immediate goal is to register two
point sets, then somehow quantify<BR>> > the difference between
them. I believe that this would be enabled by<BR>> > transforming
one of the point set into the space of the other according<BR>> > to
the result of the registration.<BR>> ><BR>> > The
overall goal is to quantify (and eventually minimize) the misfit
of<BR>> > certain prostheses introduced at certain stages during the
manufacturing<BR>> > process, by scanning 'before' and 'after'
examples. The scan method<BR>> > produces a point set. The point set
is not necessarily any sort of<BR>> > regular grid. (The points are
in 3-d by the way) The 2 sets should<BR>> > generally be
reasonably close to each other to start with (by placing<BR>> > the
example in the same location and orientation)<BR>> ><BR>>
><BR>> ><BR>> > Thanks,<BR>> >
Robert<BR>> ><BR>> ><BR>> ><BR>>
><BR>> ><BR>> >
------------------------------------------------------------------------<BR>>
><BR>> >
_______________________________________________<BR>> > Insight-users
mailing list<BR>> > Insight-users@itk.org<BR>> > <A
href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR>><BR>><BR>><BR>><BR>><BR>><BR>><BR>>
------------------------------------------------------------------------<BR>><BR>>
_______________________________________________<BR>> Insight-users mailing
list<BR>> Insight-users@itk.org<BR>> <A
href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR><BR><BR></FONT></P></DIV>
</BODY>
</HTML>