On 12/13/07, <b class="gmail_sendername">gabri</b> <<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a>> 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've done what you suggested about the initialization in this way :<br><br>TransfomParameters: [1, 0, 0, 0, 1, 0, 0, 0, 1, 89.9859, 110.013,<br>78.0862, 4.02741, -0.754015, -9.40034
]<br>OptimizerScales : [1, 0, 0, 0, 1, 0, 0, 0, 1, 10000, 10000,<br>10000, 0.000937524, 0.000937524, 0.000937524]</blockquote><div> </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 -0.741588 [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'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'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'll cancel it.<br><br>**That'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>> On 12/13/07, *gabri* <<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a> <mailto:<a href="mailto:tartuz@gmail.com">tartuz@gmail.com</a>>> wrote:
<br>><br>> Hi all,<br>> I would like to ask some questions.<br>> I'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,<br>> 0.000937524,<br>> 0.000937524, 0.000937524<br>><br>><br>> At the risk of me sounding silly, it looks like you initialize your
<br>> transform with all ones. That does not make an Identity matrix. That<br>> could explain why all the samples from the fixed image map outside the<br>> moving image.<br>><br>> 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<br>> tells :<br>> "This class implements an Affine transform in which the
<br>> rotation center can be explicitly selected. Note that the method<br>> "ComputeOffset()" 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<br>> center of<br>> rotation"<br>><br>><br>> That'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>> We'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>> but the "ComputeOffset()" method is a private method so i couldn't use
<br>> it to compute the right offset.<br>><br>> 2) there is a rule to set the NumberOfHistogramBins and the<br>> SpatialSamples?<br>> *<br>> mutualmetric->SetNumberOfHistogramBins(20);
<br>> mutualmetric->SetNumberOfSpatialSamples(500);<br>> registration->SetMetric( mutualmetric );<br>> *my images dimensions are : fixed [91 109 91] - moving [125 ,<br>> 512 , 512]
<br>><br>><br>> The Number of spatial samples really depends on the dimension of your<br>> image. 5% of the samples is probably reasonable.<br>><br>> 3) Beacuse of the images are obviously differente i'm using the
<br>> HistgramMatchingFilter with this parameters<br>><br>><br>> MI followed by Histrogram matching is a tad counter-intuitive.<br>> Histogram matching methods such as histogram equalization that you're
<br>> using below is generally used when you intend using intensity<br>> sensitive metrics such as MeanSquares etc. Mutual information itself<br>> maximzes the mutual information, which is a function of the joint
<br>> intensity distribution, so its inherently intended to be<br>> contrast/intensity insensitive<br>><br>> * matcher->SetInput( movingImageReader->GetOutput() );<br>> matcher->SetReferenceImage( fixedImageReader->GetOutput() );
<br>><br>> matcher->SetNumberOfHistogramLevels( 1024 );<br>> matcher->SetNumberOfMatchPoints( 500 );<br>> matcher->ThresholdAtMeanIntensityOn();*<br>> are they correct for the dimension? There is a method to compute
<br>> them?<br>><br>> 4) the CenteredAffineTranform need 15 parameters to be set instead<br>> of 12<br>> of the AffineTranform (that i'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> <mailto:<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>><br>><br>><br>> --<br>> Karthik Krishnan
<br>> R&D Engineer,<br>> Kitware Inc.<br>> Ph: 518 371 3971 x119<br>> 518 698 3045 (cell)<br>> Fax: 518 371 3971<br><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Karthik Krishnan<br>
R&D Engineer,<br>Kitware Inc.<br><br>