[Insight-users] computing MattesMutualInformation on full images

Luis Ibanez luis.ibanez at kitware.com
Wed May 16 15:40:09 EDT 2007


Hi Lilla,

Did you initialize the center of rotation of the
Rigid2DTransform ?

I didn't see in your code snippet where are you
connecting the Transform to the Metric.

Did you miss that part ?


The MattesMutualInformation has special code
for the case when the transfrom is a BSpline
deformable transform. If you don't set your
Transfrom, then the metric will use transform
that was defined by default in the constructor
in line 54 of

   Insight/Code/Algorithms/
      itkMattesMutualInformationImageToImageMetric.txx


I would think that you are missing to call:


    eval_metric->SetTransform( myRigid2DTransform );

before you call eval_metric->Initialize()



Regards,


     Luis


------------------
Lilla Zollei wrote:
> Hi,
> 
> I am trying to add a code segment to a 2D pairwise
> registration code that would compute MI on the full
> images. I am using CenteredRigid2DTransform and
> MattesMutualInformationImageToImageMetric and I
> believe I am not initializing the metric correctly as
> I always get an error at the GetValue statement. Now
> that I set the FixedImageRegion, I get a bizarre error
> that complains about a BSplines problem when I am not
> even using such a warp....Can you help?
> 
> BTW, the image region is:
> 
> ImageRegion (0x7498d8)
>   Dimension: 2
>   Index: [0, 0]
>   Size: [1313, 1313]
> 
> and the transformation parameters are:
> [-0.000147353, 0, 0, 0.00934701, 0.0151205]
> 
> So these both seem to be reasonable.
> 
> Thanks, Lilla
> 
> 
> 
> EvaluationMetricType::Pointer eval_metric =
> EvaluationMetricType::New();
> 
> eval_metric->UseAllPixelsOn();
> eval_metric->SetNumberOfHistogramBins( 64 );
> eval_metric->SetFixedImage( m_fixed );
> eval_metric->SetMovingImage(m_moving);
> eval_metric->SetFixedImageRegion(m_fixed->GetBufferedRegion());
> eval_metric->Initialize();
> 
> double value = eval_metric->GetValue(
> transform->GetParameters() );
> 
> 
> 
> Exception caught :
> itk::ExceptionObject (0x74c9d0)
> Location: "void
> itk::BSplineDeformableTransform<TScalarType,
> NDimensions, VSplineOrder>::SetParameters(const
> typename itk::Transform<TScalarType, NDimensions,
> NDimensions>::ParametersType&) [with TScalarType =
> double, unsigned int NDimensions = 2u, unsigned int
> VSplineOrder = 3u]"
> File:
> /usr/pubsw/packages/itk/3.0.0/InsightToolkit-3.0.0/Code/Common/itkBSplineDeformableTransform.txx
> Line: 266
> Description: itk::ERROR:
> BSplineDeformableTransform(0x7471f0): Mismatched
> between parameters size 5 and region size 0
> 
> 
>        
> ____________________________________________________________________________________Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
> http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list