[vtkusers] Using vtkExtractVOI with negative extent on a 2D vtkImageData

Flo snrf at no-log.org
Tue Aug 7 16:33:00 EDT 2007


Dear all:

I'm using vtkExtractVOI to extract a Region of Interest such as  
presented in TestImageTracerWidget.
However, I'm using it to get a ROI out of a 2D vtkImageData (through  
the ITK2VTK pipeline).

I realized that the vtkExtractVOI does not work (at least for me)  
with data's negative extent.
The first thing I noticed was that the Spline Path (the ROI) was  
always shifted from the original actor to the output actor. Thus, I  
dug a little bit on vtkusers, saw some ppl reporting a bug - change  
the line 202 of vtkExtractVOI to outOrigin[i] - origin[i] (one may  
notice the comments of the vtk programmer - //We might as well make  
this work for negative extents).
This solved it and now both Spline ROI are localized identically on  
both the input and output actor - As well, the VTK example mentionned  
above still compiles and runs.

HOWEVER, I'm still not able to extract the ROI, meaning I do have the  
Spline path where it is supposed to be, but it does not extract the  
ROI. I guess this is because I fixed my issue for a display, but not  
for the overall extraction process.

Am I the one ont using vtkExtractVOI correctly with a 2D vtkImageData  
or is there an actual problem using it in such cases ? Is there a fix ?

regards,
flo.



More information about the vtkusers mailing list