<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 id=idOWAReplyText28693 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Hi Luis,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>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.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>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. </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>Once an instance of the transform filter is
created , the program will not compile. </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>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;</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Thanks again,<BR>Robert</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2><FONT
face="Courier New"><BR> </DIV></FONT></FONT>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Diff from the example:</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2><FONT face="Courier New">[rcatwood@xe01
itk_examples]$ diff ../itk_examples_src/IterativeClosestPoint2.cxx
/sources/local/ITK_cvs/Examples/Patented/IterativeClosestPoint2.cxx<BR>36d35<BR><
#include "itkTransformMeshFilter.h"<BR>142,143d140<BR>< typedef
itk::TransformMeshFilter<PointSetType,PointSetType,TransformType>
MoverType;<BR>< MoverType::Pointer mover =
MoverType::New();<BR>[rcatwood@xe01 itk_examples]$<BR></FONT></DIV></FONT><FONT
face=Arial size=2></FONT></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>
<DIV dir=ltr><FONT face=Arial size=2>This generates the errors
below:</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2><FONT face="Courier New">[rcatwood@xe01
itk_examples]$ make<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/include/c++/3.2.3/bits/locale_facets.h:115:
instantiated from
here<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:95:
no<BR> matching function for call to
`itk::Euler3DTransform<double>::TransformPoint<BR> (const
itk::Point<float,
3>&)'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/Common/itkMatrixOffsetTransformBase.txx:197:
candidates<BR> are: itk::Point<TScalarType,
itk::MatrixOffsetTransformBase<TScalarType,<BR> NInputDimensions,
NOutputDimensions>::OutputSpaceDimension><BR>
itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,<BR>
NOutputDimensions>::TransformPoint(const
itk::Point<TScalarType,<BR>
itk::MatrixOffsetTransformBase<TScalarType, NInputDimensions,<BR>
NOutputDimensions>::InputSpaceDimension>&) const [with TScalarType =
double,<BR> unsigned int NInputDimensions = 3, unsigned int
NOutputDimensions =
3]<BR>/usr/include/c++/3.2.3/bits/locale_facets.h:115: 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<float,
3,<BR> itk::DefaultStaticMeshTraits<float, 3, 3, float, float,
float> >::<BR>
GetCellLinks()'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:109:
no<BR> matching function for call to `itk::PointSet<float,
3,<BR> itk::DefaultStaticMeshTraits<float, 3, 3, float, float,
float> >::GetCells()<BR>
'<BR>/usr/local/encap/ITK_2.0.1.0/include/InsightToolkit/BasicFilters/itkTransformMeshFilter.txx:110:
no<BR> matching function for call to `itk::PointSet<float,
3,<BR> itk::DefaultStaticMeshTraits<float, 3, 3, float, float,
float> >::<BR>
GetCellData()'<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/BasicFilters/itkTransformMeshFilter.txx:117:
no<BR> matching function for call to `itk::PointSet<float,
3,<BR> itk::DefaultStaticMeshTraits<float, 3, 3, float, float,
float> >::<BR> GetBoundaryAssignments(unsigned
int&)'<BR>make[1]: *** [IterativeClosestPoint2.o] Error 1<BR>make: ***
[default_target] Error 2<BR>[rcatwood@xe01
itk_examples]$<BR></FONT></DIV></FONT></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><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>