[Insight-developers] Removing PhysicalPoitnToIndex() from itkImage ?

Damion Shelton dmshelto@andrew.cmu.edu
Thu, 21 Feb 2002 17:24:57 -0500


Hi...

> This limits the use to the geometries that can be represented by Affine
> transforms.

This is no longer true... right? (quoting from a previous email)

---
4) itk::Image no longer has an AffineTransform but rather
   a SmartPointer to a generic itk::Transform. That allows to plug
   any kind of transform into an image. By default an Affine
   transform is plugged in but it can be replaced by any other
   transform after the image has been constructed.
---

> I could be better to support this by a helper class external to the
> image.  This class would:

<snip>

> Does anybody see a disadvantage in outsourcing
> these conversions from the itkImage    ?

Yes. Transforming from indices to points is a very common operation. 
Outsourcing the conversion would require several extra operations each time 
the conversion occurs. For a given function that requires coordinate 
conversion:

ConverterType::Pointer converter = itkOutsourceCoordinateConverter::New();
converter->SetTransform(myImage->GetTransform() );
converter.Map(index,point);

Rather than the current implementation:

ImagePointer->TransformPhysicalPointToIndex(point, index)

Given that we now (apparently) can plug in pointers to arbitrary 
transforms, what's the advantage of adding an extra 2 lines of code every 
time you want to transform coordinates?

-Damion-