[vtkusers] creating a vtkvolume from in-memory image data

David E DeMarle dave.demarle at kitware.com
Wed Aug 22 09:44:17 EDT 2012


If for some reason you didn't use vtkTiffReader then:
1) Make an empty vtkImageData with the appropriate extent, origin and spacing.
2) Get access to it's scalar array.
3) Use vtkUnsignedCharArray::SetArray(unsigned char *,...) to assign
the buffer you've already read to the vtkImageData.
4) Attach the vtkImageData to the vtkVolume to render it as usual.

If you did then steps 1-3 are already done for you.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Wed, Aug 22, 2012 at 9:19 AM, Doug Hoppes <dhoppes at mbfbioscience.com> wrote:
> Hi all,
>
>
>
>                 Okay, hoping that this is a pretty simple question, but
> can’t seem to find any resources about it.  I have read in a tiff file and I
> need to create a vtkvolume from it.  The issue is that the tiff file is,
> once read, no longer available (so, I can’t read the data file).
>
>
>
>                 I do have access to the in-memory data for the tiff.  Is
> there a way to send this information directly to the vtkvolume?
>
>
>
> Doug
>
>
>
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list