[vtkusers] add circles & sphere to DICOM slices & 3D viewer
david.gobbi at gmail.com
Fri Jan 9 08:05:27 EST 2015
On Fri, Jan 9, 2015 at 3:03 AM, mbcx9rb9 <richard.j.brown at live.co.uk> wrote:
> 1. the coordinates returned by the interactor use the Display coordinate
> system, so they depend on the window size, zoom, rotation, etc. of the
> viewer - can I get it to return the nearest DICOM world(?) coordinate such
> that, for a DICOM of 500 x 500 x 500 slices, I return x, y, z coordinates
> between 0 and 500?
The vtkCellPicker can do this. With it, you can do a "Pick" at your display
coordinates, and then you can call GetPointIJK() to get the i,j,k
The "IJK" coordinates are what VTK calls "structured coordinates" and they
are what you want.
2. When I draw the circle or sphere, it removes the previous slice or 3D
> render. I saw in this example
> , he added both actors at the same time. Short of redrawing everything I
> can't do that - it seems that adding one in later removes the previous
The way you are describing this suggests that you don't yet understand
how VTK rendering works... drawing the sphere cannot "remove" the slice.
All of the actors exist in the scene at the same time. If you can't see an
actor, it probably just means that (a) it is hidden underneath another
actor, or (b) it is not within the viewing frustum.
I think that what you want to do is show just the outline of where the
intersects the slice. This can be done by applying vtkCutter to the sphere.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the vtkusers