GetContinuousIncrements() ?
M.Schrijver at el.utwente.nl
M.Schrijver at el.utwente.nl
Thu Apr 27 04:05:54 EDT 2000
Hello John,
It seems you have an incorrect idea of the concept of continuous
increments.
If you have the User's guide, refer to the "How to write an image
filter" section, page 239-240 (June 1999 version).
It says: " ..... Continuous increments are a convenience that makes it
easier to loop through the data in an extent. The y and z continuous
increments are the only values that get used. The y continuous increment
indicates how many units in memory must be moved past to get from the
end of one row to the beginning of the next. If the UpdateExtent matches
the data's Extent that value will be zero. ........ The same idea
applies for the z continuous increment. It indicates how many units in
memory need to be skipped to get from the end of one slice to the
beginning of the next."
This means that you can simply increment the pointer to the data after
each read/write operation to skip to the next pixel, and use the
continuous increments to skip from one row to another, and similarly
from one slice to the next. In pseudo-code:
loop over the slices {
loop over the rows {
loop over the pixels {
*outPtr++ = ........
}
outPtr+= outContIncrY
}
outPtr+= outContIncrZ
}
Succes, Marc
ir. Marc Schrijver
Faculty of Electrical Engineering (S&S NT)
University of Twente
The Netherlands
E-mail: m.schrijver at el.utwente.nl
> ----------
> From: John Biddiscombe[SMTP:j.biddiscombe at rl.ac.uk]
> Sent: Wednesday, April 26, 2000 11:57 AM
> To: vtkusers at public.kitware.com
> Subject: GetContinuousIncrements() ?
>
> Dear All,
>
> whilst trying to find the cause of my previous post, I stepped
> throuigh the
> code for GetContinuousIncrements(). It seems to return 0,0,0 for
> values
> which are equal to the WholeExtent. I might be using the routine
> incorrectly.
>
> If I have a DataSet with WholeExtent
> 0 1023
> 0 1023
> 0 1
>
> and I have an extent
> 0 31
> 0 31
> 0 1
>
> the (continuous) increments ought to return 1,1024,1024*1024 (for
> unsigned
> char) ???
>
> If so, then this is the same as GetIncrements.
>
> could it be that the Continuous increments should only return the
> offset
> part of the increments for when your extent is (say)
>
> 7 255
> 7 255
> 0 1
>
> and you get the 7 part returned and use it with the pointer to the
> zeroth
> element.
>
> Anybody played around with this?
>
> thanks
>
> John B
>
>
>
> --------------------------------------------------------------------
> This is the private VTK discussion list. Please keep messages
> on-topic.
> Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
> <majordomo at public.kitware.com>. For help, send message body containing
> "info vtkusers" to the same address.
> --------------------------------------------------------------------
>
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------
More information about the vtkusers
mailing list