[vtkusers] Empty output when converting TIF to VTK

matheus_viana vianamp at gmail.com
Fri May 30 08:42:45 EDT 2014


Hi guys.

I'm trying to write a simple routine to convert a multi-paged tif file into
vtk file, but the output seems to depend on the size of the tif file. When I
try to convert a 2Gb tif file, the vtk file is empty. If I crop a small part
(200Mb) of this file, the output is fine. I'm running VTK 6.1 on Mac OS
10.9.3.

Any idea of what is going on? This is my code:

#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vtkImageData.h>
#include <vtkTIFFReader.h>
#include <vtkSmartPointer.h>
#include <vtkStructuredPoints.h>
#include <vtkStructuredPointsWriter.h>

int main () {

	vtkSmartPointer<vtkTIFFReader> TIFFReader =
vtkSmartPointer<vtkTIFFReader>::New();
	TIFFReader -> SetFileName("Cell0809.tif");
	TIFFReader -> Update();

	vtkImageData *Image = TIFFReader -> GetOutput();
	    
	vtkSmartPointer<vtkStructuredPointsWriter> Writer =
vtkSmartPointer<vtkStructuredPointsWriter>::New();
	Writer -> SetFileName("Cell0809.vtk");
	Writer -> SetFileType(VTK_BINARY);
	Writer -> SetInputData(Image);
	Writer -> Write();

}



--
View this message in context: http://vtk.1045678.n5.nabble.com/Empty-output-when-converting-TIF-to-VTK-tp5727275.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list