vtkImageWriter Question ?

Sathya ksathya at omirf.iusd.iupui.edu
Thu Sep 9 17:01:55 EDT 1999

Hello All

I am implemented the following piece of code....

X = 512;Y = 512;Z = 243 ;
s1 = 1.96;s2 = 1.96;s3 = 2.5;scale = 1;

vtkPNMReader *Reader = vtkPNMReader::New ();
Reader->SetFilePrefix ("c340007.ppm");
Reader->SetDataExtent (0,X,0,Y,0,Z);
 Reader->SetDataSpacing (s1*scale, s2*scale, s3*scale);
 Reader->SetDataScalarTypeToUnsignedChar ();
 Reader->Update ();

vtkImageClip *imclip = vtkImageClip::New ();
imclip->SetInput (Reader->GetOutput ());
imclip->SetOutputWholeExtent (0,X,Y/2,Y/2,0,Z);

vtkTIFFWriter *writer = vtkTIFFWriter::New ();
writer->SetFileName ("test.tiff");
writer->SetInput (imclip->GetOutput ());
writer->Write ();

On Implementing this..test.tiff contained a thin line which is the slice

When I tried imclip with a constant Z I got a correct image with dimension
512 x 512 x1..but here I am getting an image with dimension 512 x1; whereas
the dimensions are 512x1x243.

How do I get the image which is represented by 512x243. ?




Sathya Krishnamurthy
Res: 317-630-5412
Off: 317-278-1357

This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.

More information about the vtkusers mailing list