[Insight-users] Help needed for 2D multi-modality Registration.

Reeju Pokharel reeju_p at yahoo.com
Tue Mar 24 14:16:56 EDT 2009


Hello everybody, 

I was wondering if anyone could help me with a 2D
multi-modality registration. I have four images obtained from SEM and I
need to register the three moving images with one fixed image. I have
three transform parameters. The images are taken from different angles,
therefore they behave as if they were taken from different imaging
modalities. Since I'm new to itk, I was trying to learn the basics of
registration by running the example on image registration that uses
mutual information metric and gradientdescent optimizer. However, the
example uses tranlation transform and since I have shearing in my image
I need to use affine transform. Therefore, I changed the code and tried
to use affine transform instead of translation transform. Now the code
doesnt work and I do not know what I'm doing wrong here. Could you
please give me some comments on this. Here is the code: 


#include "itkImageRegistrationMethod.h"
#include "itkTranslationTransform.h"
#include " itkMutualInformationImageToIma geMetric.h"
#include " itkLinearInterpolateImageFunct ion.h"

#include "itkGradientDescentOptimizer. h"
#include "itkImage.h"
#include "itkNormalizeImageFilter.h"
#include " itkDiscreteGaussianImageFilter .h"
#include "itkImageFileReader.h"

#include "itkImageFileWriter.h"
#include "itkResampleImageFilter.h"
#include "itkCastImageFilter.h"
#include "itkCheckerBoardImageFilter.h"
#include "itkTIFFImageIO.h"

#include " itkCenteredTransformInitialize r.h"
#include "itkAffineTransform.h"


#include "itkCommand.h"
class CommandIterationUpdate : public itk::Command 
{
public:
  typedef  CommandIterationUpdate   Self;

  typedef  itk::Command             Superclass;
  typedef  itk::SmartPointer<Self>  Pointer;
  itkNewMacro( Self );
protected:
  CommandIterationUpdate() {};
public:
  typedef   itk::GradientDescentOptimizer      OptimizerType;

  typedef   const OptimizerType   *           OptimizerPointer;

  void Execute(itk::Object *caller, const itk::EventObject & event)
    {
      Execute( (const itk::Object *)caller, event);
    }


  void Execute(const itk::Object * object, const itk::EventObject & event)
    {
      OptimizerPointer optimizer = 
        dynamic_cast< OptimizerPointer >( object );
      if( ! itk::IterationEvent(). CheckEvent( &event ) )

        {
        return;
        }
      std::cout << optimizer-> GetCurrentIteration() << "   ";
      std::cout << optimizer->GetValue() << "   ";
      std::cout << optimizer->GetCurrentPosition( ) << std::endl;


       // Print the angle for the trace plot
      vnl_matrix<double> p(2, 2);
      p[0][0] = (double) optimizer->GetCurrentPosition( )[0];
      p[0][1] = (double) optimizer->GetCurrentPosition( )[1];

  &nbsp


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090324/bcd7396b/attachment.htm>


More information about the Insight-users mailing list