[Insight-developers] Where to put PhysicalToIndex method?
Luis Ibanez
ibanez@cs.unc.edu
Thu, 18 Jan 2001 14:56:37 -0500
I would suggest to make it a class in its own in order
to avoid dependencies between AffineTransform and Image.
It could have a structure similar to the ImageFunction class,
or like a ProcessObject. Maybe something like:
template< class ImageType >
class PhysicalToIndexTranform : public ProcessObject {
public:
typedef AffineTransform< ImageType::ImageDimension > TransformType;
SetImage( const ImageType * );
TransformType::Pointer GetAffineTransform( void ) const;
void GenerateData( void ) {
// here compute the affine transform using data from m_Image
}
private:
ImageType::Pointer m_Image;
TransformType::Pointer m_Transform;
}
The only problem with this is that ProcessObject is
predisposed to process regions, and in this case the
output is not an object in which the concept of region
make sense.
Luis,
----------------------
Paul Hughett wrote:
> I want to provide a method which will return the AffineTransforms
> implied by the origin and spacing fields of an image; that is, the
> AffineTransforms that will transform from physical coordinates (using
> origin and spacing) to index coordinates (raw lookup indices), and the
> reverse. Each of these methods could plausibly be provided either as
> a static member function of the AffineTransform class, taking an image
> as the argument, or as a method of the Image class, taking no
> arguments. One advantage of doing it as an Image method is that it can
> inherit the image dimensions. Which do people feel is more reasonable?
>
> static AffineTransform::PhysicalToIndexTransform(const Image *);
>
> AffineTransform Image::PhysicalToIndexTransform(void);
>
> Paul Hughett
>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
--
______________________________________________________________________
Luis Ibanez
Research Assistant Professor - Division of Neurosurgery
University of North Carolina at Chapel Hill
CB# 7060, Chapel Hill, NC 27599
email : ibanez@cs.unc.edu home : http://www.cs.unc.edu/~ibanez
phone : (919)-843-9961 fax : (919)-966-6627
______________________________________________________________________