[vtkusers] Problems with TIFF Writer while writing a volume
Enkelejda Tafaj
lejda at gmx.de
Tue Jul 31 08:22:01 EDT 2007
Hi,
I'm using the vtkTIFFWriter to convert a 8-bit tiff image sequence into a volume. In my application I go through following steps:
1. Using the vtkTiffReader I first read a sequence of 50 8-bit tiff images. Thereby I'm setting the file dimensionality to 3.
2. In a second step I'm using a Gaussian filter to smooth the image stack.
3. At the end i would like to write out the filter result as a volume. If i use the TIFFWriter like below, it writes out a concatenation of the image sequence along the y axis. I don't get a volume but one very long image.
What am I doing wrong?
Thanks for your help!
Enkelejda
// 1. reading image sequence
vtkTIFFReader *imageReader = vtkTIFFReader::New();
imageReader->SetFilePrefix("image_");
imageReader->SetFilePattern("%s%.d.tif");
imageReader->SetFileDimensionality(3);
imageReader->SetDataExtent(0,299,0,299,1,50);
imageReader->SetDataSpacing(1,1,1);
imageReader->SetDataByteOrderToLittleEndian();
imageReader->UpdateWholeExtent();
// 2. Some Filtering-...
vtkImageMedian3D *filter = vtkImageMedian3D::New();
filter->SetKernelSize(3,3,3);
filter->SetInputConnection(imageReader->GetOutputPort());
filter->UpdateWholeExtent();
// 3. write out the result as a volume
vtkTIFFWriter *volumeWriter = vtkTIFFWriter::New();
volumeWriter->SetInputConnection(filter->GetOutputPort());
volumeWriter->SetFileDimensionality(3);
volumeWriter->SetFileName("test_volume.tif");
volumeWriter->Write();
--
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail
More information about the vtkusers
mailing list