[Insight-users] MattesMI and CenteredAffineTransformation

Karthik Krishnan karthik.krishnan at kitware.com
Thu Dec 13 11:23:17 EST 2007


On 12/13/07, gabri <tartuz at gmail.com> wrote:
>
> Hi all,
> I would like to ask some questions.
> I'm trying to register two MR images but an error occurs when
> registration process start.
>
> *Parameters :
> OptimizerParameters : [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.000937524,
> 0.000937524, 0.000937524


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.

MattesMutualInformationImageToImageMetric(0x8634cd0): Too many samples
> map outside moving image buffer: 0 / 50*0
>
> 1) reading the informations about the tranform , the description tells :
>           "This class implements an Affine transform in which the
> rotation center can be explicitly selected. Note that the method
> "ComputeOffset()" must be called just before using the transform for
> mapping points, vectors or covariantvectors. This is necessary for
> updating the offset of the transform taking into account the center of
> rotation"


That'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.

We've removed the misleading documentation. Thanks for the report.

/cvsroot/Insight/Insight/Code/Common/itkCenteredAffineTransform.h,v
new revision: 1.14; previous revision: 1.13

but the "ComputeOffset()" method is a private method so i couldn't use
> it to compute the right offset.
>
> 2) there is a rule to set the NumberOfHistogramBins and the
> SpatialSamples?
> *
>     mutualmetric->SetNumberOfHistogramBins(20);
>     mutualmetric->SetNumberOfSpatialSamples(500);
>     registration->SetMetric( mutualmetric );
> *my images dimensions are : fixed  [91 109 91] -  moving [125 , 512 , 512]


The Number of spatial samples really depends on the dimension of your image.
5% of the samples is probably reasonable.

3) Beacuse of the images are obviously differente i'm using the
> HistgramMatchingFilter with this parameters


MI followed by Histrogram matching is a tad counter-intuitive. Histogram
matching methods such as histogram equalization that you'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

*      matcher->SetInput( movingImageReader->GetOutput() );
>       matcher->SetReferenceImage( fixedImageReader->GetOutput() );
>
>       matcher->SetNumberOfHistogramLevels( 1024 );
>       matcher->SetNumberOfMatchPoints( 500 );
>       matcher->ThresholdAtMeanIntensityOn();*
> are they correct for the dimension? There is a method to compute them?
>
> 4) the CenteredAffineTranform need 15 parameters to be set instead of 12
> of the AffineTranform (that i've been using before) the other 15
> parameters are the center of rotation?
> so that the first 9 are the matrix
> [M11......M33,CenterX,CenterY,CenterZ,
> TranslationX,TranslationY,TranslationZ] is it correct?
>
> best reguards ,
>
> gabriele
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>


-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 371 3971 x119
      518 698 3045 (cell)
Fax: 518 371 3971
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071213/0a5fbf5b/attachment.html


More information about the Insight-users mailing list