[vtkusers] How to extract a region of vtkImageData

Amy Squillacote amy.squillacote at kitware.com
Tue Jun 27 07:57:42 EDT 2006


Hi Marium,

The "coordinates" used by vtkExtractVOI::SetVOI are the pixel indices 
for the image. The ordering of the 6 parameters is i-min, i-max, j-min, 
j-max, k-min, k-max. Since your data is 2D, in one of these 3 dimensions 
(i, j, or k), the minimum and maximum values will be the same (probably 
both 0). Since you are working with vtkImageData, you need to use 
vtkExtractVOI; vtkExtractGrid takes vtkStructuredGrid (not vtkImageData) 
as input.

- Amy

marium ahmed wrote:
> Dear all,
>              I've a 2D image (vtkImageData) and I want to extract a 
> part from it, say a 3*3 part, I tried vtkExtractVOI and vtkExtractGrid 
> but I don't know how to set the parameters to extract the required 
> region.For example, vtkExtractVOI ::SetVOI() takes six integers do 
> they represent the coordinates? if so how?
>  
> thanks in advance,
> marium
>
> ------------------------------------------------------------------------
> Sneak preview the all-new Yahoo.com 
> <http://us.rd.yahoo.com/evt=40762/*http://www.yahoo.com/preview>. It's 
> not radically different. Just radically better.
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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