[vtkusers] Fixing vtkTIFFWriter.cxx

matheus_viana vianamp at gmail.com
Wed Jun 4 13:48:40 EDT 2014


Hi guys. It has been discussed a few times in this list - with no solution
yet - that vtkTIFFWriter isn't able of writing a multi-paged tif file. When
a 3D stack is used as input, vtkTIFFWriter writes a montage instead. I'm
willing to fix it, but I'm not sure how. Here is what I tried so far:

I was checking the file vtkTIFFWriter.cxx and I found the following relevant
lines in the method vtkTIFFWriter::WriteFileHeader:

  TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, w);
  TIFFSetField(tif, TIFFTAG_IMAGELENGTH, h);

So, I decided to include the following line:

TIFFSetField(tif, TIFFTAG_IMAGEDEPTH, d);

where d is defined as 

  uint32 d = depth; //viana

and

  depth = (max2 - min2 + 1); //viana

  int min0 = wExt[0],
    max0 = wExt[1],
    min1 = wExt[2],
    max1 = wExt[3],
    min2 = wExt[4], //viana (to write multi-paged TIFF files)
    max2 = wExt[5]; //viana

So I compiled VTK again but the output after all is exactly the same.

Does anyone have any suggestion?



--
View this message in context: http://vtk.1045678.n5.nabble.com/Fixing-vtkTIFFWriter-cxx-tp5727328.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list