[Insight-users] Re: Multiple 2D image registration with unique Transforms

Luis Ibanez luis.ibanez at kitware.com
Thu Aug 19 20:39:49 EDT 2004


HI Neilson,

I'm sorry, I'm reading my mailbox in reverse order
and found this email after I replied to your last one.

Here are some comments,


1) Create a class:

      template< TImage, TTransform>
      clas ImagePlusTransform
       {
       public:
        TImage::Pointer  m_Image;
        TTransform::Pointer m_Transform;
       };


     then instantiate this type

     typedef ImagePlusTransform<
                   ImageType, TransformType >
                               ImageTransformType;

     and create a std::vector of them

    typedef   std::vector< ImageTransformType >  ImageTransformVector;



2)   Yes, you will have to create a modified superclass
      to replace ImageToImageMetric with something like
      ImageArrayToImageMetric. The array of 2D images will
      act as the Fixed image and the 3D CT image will act
      as the Moving image.

      About your changes, you seem to be in the right track

      2.1) compute the min and max from the set of images
           that act as Fixed image.

      2.2) in 146 visit all the 2D images in the array
           (as you already pointed out). Your extra loop
           should do the trick.

      2.3) In the method "SampleFixedImageDomain() you pretty
           much surround the entire method in a for loop that
           iterates over your 2D images. As you pointed out,
           You will also use a different transform in every case.

      Note that your N transforms are actually the composition
      of the N transforms of the slice with respect to the first
      slice, and the Transform that the metric is acepting as
      parameter during the optimization.  Given that you know
      the relative position of the ultrasound slices, this should
      be easy to compute.


It seems that you already found the main points.


Please let us know if you find any problems.




Regards,


    Luis


------------------------------
N.E. Mackenzie Mackay wrote:

> Hey Luis,
> 
>     I am starting to do the chages to a metric that we discussed here:   
> http://public.kitware.com/pipermail/insight-users/2004-April/ 007754.html
> 
>     To refresh your memory I am currently trying to register multiple 
> 2D  Ultrasound images with locations defined by individual transforms to 
> a  3D CT volume.  I was wondering if I could get your help starting off.
> 
>     I am going to make changes to the Mattes mutual information metric.  
> I  have a few questions ( some easy and some hard ):
> 
>         Easy to answer:
>         1. How would I store multiple images and transforms in a single  
> variable.  For example make an array of Image objects.
> 
>             I am assuming I couldn't do something like this:
> 
>                 typedef itk::Image<float, 2> ImageType;
>                 ImageType::Pointer image[40];            //makes an 
> array of 40 image objects
>            
>                 for(int i = 0; i < 40; i++)
>                     image[i] = ImageType::New();
> 
>         Harder to answer:
>         2. What parts of Mattes should I change.  As of now I have 
> looked at:
> 
>             All the changes are applied to 
> itkMattesMutualInformationMetric in  ITK version 1.6.0
> 
>             A.    Original:    Lines 146 - 161 - Initializing the fixed 
> min and max  for the fixed image.
>                 My Change:    Add a for loop around the lines for each 
> image such that  the max will be computed based on every image
>             B.    Original:    Lines 387 - 400 in SampleFixedImageMethod
>                         - Randomly picks sample points from the fixed 
> image to use during  metric calculation
>                        
>                 My Change:    -Add a for loop around method to do the 
> same but over  all images.
>                             -Also change
>                                 
> "m_FixedImage->TranformFromPhysicalPoint(index,  
> (*iter).FixedImagePointValue);."
>                             to
>                                 
> m_FixedImage[i]->TranformFromPhysicalPoint(index,  
> (*iter).FixedImagePointValue);
>                                 
> transform[i]->TransformPoint((*iter).FixedImagePointValue)
> 
>                                 where I is the image defined by the loop 
> I am adding
>                            
> 
>         Those are the only two changes I can see that would be 
> necessary.  If  you think that there is more I would love to hear it.
> 
.....


> 
> I am going to try these changes out and tell you how it goes.
> 
> Neilson
>            
> 
> 






More information about the Insight-users mailing list