Hello,<br><br>I have been trying to create a pipeline to visualize <b>ITK</b> data with <b>vtkTensorGlyph</b> in the same way defined in the example <b>TestPlaneWidget</b>.cxx. <br><br><div id="gwt-debug-file-name" class="gwt-Label G19n4oxmK">
But it seems <b>ITK</b> creates conflict with the <b>vtkProbeFilter</b> class, and I'm wondering what will be best way to convert the <b>ITK</b> data so I can feed it into <b>vtkTensorGlyph</b>.<br><br></div>This is my code:<br>
<br>[...]<br><b>// ITK to VTK code</b><br> vtkImageImport* vtkImporter = vtkImageImport::New();<br> typedef itk::Image< TensorPixelType, 3 > Vector3DImageType;<br> typedef itk::VTKImageExport<Vector3DImageType > VTKexporterVectorType;<br>
VTKexporterVectorType::Pointer VTKexporterVector = VTKexporterVectorType::New();<br> VTKexporterVector->SetInput ( ITK_image ); <br> ConnectPipelines(VTKexporterVector, vtkImporter);<br> vtkImporter->GetOutput()->Update();<br>
vtkImageData* data = vtkImporter->GetOutput();<br><br><b>//Glyph and probe filter</b><br>
vtkPolyData* plane=vtkPolyData::New();<br>
vtkTensorGlyph* g3d=vtkTensorGlyph::New();<br>
vtkProbeFilter* probe=vtkProbeFilter::New();<br>
probe->SetSource((vtkDataSet*)data);<br>
probe->SetInput (plane);<br>
probe->SpatialMatchOn();<br>
probe->Update(); <br>
g3d->SetInput(probe->GetOutput());<br>
g3d->SetSource( cone->GetOutput());<br><br> GCallback* glyphCallback=GCallback::New();<br> glyphCallback->PolyData=plane;<br> glyphCallback->Actor=m_Actor;<br> m_planeWidget->SetInteractor(mRen->GetInteractor());<br>
m_planeWidget->SetInput(data);<br> m_planeWidget->PlaceWidget();<br> m_planeWidget->On();<br>[...]<br><br><b>//Calback for filtering</b><br>
class GCallback : public vtkCommand<br>
{<br>
public:<br>
<br>
static GCallback *New()<br>
{return new GCallback;}<br>
<br>
virtual void Execute (vtkObject* caller, unsigned long, void*)<br>
{<br>
vtkPlaneWidget* planeWidget=reinterpret_cast<vtkPlaneWidget*>(caller);<br>
planeWidget->GetPolyData(this->PolyData);<br>
this->Actor->VisibilityOn();<br>
}<br>
<br>
GCallback():PolyData(0),Actor(0){}<br>
vtkPolyData* PolyData;<br>
vtkActor* Actor;<br>
};<br><br><br>