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 Karthik,<br>thanks for your reply.<br>I&#39;ve done what you suggested about the initialization in this way :<br><br>TransfomParameters:&nbsp;&nbsp;[1, 0, 0, 0, 1, 0, 0, 0, 1, 89.9859, 110.013,<br>78.0862, 4.02741, -0.754015, -9.40034
]<br>OptimizerScales&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: [1, 0, 0, 0, 1, 0, 0, 0, 1, 10000, 10000,<br>10000, 0.000937524, 0.000937524, 0.000937524]</blockquote><div>&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;">
/home/gabri/lib/InsightToolkit-3.4.0/Utilities/vxl/core/vnl/vnl_matrix.txx:<br>1192: matrix has non-finite elements<br>/home/gabri/lib/InsightToolkit-3.4.0/Utilities/vxl/core/vnl/vnl_matrix.txx:<br>here it is:<br>1 nan nan
<br>nan 1 nan<br>nan nan 1<br>/home/gabri/lib/InsightToolkit-3.4.0/Utilities/vxl/core/vnl/vnl_matrix.txx:<br>calling abort()<br>0&nbsp;&nbsp; -0.741588&nbsp;&nbsp; [1, nan, nan, nan, 1, nan, nan, nan, 1, 89.9859,<br>110.013, 78.0862, 4.02741
, -0.754015, -9.40034]Aborted<br><br><br>this is why i&#39;ve initialize all the first 9 elements of the<br>optimizerScales to 1.0 .... is it correct?</blockquote><div><br>I might have misunderstood. Having the first 9 parameters of the optimizer scale as [1 1 1 1 1 1 1 1 1] is reasonable as long as you set much larger scales for the rotation and the center of rotation (the next 6 parameters).
<br><br>I was hinting that the initial *transform* parameters ought to be [1 0 0 0 1 0 0 0 1], and not [1 1 1 1 1 1 1 1 1].<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;">
**MI followed by Histrogram matching is a tad counter-intuitive.<br>Histogram matching methods such as histogram equalization that you&#39;re<br>using below is generally used when you intend using intensity sensitive<br>metrics such as MeanSquares etc. Mutual information itself maximzes the
<br>mutual information, which is a function of the joint intensity<br>distribution, so its inherently intended to be contrast/intensity<br>insensitive **<br><br>Indeed is not followed I use the HistogramMatchingFilter in the
<br>beginning of my programs but if U say that is useless I&#39;ll cancel it.<br><br>**That&#39;s legacy documentation left over. It predates the time when<br>Centered transforms were reworked. They now derive for<br>MatrixOffsetTransformBase which takes care of calling ComputeOffset()
<br>whenever you attempt to set the center/translation/rotation matrix. **<br><br>So i do not have to ComputeOffset the CenteredAffineTransform will<br>compute it itself right ?</blockquote><div><br>yes <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;">
Sincerly,<br><br>Gabriele<br><br><br>Karthik Krishnan ha scritto:<br>&gt; On 12/13/07, *gabri* &lt;<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a> &lt;mailto:<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a>&gt;&gt; wrote:
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Hi all,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I would like to ask some questions.<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; I&#39;m trying to register two MR images but an error occurs when<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; registration process start.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; *Parameters :
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; OptimizerParameters : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 0.000937524,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 0.000937524, 0.000937524<br>&gt;<br>&gt;<br>&gt; At the risk of me sounding silly, it looks like you initialize your
<br>&gt; transform with all ones. That does not make an Identity matrix. That<br>&gt; could explain why all the samples from the fixed image map outside the<br>&gt; moving image.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; MattesMutualInformationImageToImageMetric(0x8634cd0): Too many samples
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; map outside moving image buffer: 0 / 50*0<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 1) reading the informations about the tranform , the description<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; tells :<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;This class implements an Affine transform in which the
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; rotation center can be explicitly selected. Note that the method<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; &quot;ComputeOffset()&quot; must be called just before using the transform for<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; mapping points, vectors or covariantvectors. This is necessary for
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; updating the offset of the transform taking into account the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; center of<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; rotation&quot;<br>&gt;<br>&gt;<br>&gt; That&#39;s legacy documentation left over. It predates the time when<br>&gt; Centered transforms were reworked. They now derive for
<br>&gt; MatrixOffsetTransformBase which takes care of calling ComputeOffset()<br>&gt; whenever you attempt to set the center/translation/rotation matrix.<br>&gt;<br>&gt; We&#39;ve removed the misleading documentation. Thanks for the report.
<br>&gt;<br>&gt; /cvsroot/Insight/Insight/Code/Common/itkCenteredAffineTransform.h,v<br>&gt; new revision: 1.14; previous revision: 1.13<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; but the &quot;ComputeOffset()&quot; method is a private method so i couldn&#39;t use
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; it to compute the right offset.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 2) there is a rule to set the NumberOfHistogramBins and the<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; SpatialSamples?<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; *<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mutualmetric-&gt;SetNumberOfHistogramBins(20);
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mutualmetric-&gt;SetNumberOfSpatialSamples(500);<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; registration-&gt;SetMetric( mutualmetric );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; *my images dimensions are : fixed&nbsp;&nbsp;[91 109 91] -&nbsp;&nbsp;moving [125 ,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 512 , 512]
<br>&gt;<br>&gt;<br>&gt; The Number of spatial samples really depends on the dimension of your<br>&gt; image. 5% of the samples is probably reasonable.<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 3) Beacuse of the images are obviously differente i&#39;m using the
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; HistgramMatchingFilter with this parameters<br>&gt;<br>&gt;<br>&gt; MI followed by Histrogram matching is a tad counter-intuitive.<br>&gt; Histogram matching methods such as histogram equalization that you&#39;re
<br>&gt; using below is generally used when you intend using intensity<br>&gt; sensitive metrics such as MeanSquares etc. Mutual information itself<br>&gt; maximzes the mutual information, which is a function of the joint
<br>&gt; intensity distribution, so its inherently intended to be<br>&gt; contrast/intensity insensitive<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;matcher-&gt;SetInput( movingImageReader-&gt;GetOutput() );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matcher-&gt;SetReferenceImage( fixedImageReader-&gt;GetOutput() );
<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matcher-&gt;SetNumberOfHistogramLevels( 1024 );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matcher-&gt;SetNumberOfMatchPoints( 500 );<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; matcher-&gt;ThresholdAtMeanIntensityOn();*<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; are they correct for the dimension? There is a method to compute
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; them?<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; 4) the CenteredAffineTranform need 15 parameters to be set instead<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; of 12<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; of the AffineTranform (that i&#39;ve been using before) the other 15<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; parameters are the center of rotation?
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; so that the first 9 are the matrix<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; [M11......M33,CenterX,CenterY,CenterZ,<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; TranslationX,TranslationY,TranslationZ] is it correct?<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; best reguards ,<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; gabriele
<br>&gt;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; _______________________________________________<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; Insight-users mailing list<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:Insight-users@itk.org">Insight-users@itk.org</a> &lt;mailto:<a href="mailto:Insight-users@itk.org">
Insight-users@itk.org</a>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Karthik Krishnan
<br>&gt; R&amp;D Engineer,<br>&gt; Kitware Inc.<br>&gt; Ph: 518 371 3971 x119<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 518 698 3045 (cell)<br>&gt; Fax: 518 371 3971<br><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>
R&amp;D Engineer,<br>Kitware Inc.<br><br>