[Paraview] reading a stack of TIFF images
David Doria
daviddoria at gmail.com
Wed Nov 17 14:38:22 EST 2010
On Wed, Nov 17, 2010 at 10:57 AM, Favre Jean <jfavre at cscs.ch> wrote:
> Hi there
>
> this afternoon, I was asked to read a stack of TIFF images in ParaView. Well, I search the archive mailing list, tried different things which led me nowhere, and could not find a solution out of the box.
>
> I then worked on a Python script which now works very well for our purpose. I thought I would post it since the question seems to come up every now and then, and I am not aware of a solution posted on the net.
>
> I used a ProgrammableSource, with output type set to "vtkImageData"
>
> # I set my whole extend in the RequestInformation panel:
>
> self.GetImageDataOutput().SetWholeExtent(0,511,0,511,0,192)
>
> # and I filled in the Script text panel with:
>
> import vtk
> r = vtk.vtkTIFFReader()
> r.SetFilePrefix("/local/data/red_Z")
> r.SetFilePattern("%s%03d.tif")
> r.SetDataExtent(0,511,0,511,0,192)
> r.SetDataSpacing(1,1,0.001)
> r.Update()
> self.GetImageDataOutput().ShallowCopy(r.GetOutput())
>
>
> Got a nice picture of a neuron after that, so I hope some other people find it useful.
>
> -----------------
> Jean M. Favre
Jean,
I just tried allowing the TIFF reader to read a series of files. For
some reason it doesn't work though - my test files named 001.tif and
002.tif are not recognized as a series. Here are the relevant files:
http://gitorious.org/paraviewsandbox/paraviewsandbox/blobs/TIFFSeries/Servers/ServerManager/Resources/readers.xml
http://gitorious.org/paraviewsandbox/paraviewsandbox/blobs/TIFFSeries/Applications/ParaView/ParaViewReaders.xml
Can anyone see where I've gone wrong?
Thanks,
David
More information about the ParaView
mailing list