[Paraview] Visualize slice thickness?

David Doria 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
> like...
>
> e = GetActiveSource()
> # maybe make sure e.GetVTKClassName() == "vtkExtractGeometry"
> e.IntersectWith = "Plane"
> planeOrigin = e.IntersectWith.Origin
> imageInput = e.Input[0]
> 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.
>
> Pat
>

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?

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090730/d80ca3ba/attachment.htm>


More information about the ParaView mailing list