[vtkusers] vtkImageData and pipelines

Craig Henderson craig.henderson at intelligentultrasound.com
Tue Nov 13 05:05:08 EST 2012


I use SetInput(), which I think is the problem. It seems I need to use
SetInputConnection() as the pipeline is incomplete with SetInput()?

 

I get these errors:

ERROR: In ..\..\Filtering\vtkDemandDrivenPipeline.cxx, line 727

vtkStreamingDemandDrivenPipeline (0892D3C0): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(088ECF68) has 0 connections but is not
optional.

 

ERROR: In ..\..\Filtering\vtkDemandDrivenPipeline.cxx, line 727

vtkStreamingDemandDrivenPipeline (0892D3C0): Input port 0 of algorithm
vtkImageMapToWindowLevelColors(088ECF68) has 0 connections but is not
optional.

 

ERROR: In ..\..\Filtering\vtkImageData.cxx, line 1530

vtkImageData (0BCB8330): GetScalarPointer: Pixel (0, 0, 0) not in memory.

Current extent= (0, -1, 0, -1, 0, -1)

 

Thanks

-- Craig

 

From: Dan Lipsa [mailto:dan.r.lipsa at gmail.com] 
Sent: 13 November 2012 08:23
To: Craig Henderson
Subject: Re: [vtkusers] vtkImageData and pipelines

 

If you set the input directly you should use SetInput instead of
SetInputConnection.

On Nov 12, 2012 8:42 PM, "Craig Henderson"
<craig.henderson at intelligentultrasound.com
<mailto:craig.henderson at intelligentultrasound.com> > wrote:

Hi,

I asked this last week, but didn't get any response. I haven't been able to
solve the problem so thought I'd try the list again.

I 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 anyone 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]


Thanks

-- Craig

 


_______________________________________________
Powered by www.kitware.com <http://www.kitware.com> 

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers

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


More information about the vtkusers mailing list