[vtkusers] MetaimageWriter Input Format

Marc Ramos m4rklar at gmail.com
Tue Nov 13 09:49:30 EST 2012


Hi!

I am trying to save a metaimage file (both raw + mhd) of a volume. The steps
of my code are the following:

metaimagereader
marchingcubes (transforms to polydata)
hull (filter)
After that, the data should still be polydata:

         std::string filePath = "../convex.mhd";
         std::string filePathRaw = "../convex.raw";

         //Write mhd Image
         vtkSmartPointer<vtkMetaImageWriter> writer =
vtkSmartPointer<vtkMetaImageWriter>::New();
         writer->SetInputConnection(hullFilter->GetOutputPort());
         writer->SetFileName(filePath.c_str());
         writer->SetRAWFileName(filePathRaw.c_str());
         writer->Write();

I think that the problem is that it has to be vtkImage to save the image,
but I could not find anything to solve the problem yet, I tried several
vtkImageCast transformations directly to the polydata image but does not
work.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121113/77c57d96/attachment.htm>


More information about the vtkusers mailing list