trouble adding new image reader/lousy documentation

Charles Law charles.law at kitware.com
Thu May 11 15:07:56 EDT 2000


Larry,

I sympathize with you.  The simple vtkImageReader is made very complex by 
its ability to stream data.  If your "short ints" are binary in xyz order, 
then it is almost trivial to read your data.  vtkImageReader will do it if 
you tell it the size of the data explicitly (it computes the size of the 
header and skips it.  All you subclass of vtkImageReader would have to do 
is read the header, fill in the DataExtent and DataType and let the supper 
class do the rest.


Any more complex file format will take a little more work.  I this case I 
would suggest that you read your data into a block of memory, and use 
vtkImageImport to feed the pipeline.

Charles.



At 10:13 AM 5/11/00 -0400, Lawrence M. Lifshitz wrote:
>hi. I am a newbie to vtk, attempting to add a trivial image
>reader to it.  I've got an ascii header of fixed size and
>format to parse, yielding image dimensions, etc, followed
>by short ints of 3d data.  I am using the doxygen documentation
>(which is very nice as far as it goes) and the VTK Toolkit
>2nd edition as my references. I have vtk 3.1, under windows.
>
>My big problem is it is not clear at all to me
>WHICH METHODS I MUST OVERRIDE AND WHICH I DON'T HAVE TO.
>In addition, it
>is still hard to find descriptions of many methods.  It is not
>clear what my reader must produce in the end (what class variables
>must it set, etc)?
>
>
>I assumed that I should take one of the readers (eg, BMP) and
>use it as a starting point for modification.  Let's see. How does
>it read the file? I notice vtkBMPreader calls OpenAndSeekFile.
>Using doxygen
>I quickly go to vtkImageReader, since it is the first class which
>has this routine. But there is absolutely no description of what
>it does.  Am I missing something?  am I supposed to dive into
>the code to figure this out?  Same comment goes for many of the
>other routines.
>
>I am new to vtk and fairly new to C++, but I've spent over two weeks on
>it and still have zip to show for it, and a very confused mental image
>of how most things fit together (I've read the whole book).  I must say,
>inside of a day I was using OpenInventor and had a very clear concept
>of how to fit parts together. Does the user's guide make any of this
>clearer?
>
>It looks like it should be a great tool, but I'm very frustrated
>(in case you can't tell :)).
>
>         Larry
>
>
>
>--
>Lawrence M. Lifshitz, Ph.D.
>Biomedical Imaging Group - University of Massachusetts Medical School
>Phone: (508) 856-3392      email:    Lawrence.Lifshitz at umassmed.edu
>FAX: (508) 856-1840        web:      http://invitro.umassmed.edu/~lml
>--------------------------------------------------------------------
>This is the private VTK discussion list. Please keep messages on-topic.
>Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at public.kitware.com>. For help, send message body containing
>"info vtkusers" to the same address.
>--------------------------------------------------------------------

--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list