[Insight-users] PTX reader class

Luis Ibanez luis.ibanez at kitware.com
Sat Aug 15 16:41:15 EDT 2009


Hi David,

   Yes, the reading framework requires that you
    establish the size of the image buffer first.

    Don't you define this size in the ASCII Header ?

    It will be enough to have three integers (if your
    image is 3D) in the header, for indicating how many
    pixels the image has along each dimension.


       Regards,


            Luis


-------------------------------------------------------
On Mon, Aug 10, 2009 at 3:16 PM, David Doria
<daviddoria+itk at gmail.com<daviddoria%2Bitk at gmail.com>
> wrote:

> 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
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090815/fc450334/attachment.htm>


More information about the Insight-users mailing list