[vtkusers] Using vtkExtractVOI with negative extent on a 2D vtkImageData
Flo
snrf at no-log.org
Tue Aug 7 20:11:03 EDT 2007
Dear all:
I actually solved my problem - maybe that s not the best way but I
just post MY solution (maybe risky).
I made a change round line 204 of vtkExtractVOI.cxx from outOrigin
[i] - voi[2*i] ..... to outOrigin[i] = origin[i]
Then recompile VTK and I made sure the example TestImageTracerWidget
was still working !
Then, to extract a ROI from the Spline considering a 2D
vtkImageData, one should modify the vtkImageTracerWidget and the
vtkSplineWidget to the SetProjectionNormalToZAxes .... as well as the
extruding vector nomal to the x,y plane, SetVector(0,0,1)
I was missing the update of the last extruding vector.
regards,
Flo.
On 7-Aug-07, at 4:33 PM, Flo wrote:
> 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.
> _______________________________________________
> This is the private VTK discussion list.Please keep messages on-
> topic. Check the 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