Hi,<div>      I am facing a strange problem, actually i was implementing NOISE algorithm for contour extraction. So i implemented a subclass of vtkScalarTree (subclass name is vtkRRCKDTree). But when i do UseScalarTreeOn, it seems like vtkContourFilter is actually not using ScalarTree to get active contour cells. So i took one step backward and used vtkSimpleScalarTree, but vtkContourFilter doesn&#39;t seem to use ScalarTree in this case also. (PS: i am observing the visualization in TCL by pressing &#39;u&#39; when gui appears, then typing &#39;myTree Print&#39; or &#39;contour Print&#39;)</div>
<div>     My code is as follows:</div><div><div><br></div><div>package require vtk</div><div>package require vtkinteraction</div><div><br></div><div># create renderer, render window, and interactor</div><div>vtkRenderer aRenderer</div>
<div>vtkRenderWindow renWin</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renWin AddRenderer aRenderer</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>renWin SetSize 640 480</div>
<div>vtkRenderWindowInteractor iren</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>iren SetRenderWindow renWin</div><div><br></div><div># create reader</div><div>vtkImageReader aReader</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetFileName<span class="Apple-tab-span" style="white-space:pre">        </span>&quot;engine.raw&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetFileDimensionality<span class="Apple-tab-span" style="white-space:pre">        </span>3</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetDataExtent<span class="Apple-tab-span" style="white-space:pre">        </span>0 127 0 148 0 200</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetDataSpacing<span class="Apple-tab-span" style="white-space:pre">        </span>0.046766 0.046766 0.046766</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetDataOrigin<span class="Apple-tab-span" style="white-space:pre">        </span>0.0 0.0 0.0</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>SetDataScalarTypeToUnsignedChar</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>aReader<span class="Apple-tab-span" style="white-space:pre">        </span>UpdateWholeExtent</div>
<div><br></div><div># outline filter</div><div>vtkOutlineFilter outline</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>outline<span class="Apple-tab-span" style="white-space:pre">        </span>SetInputConnection<span class="Apple-tab-span" style="white-space:pre">        </span>[aReader GetOutputPort]</div>
<div>vtkPolyDataMapper outlineMapper</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>outlineMapper<span class="Apple-tab-span" style="white-space:pre">        </span>SetInputConnection [outline GetOutputPort]</div>
<div>vtkActor outlineActor</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>outlineActor<span class="Apple-tab-span" style="white-space:pre">        </span>SetMapper outlineMapper</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>[outlineActor GetProperty] SetColor 0 0 1</div>
<div><br></div><div># create scalar tree</div><div>vtkSimpleScalarTree myTree</div><div>  myTree SetDataSet [aReader GetOutput]</div><div># isosurface filter</div><div>vtkContourFilter contour</div><div>  contour SetInputConnection [aReader GetOutputPort]</div>
<div>  contour SetValue 0 1</div><div>  contour SetScalarTree myTree</div><div>  contour UseScalarTreeOn</div><div>  contour ComputeNormalsOn</div><div>  contour ComputeGradientsOn</div><div>vtkPolyDataMapper mcMapper</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>mcMapper SetInputConnection [contour GetOutputPort]</div><div>  eval mcMapper SetScalarRange [[aReader GetOutput] GetScalarRange]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>mcMapper ScalarVisibilityOn</div>
<div>vtkActor mcActor</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>mcActor SetMapper mcMapper</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>[mcActor GetProperty] SetColor 1 1 1</div>
<div><br></div><div># complete pipeline</div><div>aRenderer AddActor outlineActor</div><div>aRenderer AddActor mcActor</div><div>aRenderer ResetCamera</div><div>aRenderer ResetCameraClippingRange</div><div><br></div><div>
# slider widget representation</div><div>vtkSliderRepresentation2D sliderRep</div><div>  sliderRep SetMinimumValue 0</div><div>  sliderRep SetMaximumValue 255</div><div>  sliderRep SetValue  1</div><div>  sliderRep SetTitleText  &quot;isosurface value&quot;</div>
<div># position slider</div><div>  [sliderRep GetPoint1Coordinate] SetCoordinateSystemToNormalizedDisplay</div><div>  [sliderRep GetPoint1Coordinate] SetValue 0.1 0.1</div><div>  [sliderRep GetPoint2Coordinate] SetCoordinateSystemToNormalizedDisplay</div>
<div>  [sliderRep GetPoint2Coordinate] SetValue 0.9 0.1</div><div># slider representation</div><div>  sliderRep SetSliderLength 0.02</div><div>  sliderRep SetSliderWidth  0.03</div><div>  sliderRep SetEndCapLength 0.01</div>
<div>  sliderRep SetEndCapWidth  0.03</div><div>  sliderRep SetTubeWidth  0.005</div><div>  sliderRep SetLabelFormat  &quot;%3.0f&quot;</div><div># actual slider widget</div><div>vtkSliderWidget sliderWidget</div><div>  sliderWidget SetInteractor iren</div>
<div>  sliderWidget SetRepresentation sliderRep</div><div>  sliderWidget KeyPressActivationOff</div><div>  sliderWidget SetAnimationModeToAnimate</div><div>  sliderWidget AddObserver InteractionEvent callback</div><div><br>
</div><div># start viz.</div><div>iren AddObserver UserEvent {wm deiconify .vtkInteract}</div><div>iren Initialize</div><div>renWin  Render</div><div>sliderWidget On</div><div>wm withdraw .</div><div><br></div><div>vtkMath math</div>
<div>proc callback { } {</div><div>  contour SetValue 0 [ eval math Round [ sliderRep GetValue ] ]</div><div>}</div></div><div><br></div><div>Thanks,<br>-- <br>Rooparam Choudhary,<br> M Tech (2010-2012)<br> Computational Science,<br>
 Supercomputer Education &amp; Research Center,<br> Indian Institute of Science,<br> Bangalore - 560 012, INDIA<br> Ph: (P) +91-94613-14938<br> email:      <a href="mailto:rooparam@rishi.serc.iisc.ernet.in">rooparam@rishi.serc.iisc.ernet.in</a><br>

</div>