[vtkusers] Convert a series of DICOM files into a VTI File

HinhCT hinh1108 at gmail.com
Tue Oct 16 22:17:22 EDT 2018


Hi,

I need to write a vti file that can be opened in volView or paraveiw. 
I use the below code to convert a series of DICOM files into a vti file. But
the output file size is too big,I want to reduce the size of it.

// Read all the DICOM files in the specified directory.
vtkSmartPointer<vtkDICOMImageReader> reader =
		vtkSmartPointer<vtkDICOMImageReader>::New();
reader->SetDirectoryName(inputFoldername.c_str());
reader->Update();

//write vti
vtkSmartPointer<vtkXMLImageDataWriter> writer =
vtkSmartPointer<vtkXMLImageDataWriter>::New();
writer->SetFileName("head.vti");
writer-> SetInputData(reader->GetOutput());
writer->Write();



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list