Deriving from a vtk image class

Charles Law charles.law at kitware.com
Mon Aug 9 12:32:33 EDT 1999


<x-flowed>Brian,

In VTK 3.0 vtkImageCache has been eliminated.  vtkImageData
will be used instead.

For your purpose, I would subclass from vtkStructuredPoints
( which will be a subclass of vtkImageData in VTK3.0).
This will work for previous releases also because they can
automatically convert from vtkImageData to vtkStructuredPoints
and back.

In VTK3.0,  you can set any sources output to NULL,
(i.e. reader->SetOutput(NULL)), and continue to use the orphaned
output as a source of data in a pipeline.  This will work for graphics
or imaging.

I believe some thing similar will work for imaging in VTK 2.*.
You may be able to orphan the vtkImageCache.


At 11:19 AM 8/9/99 -0400, Brian Alexander Todd wrote:
>Dear vtk gurus,
>
>I'm dealing with elevation maps which are beautifully
>displayed with vtk.  I have been using a separate (non-vtk)
>data structure to store and manipulate the data and then
>using vtk to display it.  The problem with this is that
>I have to write back to disk and then invoke vtkImageReader,
>and on down the pipeline to view updates (in tcl I can't
>manipualate the pointers).
>
>I would like to use a class derived from a vtk image class
>instead and eliminate the disk writes.  I need a new class
>because I have lots of old code that relies on access operators
>like:
>
>image[j][i] = ...;
>
>It shouldn't be hard to define this operator in a new class
>but what class should I derive from?  My data are a 2D images.
>
>The textbook (pg 450) said that vtkImageCache was typically
>what was used rather than vtkImageData.  However, the text
>book shows vtkImageCache being instantiated and in vtk 2.2
>vtkImageCache is a pure abstract class.  Should I use one of
>the concretes like vtkImage(Simple,Static)Cache?
>
>Also, once I've read the data into the memory associated with this
>class, I would like to Delete vtkImageReader.  Will there be
>problems if the pipeline doensn't begin with a vtkSource?
>
>Thanks,
>Brian Todd
>            _____________________________________________________
>   ________|                                                     |________
>   \       |   Brian Todd                email: bat5 at po.cwru.edu |       /
>    \      |   N.O.B.L.                 office: (216) 791-2407   |      /
>     \     |   C.W.R.U.                   home: (216) 368-4209   |     /
>     /     |   Cleveland, OH 44106         fax: (216) 368-4969   |     \
>    /      |_____________________________________________________|      \
>   /___________)                                              (__________\
>
>
>-----------------------------------------------------------------------------
>This is the private VTK discussion list.  Please keep messages on-topic.
>Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
>To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
><majordomo at gsao.med.ge.com>.  For help, send message body containing
>"info vtkusers" to the same address.     Live long and prosper.
>-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------


</x-flowed>



More information about the vtkusers mailing list