[vtkusers] about vtkMetaImageWriter

diaoxianfen diaoxianfen at asisz.com
Thu Dec 16 04:38:34 EST 2004


Hello every one,
I used the vtkMetaImageWriter class several times.I found that the image header file was wrong.But when I added the Update() function before this pipeline the writed file was right.You may not understand what I want to say. Please refer to the following program.

vtkMetaImageReader *reader = vtkMetaImageReader::New();
 reader->SetFileName(inputFilename);
  
 vtkImageGaussianSmooth *smooth = vtkImageGaussianSmooth::New();
 smooth->SetDimensionality(3);
 smooth->SetStandardDeviations(0.4,0.4,0.4);
 smooth->SetInput(reader->GetOutput());
 
 vtkImageGradientMagnitude *magnitude = vtkImageGradientMagnitude::New();
 magnitude->SetDimensionality(3);
 magnitude->SetInput(smooth->GetOutput());
 magnitude->Update();//this function is necessary to get the right file header information
 
 vtkMetaImageWriter *writer = vtkMetaImageWriter::New();
 writer->SetFileDimensionality(3);
 writer->SetInput(magnitude->GetOutput());
 writer->SetFileName(outputFilename);
 writer->Write();  


I doubt there is some bug in the class vtkMetaImageWriter.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041216/47c611ae/attachment.htm>


More information about the vtkusers mailing list