<br>Hi David,<br><br> Yes, the reading framework requires that you <br> establish the size of the image buffer first.<br> <br> Don't you define this size in the ASCII Header ?<br><br> It will be enough to have three integers (if your <br>
image is 3D) in the header, for indicating how many<br> pixels the image has along each dimension.<br><br><br> Regards,<br><br><br> Luis<br><br><div class="gmail_quote"><br>-------------------------------------------------------<br>
On Mon, Aug 10, 2009 at 3:16 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bitk@gmail.com">daviddoria+itk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am trying to make a new class: itkPTXImageIO (derived from itkImageIOBase). A ptx file is very simple, basically something like this<br><br>ASCII Header<br>x y z i r g b<br>x y z i r g b<br>x y z i r g b<br>x y z i r g b<br>
ad. nausium...<br><br>My current reader uses getline() to get the lines and then parses them. What I want to do is have a class:<br><br>namespace itk<br>{<br> <br> class PTXPoint<br> {<br> public:<br> typedef itk::Point<double, 3> PointType;<br>
typedef itk::RGBPixel<unsigned char> ColorType;<br> <br> PointType Point;<br> ColorType Color;<br> double Intensity;<br> <br> };<br>} //end itk namespace<br>
<br><br>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).<br>
<br>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?<br>
<br>Any suggestions?<br><br clear="all">Thanks,<br><font color="#888888"><br>David<br>
</font><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>