<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. in existing example 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. 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 the variable of <EM>mesh</EM> (which I try to use as fixedpointset) instead of <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> </DIV>
<DIV>Thanks a lot</DIV>
<DIV>Tony</DIV>
<DIV><FONT color=#008000 size=2>
<P></FONT> </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< <FONT color=#0000ff>float</FONT>, 2 > 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>->SetPointData( FixedPointSetType::PointDataContainer::New() );</P>
<P><FONT color=#ff007f>fixedPointSet</FONT>->GetPoints()->Reserve( numberOfPoints );</P>
<P><FONT color=#ff0000>fixedPointSet</FONT>->GetPointData()->Reserve( numberOfPoints );</P>
<P><FONT color=#0000ff>typedef</FONT> itk::ImageRegionConstIterator< FixedImageType > ImageIteratorType;</P>
<P>ImageIteratorType it( <FONT color=#ff7f00>fixedImage</FONT>, <FONT color=#ff7f00>fixedImage</FONT>->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>->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->TransformIndexToPhysicalPoint( it.GetIndex(), point );</P>
<P>fixedPointSet->SetPoint( pointId, point );</P>
<P>fixedPointSet->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>