[Insight-users] Problem of ImageToVTKImageFilter, when displaying 2 images

Patrick Cheng cheng at isis.georgetown.edu
Wed Jan 25 12:51:36 EST 2006


Hi,

This is a long existing problem. Trying to figure out why too.

A quick and dirty fix is to instantiate a new itkImageToVTKImageFilter 
every time you read a new image.

Patrick



ask ITK wrote:
> Problem occurs when I want to use itkImageToVTKImageFilter to display
> 2 different images.
> 
> I want to display to different image with the VTK viewer..
> of coz I think it requires 2 different viewers and 2 different interactors.
> So I created 2 for both of them.
> 
> Loading the first image is fine, but after I load teh second image,
> the first image also become the second image!
> I don't know how to solve this problem...so please help...
> 
> following error is displayed:
> 
> ERROR: In D:\Research\VTK\src\Filtering\vtkStreamingDemandDrivenPipeline.cxx,
> line 643
> vtkImageImportExecutive (020D8F78): The update extent specified in the
> information for output port 0 on algorithm vtkImageImport(020D8AD0) is
> 0 142 0 167 0 0, which is outside the whole extent 0 141 0 166 0 0.
> 
> I attached my code below, very short, can I can run the program
> smoothly except the stated error. Please help, thanks!
> =======================================================
> 
> void ApplicationCore::callViewer(ImagePtr image, int choice)
> {
> 	m_itkvtkconnector[choice]->SetInput( image );
> 
> 	m_ImageViewer[choice]->SetupInteractor( m_renderWindowInteractor[choice]);
> 	m_ImageViewer[choice]->SetInput( m_itkvtkconnector[choice]->GetOutput() );
> 	m_ImageViewer[choice]->SetSize(image->GetLargestPossibleRegion().GetSize()[0],image->GetLargestPossibleRegion().GetSize()[1]);
> 	m_ImageViewer[choice]->Render();
> 	m_ImageViewer[choice]->SetColorWindow( 255);
> 	m_ImageViewer[choice]->SetColorLevel( 128);
> //	m_renderWindowInteractor[choice]->Start();
> }
> =======================================================
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 


More information about the Insight-users mailing list