[ITK-users] [ITK] Problem with itkImageToVTKImageFilter

Timothee Evain tevain at telecom-paristech.fr
Fri Jul 10 13:50:24 EDT 2015


Hello,

With a fast debug session on your problem, here is what I found :

When you are calling the UpdateLargestPossibleRegion() on the itkImageToVTKImageFilter you are doing this : 

{
   this->UpdateOutputInformation();
      
      if( this->GetPrimaryOutput() )
      {
         this->SetRequestedRegionToLargestPossibleRegion();
         this->Update();
      }
}

You see nothing happening because the "if" condition isn't fullfilled, so basically you are just updating output information.
I'm not able to tell you why this happens, but it's not your fault.
I guess the problem have to be related to the fact that itkImageToVTKImageFilter is a "composite" filter to do the bridge between ITK and VTK.
So maybe there is a trouble returning a VTK structure (since the output of this filter is handled by a vtkImageImport if I'm not mistaking).

A ITK/VTK dev should be able to help you more than I. 

Sorry!


Tim


----- Mail original -----
De: "SiavashK" <siavashk at ece.ubc.ca>
À: insight-users at itk.org
Envoyé: Jeudi 9 Juillet 2015 21:26:07
Objet: [ITK] [ITK-users] Problem with itkImageToVTKImageFilter

Hello,

I am having a bit of issue with itkImageToVTKImageFilter. My goal is simple,
I would like to convert an ITK image to a VTK image in order to display it
in a QVTKWidget. To this end, I have created an instance
itkImageToVTKImageFilter, to which I feed my ITK Image.

The issue is that the size/spacing of my images change depending on the
state of my GUI. As I have read through the mailing list, this is typically
handled by calling UpdateLargestPossibleRegion() instead of Update() on the
filter (for example see  this
<http://www.itk.org/ITKExamples/src/Core/Common/ReRunPipelineWithChangingLargestPossibleRegion/Documentation.html> 
).

My issue is that calling UpdateLargestPossibleRegion() does not seem to
produce any output. 

I have attached a small working example to illustrate this. I would be happy
if anyone could tell me what I am doing wrong, or if there is a bug in this
filter.

Usage is:
>> imageToVTKImageTest.exe 1.png 2.png

CMakeLists.txt
<http://itk-insight-users.2283740.n2.nabble.com/file/n7587561/CMakeLists.txt>  
imageToVTKImageTest.cxx
<http://itk-insight-users.2283740.n2.nabble.com/file/n7587561/imageToVTKImageTest.cxx>  
1.png <http://itk-insight-users.2283740.n2.nabble.com/file/n7587561/1.png>  
2.png <http://itk-insight-users.2283740.n2.nabble.com/file/n7587561/2.png>  



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problem-with-itkImageToVTKImageFilter-tp7587561.html
Sent from the ITK Insight 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

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/insight-users
_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community


More information about the Insight-users mailing list