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

Luis Ibanez luis.ibanez@kitware.com
Thu, 21 Feb 2002 19:02:43 -0500


Damion Shelton wrote:

> It should be pretty easy to have the image constructor create a 
> default affine transform when the image is created, and then update 
> this transform when the origin and spacing are modified. This ensures 
> that there is always something there, even if it's now "correct".
>
> Then, if the image turns out to be something weird, like ultrasound, 
> the image reader (or other 3rd party) can replace the affine transform 
> with something else whenever it's appropriate.


That sounds good !

> I still think it would be more convenient to leave the actual function 
> calls within Image, if for no other reason than to reduce complexity. 
> As long as we can safely assume a transform exists, I don't think this 
> is a problem.
>
I think you're right on this.
Outsourcing the code will not make any difference  in performance
and will simply add more work for users.

There is also an additional advantage in the way you implented these 
methods:

        They are templated over the representation type !!

So you don't have to care about the matching between the TCoordRep used 
in the Transform<>
(which has still to be hardcoded in the image) and the TCoordRep of the 
points used to access
the image.

I'll try to check in the Transform changes tonight and once it settles 
down we can have a look
at removing the AffineTransform instantiation from these methods.



Is that ok ?


Luis