[vtkusers] UpdateExtent, WholeExtent and so on...
Steve Boyd
skboyd at ucalgary.ca
Thu May 22 12:23:48 EDT 2003
Hello,
I am writing a reader class for my CT files that generates vtkImageData
and I would like to be sure that I'm using UpdateExtent, WholeExtent and
Extent correctly. I find this very confusing!
To give an example, a typical test CT file that I'm using contains an
array of scalars 25x25x25, but because the outer edge elements are
garbage (due to filtering), I'm only interested in the 23x23x23 array
within. All of the information about CT data dimensions and the
validity of the outer edge is contained in the file (my class uses that
information automatically rather than letting a user set 'extents').
In my new class vtkMyCTDataReader I do the following:
1. In vtkMyCTDataReader::ExecuteInformation, I SetWholeExtent to
(0,24,0,24,0,24). This, I presume, automatically sets UpdateExtent to
the same values (according to the latest VTK User Manual). I also
define the scalar type (VTK_CHAR) and the number of scalar components
(1).
2. Then, in vtkMyCTDataReader::ExecuteData, I allocate memory for
vtkImageData. Because I only want to read the data in the 23x23x23
subset, I re-SetWholeExtent to (1,23,1,23,1,23) (AM I WRONG HERE?). I
can read the data in successfully, but now my WholeExtent and my
UpdateExtent are different! Does this mean that the filter will update
unnecessarily when used in pipelines because UpdateExtent and
WholeExtent are now different?
I am obviously confused on how to use WholeExtent and UpdateExtent (let
alone Extent) correctly. I've found a couple of sentences describing it
in the VTK User Manual, but I am still unclear. Can somebody clarify
how to use these???
Sincerely,
Steve
--
Steven Boyd, PhD
Assistant Professor
Department of Mechanical and Manufacturing Engineering
University of Calgary
2500 University Drive, N.W.
Calgary, Alberta, Canada, T2N 1N4
tel. 1.403.220.4173 fax. 1.403.282.8406 skboyd at ucalgary.ca
-------------------------------------------------------------------
More information about the vtkusers
mailing list