[Insight-users] PTX reader class
David Doria
daviddoria+itk at gmail.com
Mon Aug 10 15:16:06 EDT 2009
I am trying to make a new class: itkPTXImageIO (derived from
itkImageIOBase). A ptx file is very simple, basically something like this
ASCII Header
x y z i r g b
x y z i r g b
x y z i r g b
x y z i r g b
ad. nausium...
My current reader uses getline() to get the lines and then parses them. What
I want to do is have a class:
namespace itk
{
class PTXPoint
{
public:
typedef itk::Point<double, 3> PointType;
typedef itk::RGBPixel<unsigned char> ColorType;
PointType Point;
ColorType Color;
double Intensity;
};
} //end itk namespace
and store an instance of that class in every pixel of an
itkImage<itkPTXPoint, 2>. What I've gathered about the current framework is
that the itkImageFileReader has a member variable of an ImageIOBase. It then
calls the Read() function of which ever derived class you specify, which
fills a void* buffer. Everything seems to need to know the number of bytes
required so a big buffer of the correct size can be declared (which I guess
is very fitting for binary reading).
It seems like the way I want to read and fill (image(0,0) = FirstLine;
Image(0,1) = SecondLine; etc) the image may not fit into the framework? I
guess the part that is missing is how to access the pixels of the
ImageIOBase in itkImageFileReader from the Read() function of itkPTXImageIO?
Any suggestions?
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090810/5e229603/attachment.htm>
More information about the Insight-users
mailing list