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
Swiss National Supercomputing Center
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the ParaView Wiki at:
http://paraview.org/Wiki/ParaView
Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview