[Insight-users] registration with perspective transformation

vachis at email.cz vachis at email.cz
Fri Feb 8 08:07:22 EST 2008


 Hello ITK fans,
 
 Does anybody have any experience with a registration under the perspective
 transformation?
 I can't find any example of it.
 
 My task is following:
 I have two gray images, the second one is acquired under perspective
 transformation
 and I need to register them. The both input images are 2 dimensional.
 
 I have tried to use the Rigid3DPerspectiveTransform, but I am unable to get it
 compiled,
 probably I am wrong with the dimensions. 
 I do not know if ImageToImageMetric should be 
 2D,2D or 2D,3D or 3D,3D, none of the combinations is working for me.
 
 Thanks for any suggestions.
 Best regards
 
 Pavel Vacha
 
 
 My code snippet:
 
  typedef  unsigned short  PixelType;
   
   typedef itk::Image< PixelType, /*Dimension*/ 2 >  FixedImageType;
   typedef itk::Image< PixelType, /*Dimension*/ 3 >  MovingImageType;   
 
   typedef itk::Rigid3DPerspectiveTransform< double > TransformType;
   typedef itk::VersorRigid3DTransformOptimizer       OptimizerType;        
   
   typedef itk::LinearInterpolateImageFunction< 
                                     MovingImageType,
                                     double             > InterpolatorType;
   typedef itk::ImageRegistrationMethod< 
                                     FixedImageType, 
                                     MovingImageType    > RegistrationType;
 
                                     
   typedef itk::MeanSquaresImageToImageMetric< 
                                     FixedImageType, 
                                     MovingImageType >    MetricType;
 
   TransformType::Pointer      transform     = TransformType::New();
   OptimizerType::Pointer      optimizer     = OptimizerType::New();
   InterpolatorType::Pointer   interpolator  = InterpolatorType::New();
   RegistrationType::Pointer   registration  = RegistrationType::New();
 
   registration->SetOptimizer(     optimizer     );
   registration->SetTransform(     transform     );
   registration->SetInterpolator(  interpolator  );
 
   MetricType::Pointer metric = MetricType::New();
   registration->SetMetric( metric  );
 
 
-------------- next part --------------
# This project is designed to be built outside the Insight source tree.
PROJECT(ProjectiveRegistration)

# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(ProjectiveRegistration ProjectiveRegistration.cxx )

TARGET_LINK_LIBRARIES(ProjectiveRegistration ITKIO ITKNumerics)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?us-ascii?Q?ProjectiveRegistration=2Ecxx?=
Type: text/x-c++src
Size: 7471 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20080208/6b1f4c78/us-asciiQProjectiveRegistration2Ecxx.cc


More information about the Insight-users mailing list