[Insight-users] Accessing image from Observer

Patrik.Br. patrik.brynolfsson at gmail.com
Wed Jun 10 04:27:32 EDT 2009


Hello everyone,

I'm new to ITK and I need some advice. I would like to change the
transformation in a multiresolution registration using the observer. For the
last step I was thinking of using the CenteredRigid2DTransform instead of
the TranslationTransform. My problem is that I don't know how to access the
fixed and moving images in the observer in order to initialize the new
transform. Here's where I am right now (the observer):

void Execute(itk::Object * object, const itk::EventObject & event)
  {
  if( !(itk::IterationEvent().CheckEvent( &event )) )
      {
      return;
      }
  RegistrationPointer registration =dynamic_cast<RegistrationPointer>(
object );
  
  if ( registration->GetCurrentLevel() == 2 ) // The last level
    {
      // I followed the user's guide on how to set up the
CenteredRigid2DTransform

      const    unsigned int    Dimension = 2;
      typedef  unsigned short  PixelType;
  
      typedef itk::Image< PixelType, Dimension >  FixedImageType;
      typedef itk::Image< PixelType, Dimension >  MovingImageType;
  
      typedef   float     InternalPixelType;
      typedef itk::Image< InternalPixelType, Dimension > InternalImageType;
  
      typedef itk::CenteredRigid2DTransform< double > TransformType;
	  TransformType::Pointer      transform     = TransformType::New();
	  registration->SetTransform(     transform     );
      
Here's where the FixedImageReader and MovingImageReader are defined, but I
assume 
they are already stored in the registration handle somehow, but how do I get
them?
I tried:
  
        FixedImageType fixedImage = registration->GetFixedImage();

and different variants of the above with no success. Can anybody help me in
the right direction? Is this necessary at all, or am I completely off track?

Many thanks in advance,

//Patrik
-- 
View this message in context: http://n2.nabble.com/Accessing-image-from-Observer-tp3054308p3054308.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.



More information about the Insight-users mailing list