[vtkusers] How to save the stenciled images?

Cory Quammen cquammen at cs.unc.edu
Mon May 19 07:02:16 EDT 2008


Mark,

The closest you can probably come is to jam all the stencil images
together into one image with vtkImageAppendComponents and then save
the whole thing into a single .vti file. I don't believe you can save
more than one image in a single .vti file (someone on list correct me
if I am wrong). You might be able to exploit VTK's relatively new time
support and treat your images as though they were time-series data,
but I am not familiar enough with that to give you advice (you might
find some hints for time-series data in the documentation for
vtkXMLWriter: http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html).

Hope that helps,
Cory

On Mon, May 19, 2008 at 6:01 AM, Mark Jefferson <mark.jefferson at qq.com> wrote:
> thank you for your help, Cory,
>   I have use class vtkXMLImageDataWriter and class vtkXMLImageDataReader.
> but I still could not save the stenciled images, maybe these classes could
> do it, but I could not do.
>   after I have use this class to writer a .vti file for all the stenciled
> images, I use class vtkImageViewer2 to see all the images that I have saved,
> unluckily, all the images are the same image, which is the image that I save
> at last. so I don't know what's wrong with it.
>   of course, vtkXMLImageDataWriter could save all or part of the images at a
> time, but what I want to do is like this :
>   for example, there is two images. and I save the first stenciled image
> using class vtkXMLImageDataWriter after I have extracted the ROI, and the
> .vti file's name is image.vti. and then I would save the second(or the last
> one) image into the image.vti. at last, using class vtkImageViewer2, you
> would find the two images are all the second image, and the first stenciled
> image was lost.
>   so, could you tell me, how to add the next stenciled image to the original
> .vti file(or the same .vti file)?
>   thank you for your help again!
>   M. J.
>



-- 
Cory Quammen
Department of Computer Science
University of North Carolina at Chapel Hill
http://www.cs.unc.edu/~cquammen



More information about the vtkusers mailing list