[vtkusers] How to write vtkImageData with vtkTIFFWriter?
David Doria
daviddoria+vtk at gmail.com
Sun Jan 10 17:52:11 EST 2010
On Sun, Jan 10, 2010 at 5:38 PM, David Gobbi <david.gobbi at gmail.com> wrote:
> On Sun, Jan 10, 2010 at 2:35 PM, <lynx.abraxas at freenet.de> wrote:
>> On 10/01/10 14:20:01, lynx.abraxas at freenet.de wrote:
>>> Hello again!
>>>
>>>
>>> Another problem arose in my little test program (see below): How do I save the
>>> output of GaussianSplatter into a (3D) TIFF? What could convert the output of
>>> GaussianSplatter to vtkImageData?
>>
>> How comes vtkTIFFWriter cannot write vtkImageData? Is there something missing in vtkImageData that an image writer needs to know as well?
>>
>> Thanks,
>> Lynx
>
> I believe TIFF baseline requires byte data (either greyscale or RGB),
> so you have to convert whatever data you have to UnsignedChar, e.g.
> with vtkImageMapToColors or with vtkImageShiftScale. DItto for PNG,
> PNM, BMP, and JPEG.
>
> David
You can also use vtkImageCast:
http://www.cmake.org/Wiki/VTK/Examples/IO/WriteTIFF
http://www.cmake.org/Wiki/VTK/Examples/Images/Cast
Thanks,
David
More information about the vtkusers
mailing list