[vtkusers] Image Extents: What's the difference?

Charles Law charles.law at kitware.com
Fri Jul 7 08:48:56 EDT 2000


At 04:24 PM 7/5/00 -0400, Volpe, Christopher R (CRD) wrote:
>Can anyone shed some light on the difference between "GetExtent()" and 
>"GetWholeExtent()" in a
>vtkImageData? Particularly as it applies to the *input* ImageData in a 
>filter. Note that in
>vtkImageGradient there is the seemingly self-contradictory code fragment:
>   wholeExtent = inData->GetExtent();

Chris,

GetWholeExtent() will return the extent of the entire volume that can be 
produced by the source.  The result is only valid after UpdateInformation() 
is called.  GetExtent() returns the extent of the image that is currently 
contained in the data.

     useZMin = ((idxZ + outExt[4]) <= wholeExtent[4]) ? 0 : -inIncs[2];

The code:
     wholeExtent = inData->GetExtent();

Is wrong, but it is not a bug.  wholeExtent = 
inData->GetWholeExtent();  Would work too, but the extent was probably used 
because it is used to keep the pointer arithmetic from going outside of 
memory (the extent currently in the image data).  I would probably only 
change the name of the variable.

Either way, the method ComputeInputUpdateExtent makes the code behave the 
same way.  Unless we are at the boundary of the WholeExtent,  we are 
guaranteed to have the data in the Extent (in the image data).

Charles.



>thanks,
>Chris
> > g GE Corporate Research & Development
> > 
> __________________________________________________________________________ 
> _________________________
> > _______________________________________________
> >
>Christopher R. Volpe
>Computer Scientist
>Visual Information Program
>Bldg KW, Room C215
>P.O. Box 8, Schenectady, NY 12301
>
>(518) 387-7766, Dial Comm: 8*833-7766, Fax: (518) 387-6981
>e-mail: volpecr at crd.ge.com    web: http://www.crd.ge.com/~volpecr
>
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>vtkusers mailing list
>vtkusers at public.kitware.com
>http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list