[vtkusers] Pipeline Issue with itkImageToVTKImageFilter

John Stark john.stark at inria.fr
Mon Nov 12 15:27:58 EST 2012


Hello Jeremy,

I'm not sure if this is the cause of the crash you have, but it sounds similar to an issue I fixed myself.  The patch to VTK may help, it's described in more detail here:
http://vtk.org/Bug/view.php?id=12684

And possibly this patch (If you are using ITK v3.x.x).
http://www.itk.org/Bug/view.php?id=11316


HTH,

John

----- Mail original -----
> De: "goodsit2" <goodsije at live.com>
> À: vtkusers at vtk.org
> Envoyé: Mercredi 7 Novembre 2012 22:20:22
> Objet: [vtkusers] Pipeline Issue with itkImageToVTKImageFilter
> 
> I've searched through previous messages, but found only one post on
> this
> topic with no response. Hopefully this time someone will have a
> solution!
> 
> Concisely, my pipeline is as follows: itk::ImageSeriesReader ->
> itkImageToVTKImageFilter -> vtkImageViewer2 -> QVTKWidget.  In a
> little more
> elaborate pseudo code it goes like this:
> 
> Initially when entering the GUI, the pipeline is established like so:
> 
>         //reader is an itkImageSeriesReader with specified
>         InputImageType.
>         //currImage is an itkImage which has the specified
>         InputImageType.
>         // iToVconnector is the itkImageToVTKImageFilter pointer.
>         // imageViewer is the vtkImageViewer2 pointer.
>         // myWindow is the QVTKWidget pointer.
>         reader->SetFileName("Black Screen.dcm");
> 	reader->Update();
> 	currImage = reader->GetOutput();
> 	currImage->DisconnectPipeline();
> 
> 	// Connect reader and filter.
> 	iToVconnector->SetInput(currImage);
> 
> 	// Create and connect imageViewer to filter.
> 	imageViewer = vtkImageViewer2::New();
> 	imageViewer->SetInput(iToVconnector->GetOutput());
> 
> 	// Connect the widget to the imageViewer.
> 	myWindow->SetRenderWindow(imageViewer->GetRenderWindow());
> 
> As you can see, I do disconnect the reader pipeline, but currImage
> does not
> go out of scope since it is a member variable. Later, I try to
> introduce a
> new input into the iToVconnector and that is where it crashes. Here
> is that
> code:
> 
>     // newCurrImage is an itkImage which has been disconnected from
>     its
> pipeline.
>     iToVconnector->SetInput(newCurrImage);   //CRASHES
> HERE!!!!!!!!!!!!!!!!!!!!!!!!
>     iToVconnector->Update();
>     imageViewer->UpdateDisplayExtent();
>     imageViewer->Render();
>     imageViewer->GetRenderer()->ResetCamera();
>     myWindow->update();
>     currImage = newCurrImage;
> 
> 
> I'm thinking that it crashes because iToVconnector is not a
> disconnected
> pipeline, how can I disconnect it and be able to introduce new items
> to the
> my pre-existing pipeline?
> 
> Thanks for your time.
> 
> Bests,
> 
> Jeremy
> 
> 
> 
> 
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Pipeline-Issue-with-itkImageToVTKImageFilter-tp5717025.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by 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
>



More information about the vtkusers mailing list