[vtkusers] problem feeding vtkImageData into a pipeline

Craig Henderson craig.henderson at intelligentultrasound.com
Fri Nov 9 05:16:29 EST 2012


Hi,

I am still quite new to VTK and am trying to use the reslicing classes,
based on the example in Examples\GUI\Qt\FourPaneViewer, although I am not
using QT.

 

I have this code, 

vtkSmartPointer<vtkImageData> image;

// image creation code snipped

auto riw = vtkSmartPointer<vtkResliceImageViewer>::New();

riw->SetRenderWindow(render_window_->GetRenderWindow());

riw->SetupInteractor(vtkSmartPointer<vtkRenderWindowInteractor>::New());

riw->SetResliceCursor(riw[0]->GetResliceCursor());

rep->GetResliceCursorActor()->GetCursorAlgorithm()->SetReslicePlaneNormal(i)
;

riw->SetInput(image);     //

riw->SetSliceOrientation(0);

riw->SetResliceModeToAxisAligned();

 

This fails on the penultimate line, the call to SetSliceOrientation(), and
seems to be because I have set the Input directly and the library is
expecting a pipeline algorithm. Is this the case, and can you please suggest
how to overcome this? Is there a pipeline algorithm to feed vtkImageData in
a call to SetInputConnection() or is that the wrong route?

 

Here's my call stack; note the inPtr is NULL calling into
vtkImageMapperConvertImageScalarsToRGBA() and beyond:

 

vtkRendering.dll!vtkImageMapperShiftScale<double,double>(const double *
inPtr=0x00000000, ... Line 487         C++

vtkRendering.dll!vtkImageMapperConvertImageScalarsToRGBA(void *
inPtr=0x00000000, ... Line 611       C++

vtkRendering.dll!vtkImageMapperMapColors(void * arg=0x28b16b9c) Line 787
C++

vtkCommon.dll!vtkMultiThreader::SingleMethodExecute() Line 292           C++

vtkRendering.dll!vtkImageMapper3D::MakeTextureData(vtkImageProperty *
property=0x28b160c8, vtkImageData * input=0x28b1adb8, ... Line 949  C++

vtkRendering.dll!vtkOpenGLImageSliceMapper::RenderTexturedPolygon(...) Line
276       C++

vtkRendering.dll!vtkOpenGLImageSliceMapper::RecursiveRenderTexturedPolygon(.
..) Line 150    C++

vtkRendering.dll!vtkOpenGLImageSliceMapper::Render(...) Line 1089      C++

vtkRendering.dll!vtkImageSlice::Render(...) Line 320        C++

vtkRendering.dll!vtkImageSlice::RenderOpaqueGeometry(vtkViewport *
viewport=0x28b1baf0) Line 275    C++

vtkRendering.dll!vtkRenderer::UpdateGeometry() Line 630           C++

vtkRendering.dll!vtkOpenGLRenderer::DeviceRender() Line 247   C++

vtkRendering.dll!vtkRenderer::Render() Line 345  C++

vtkRendering.dll!vtkRendererCollection::Render() Line 51 C++

vtkRendering.dll!vtkRenderWindow::DoStereoRender() Line 726  C++

vtkRendering.dll!vtkRenderWindow::DoFDRender() Line 692        C++

vtkRendering.dll!vtkRenderWindow::DoAARender() Line 579        C++

vtkRendering.dll!vtkRenderWindow::Render() Line 392     C++

vtkRendering.dll!vtkImageViewer2::Render() Line 688      C++

vtkWidgets.dll!vtkResliceImageViewer::Render() Line 420            C++

vtkRendering.dll!vtkImageViewer2::SetSliceOrientation(int orientation=0)
Line 301 C++

[myapp]

 

Many thanks

-- Craig

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121109/c591172a/attachment.htm>


More information about the vtkusers mailing list