[Paraview] Visualize slice thickness?
daviddoria at gmail.com
Thu Jul 30 15:58:08 EDT 2009
On Thu, Jul 30, 2009 at 3:23 PM, pat marion <pat.marion at kitware.com> wrote:
> Why this sounds like a great opportunity for the new python macro
> feature :-) You could two scripts, StepForward.py and
> StepBackward.py, and add them to the macros toolbar. Now you'll have
> two buttons for stepping forward and backward. I don't have time
> right now to figure out the complete script but it would be something
> e = GetActiveSource()
> # maybe make sure e.GetVTKClassName() == "vtkExtractGeometry"
> e.IntersectWith = "Plane"
> planeOrigin = e.IntersectWith.Origin
> imageInput = e.Input
> e.IntersectWith.Origin = computeNewOrigin(planeOrigin, imageInput)
> Then all you need to do is write the computeNewOrigin method that
> takes the image, gets the origin, extens, and spacing, and then
> computes a new plane origin to step the plane one discreet step
> forward or backward.
These macros are very cool! That code was right on, it works perfectly if I
set the new origin to a constant.
e.IntersectWith.Origin = [x,y,z]
Now for writing computeNewOrigin(), I looked at dir(imageInput) but I didn't
see properties like "spacing" or "cellSize" - where should I look to find
out how to get those properties from an image in python?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ParaView