On 12/13/07, <b class="gmail_sendername">gabri</b> &lt;<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br>I would like to ask some questions.<br>I&#39;m trying to register two MR images but an error occurs when<br>registration process start.<br><br>*Parameters :<br>OptimizerParameters : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 
0.000937524,<br>0.000937524, 0.000937524</blockquote><div><br>At the risk of me sounding silly, it looks like you initialize your transform with all ones. That does not make an Identity matrix. That could explain why all the samples from the fixed image map outside the moving image.
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">MattesMutualInformationImageToImageMetric(0x8634cd0): Too many samples<br>map outside moving image buffer: 0 / 50*0
<br><br>1) reading the informations about the tranform , the description tells :<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;This class implements an Affine transform in which the<br>rotation center can be explicitly selected. Note that the method
<br>&quot;ComputeOffset()&quot; must be called just before using the transform for<br>mapping points, vectors or covariantvectors. This is necessary for<br>updating the offset of the transform taking into account the center of
<br>rotation&quot;</blockquote><div><br>That&#39;s legacy documentation left over. It predates the time when Centered transforms were reworked. They now derive for MatrixOffsetTransformBase which takes care of calling ComputeOffset() whenever you attempt to set the center/translation/rotation matrix. 
<br><br>We&#39;ve removed the misleading documentation. Thanks for the report.<br><br>/cvsroot/Insight/Insight/Code/Common/itkCenteredAffineTransform.h,v<br>new revision: 1.14; previous revision: 1.13<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
but the &quot;ComputeOffset()&quot; method is a private method so i couldn&#39;t use<br>it to compute the right offset.<br><br>2) there is a rule to set the NumberOfHistogramBins and the SpatialSamples?<br>*<br>&nbsp;&nbsp;&nbsp;&nbsp;mutualmetric-&gt;SetNumberOfHistogramBins(20);
<br>&nbsp;&nbsp;&nbsp;&nbsp;mutualmetric-&gt;SetNumberOfSpatialSamples(500);<br>&nbsp;&nbsp;&nbsp;&nbsp;registration-&gt;SetMetric( mutualmetric );<br>*my images dimensions are : fixed&nbsp;&nbsp;[91 109 91] -&nbsp;&nbsp;moving [125 , 512 , 512]</blockquote><div><br>The Number of spatial samples really depends on the dimension of your image. 5% of the samples is probably reasonable.&nbsp;
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">3) Beacuse of the images are obviously differente i&#39;m using the<br>HistgramMatchingFilter with this parameters
</blockquote><div><br>MI followed by Histrogram matching is a tad counter-intuitive. Histogram matching methods such as histogram equalization that you&#39;re using below is generally used when you intend using intensity sensitive metrics such as MeanSquares etc. Mutual information itself maximzes the mutual information, which is a function of the joint intensity distribution, so its inherently intended to be contrast/intensity insensitive
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;SetInput( movingImageReader-&gt;GetOutput() );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;SetReferenceImage( fixedImageReader-&gt;GetOutput() );
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;SetNumberOfHistogramLevels( 1024 );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;SetNumberOfMatchPoints( 500 );<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;ThresholdAtMeanIntensityOn();*<br>are they correct for the dimension? There is a method to compute them?
<br><br>4) the CenteredAffineTranform need 15 parameters to be set instead of 12<br>of the AffineTranform (that i&#39;ve been using before) the other 15<br>parameters are the center of rotation?<br>so that the first 9 are the matrix
<br>[M11......M33,CenterX,CenterY,CenterZ,<br>TranslationX,TranslationY,TranslationZ] is it correct?<br><br>best reguards ,<br><br>gabriele<br><br><br>_______________________________________________<br>Insight-users mailing list
<br><a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a><br><a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br><br><br></blockquote></div><br><br clear="all">
<br>-- <br>Karthik Krishnan<br>R&amp;D Engineer,<br>Kitware Inc.<br>Ph: 518 371 3971 x119<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;518 698 3045 (cell)<br>Fax: 518 371 3971