[vtkusers] vtkSCLReader, vtkContourFilter-Output
Amy Squillacote
amy.squillacote at kitware.com
Mon Aug 1 08:46:56 EDT 2005
At 12:14 AM 7/30/2005, Joshua Thomas wrote:
>Hi All,
> I am creating a pipeline in vtk reading the data (CT Scanner vw_knee.slc)
>I created the surface using vtkContourFilter object i chose the
>density units as 75.
>I used the extra objects such as PolyDataMapper with the Actor
>Addactor GetOutput etc.,
>I set properties in the actor as ScalarVisibilityOff . I tidying up
>with vtkOutlineFilter. But i donot know how to use vtkExtractVOI for
>the sub-sampling the data. Below is the source code (vtk with Tcl)
From the header file vtkExtractVOI.h: (The VTK documentation is
also available on-line at: http://www.vtk.org/doc/nightly/html/classes.html.)
// Description:
// Set the sampling rate in the i, j, and k directions. If the rate is >
// 1, then the resulting VOI will be subsampled representation of the
// input. For example, if the SampleRate=(2,2,2), every other point will
// be selected, resulting in a volume 1/8th the original size.
>## Now i can see the knee joint bones but not the skin. Can anyone help!
You can set more than one contour value in vtkContourFilter. The
SetValue method takes an index and a contour value, so add something
like the following:
contours SetValue 1 $skinValue
# You have to figure out what the correct contour value is for skin...
- Amy
>#######################################################
>package require vtk
>package require vtkinteraction
>
>##To read the knee data
>## Using SCL Reader
>
>vtkSLCReader reader
>reader SetFileName "$VTK_DATA_ROOT/Data/vw_knee.slc"
>
>vtkContourFilter contours
> contours SetInput [reader GetOutput]
> contours SetValue 0 75
>
>
># The contour lines are mapped to the graphics
>vtkPolyDataMapper contMapper
> contMapper SetInput [contours GetOutput]
> contMapper SetScalarRange 0.0 1.2
>
>vtkActor contActor
> contActor SetMapper contMapper
>
># Create outline an outline of the vw_knee data.
>vtkOutlineFilter outline
> outline SetInput [reader GetOutput]
>
>vtkPolyDataMapper outlineMapper
> outlineMapper SetInput [outline GetOutput]
> outlineMapper ScalarVisibilityOff
>
>vtkActor outlineActor
> outlineActor SetMapper outlineMapper
> eval [outlineActor GetProperty] SetColor 1 1 1
>
># Create the renderer, render window, and interactor.
>vtkRenderer ren1
>vtkRenderWindow renWin
> renWin AddRenderer ren1
>vtkRenderWindowInteractor iren
> iren SetRenderWindow renWin
>
># Set the background color to white.
># renderer.
>ren1 SetBackground 0.1 0.2 0.4
>ren1 AddActor contActor
>ren1 AddActor outlineActor
>
># Zoom in a little bit. Associate the Tk interactor popup with a user
>
>[ren1 GetActiveCamera] Zoom 0.8
>iren AddObserver UserEvent {wm deiconify .vtkInteract}
>iren Initialize;
>
># Hide the root Tk window
>wm withdraw .
>
>###Need your Help####
>
>Regards,
>JJ
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at:
>http://www.vtk.org/Wiki/VTK_FAQ
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list