<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>hello;</DIV>
<DIV>I tried to implement pointsetToImageRegistration.&nbsp; in existing example&nbsp; fixed pointset is created by user. But I have also a <EM>mesh</EM>. I would like to use that <EM>mesh</EM> as a fixed point set. To do that I have to modify the following part of the existing example.&nbsp; I have tried a several ways but I couldn't achieve . what should i use instead of <EM><FONT color=#ff7f00>fixedImage</FONT> .</EM>Well, I use&nbsp; the variable of <EM>mesh</EM> (which I try to use as fixedpointset) instead of&nbsp; <EM><FONT color=#ff0000>fixedPointSet</FONT></EM>. But What about the variable of <EM>fixedImage.</EM> I hope it is clear to understand</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks a lot</DIV>
<DIV>Tony</DIV>
<DIV><FONT color=#008000 size=2>
<P></FONT>&nbsp;</P><FONT color=#008000>
<P>//-----------------------------------------------------------</P>
<P>// Create the point set and load it with data by sampling </P>
<P>// the fixed image</P>
<P>//-----------------------------------------------------------</P></FONT>
<P><FONT color=#0000ff>typedef</FONT> itk::PointSet&lt; <FONT color=#0000ff>float</FONT>, 2 &gt; FixedPointSetType;</P>
<P>FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New();</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>unsigned</FONT> <FONT color=#0000ff>int</FONT> numberOfPoints = 10000;</P>
<P><FONT color=#ff0000>fixedPointSet</FONT>-&gt;SetPointData( FixedPointSetType::PointDataContainer::New() );</P>
<P><FONT color=#ff007f>fixedPointSet</FONT>-&gt;GetPoints()-&gt;Reserve( numberOfPoints );</P>
<P><FONT color=#ff0000>fixedPointSet</FONT>-&gt;GetPointData()-&gt;Reserve( numberOfPoints );</P>
<P><FONT color=#0000ff>typedef</FONT> itk::ImageRegionConstIterator&lt; FixedImageType &gt; ImageIteratorType;</P>
<P>ImageIteratorType it( <FONT color=#ff7f00>fixedImage</FONT>, <FONT color=#ff7f00>fixedImage</FONT>-&gt;GetBufferedRegion() );</P>
<P><FONT color=#0000ff>const</FONT> <FONT color=#0000ff>unsigned</FONT> <FONT color=#0000ff>int</FONT> skip = </P>
<P><FONT color=#ff7f00>fixedImage</FONT>-&gt;GetBufferedRegion().GetNumberOfPixels() / numberOfPoints;</P>
<P><FONT color=#0000ff>unsigned</FONT> <FONT color=#0000ff>int</FONT> counter = 0;</P>
<P>FixedPointSetType::PointIdentifier pointId = 0;</P>
<P>FixedPointSetType::PointType point;</P>
<P>it.GoToBegin();</P>
<P><FONT color=#0000ff>while</FONT>( !it.IsAtEnd() )</P>
<P>{</P>
<P><FONT color=#0000ff>if</FONT>( counter==0 )</P>
<P>{</P>
<P>fixedImage-&gt;TransformIndexToPhysicalPoint( it.GetIndex(), point );</P>
<P>fixedPointSet-&gt;SetPoint( pointId, point );</P>
<P>fixedPointSet-&gt;SetPointData( pointId, it.Get() );</P>
<P>++pointId; </P>
<P><FONT color=#0000ff>if</FONT>( pointId == numberOfPoints )</P>
<P>{</P>
<P><FONT color=#0000ff>break</FONT><FONT size=2><FONT size=3>;</FONT></P>
<P><FONT size=3>}</FONT></P>
<P><FONT size=3>counter = skip;</FONT></P>
<P><FONT size=3>}</FONT></P>
<P><FONT size=3>--counter;</FONT></P>
<P><FONT size=3>++it;</FONT></P>
<P><FONT size=3>}</FONT></P></FONT></DIV></div><br>

<hr size=1>We won't tell. Get more on <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">shows you hate to love</a><br>(and love to hate): <a href="http://us.rd.yahoo.com/evt=49980/*http://tv.yahoo.com/collections/265
">Yahoo! TV's Guilty Pleasures list.</a></body></html>