VTK
|
iterate over point data in an image. More...
#include <vtkImagePointDataIterator.h>
Public Member Functions | |
vtkImagePointDataIterator () | |
Default constructor, its use must be followed by Initialize(). More... | |
vtkImagePointDataIterator (vtkImageData *image, const int extent[6]=nullptr, vtkImageStencilData *stencil=nullptr, vtkAlgorithm *algorithm=nullptr, int threadId=0) | |
Create an iterator for the given image, with several options. More... | |
void | Initialize (vtkImageData *image, const int extent[6]=nullptr, vtkImageStencilData *stencil=nullptr, vtkAlgorithm *algorithm=nullptr, int threadId=0) |
Initialize an iterator. More... | |
void | NextSpan () |
Move the iterator to the beginning of the next span. More... | |
bool | IsAtEnd () |
Test if the iterator has completed iterating over the entire extent. More... | |
bool | IsInStencil () |
Check if the iterator is within the region specified by the stencil. More... | |
const int * | GetIndex () |
Get the index at the beginning of the current span. More... | |
vtkIdType | GetId () |
Get the point Id at the beginning of the current span. More... | |
vtkIdType | SpanEndId () |
Get the end of the span. More... | |
void | GetIndex (int result[3]) |
Get the index at the beginning of the current span. More... | |
Static Public Member Functions | |
static void * | GetVoidPointer (vtkImageData *image, vtkIdType i=0, int *pixelIncrement=nullptr) |
Get a void pointer and pixel increment for the given point Id. More... | |
static void * | GetVoidPointer (vtkDataArray *array, vtkIdType i=0, int *pixelIncrement=nullptr) |
Get a void pointer and pixel increment for the given point Id. More... | |
Protected Member Functions | |
void | SetSpanState (int idX) |
Set all the state variables for the stencil span that includes idX. More... | |
void | ReportProgress () |
Report the progress and do an abort check, for compatibility with existing image filters. More... | |
iterate over point data in an image.
This class will iterate over an image. For each position, it will provide the (I,J,K) index, the point Id, and if a stencil is supplied, it will report whether the point is inside or outside of the stencil.
For efficiency, this class iterates over spans rather than points. Each span is one image row or partial row, defined by a start position and a size. Within a span, only the X index and the point Id will change. The vtkImagePointDataIterator and related iterators are the preferred method of iterating over image data within the VTK image filters.
Definition at line 45 of file vtkImagePointDataIterator.h.
vtkImagePointDataIterator::vtkImagePointDataIterator | ( | ) |
Default constructor, its use must be followed by Initialize().
|
inline |
Create an iterator for the given image, with several options.
If a stencil is provided, then the iterator's IsInStencil() method reports whether each span is inside the stencil. If an extent is provided, it iterates over the extent and ignores the rest of the image (the provided extent must be within the image extent). If a pointer to the algorithm is provided and threadId is set to zero, then progress events will provided for the algorithm.
Definition at line 62 of file vtkImagePointDataIterator.h.
void vtkImagePointDataIterator::Initialize | ( | vtkImageData * | image, |
const int | extent[6] = nullptr , |
||
vtkImageStencilData * | stencil = nullptr , |
||
vtkAlgorithm * | algorithm = nullptr , |
||
int | threadId = 0 |
||
) |
Initialize an iterator.
See constructor for more details.
void vtkImagePointDataIterator::NextSpan | ( | ) |
Move the iterator to the beginning of the next span.
A span is a contiguous region of the image over which nothing but the point Id and the X index changes.
|
inline |
Test if the iterator has completed iterating over the entire extent.
Definition at line 88 of file vtkImagePointDataIterator.h.
|
inline |
Check if the iterator is within the region specified by the stencil.
This is updated when NextSpan() is called.
Definition at line 97 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 106 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 117 of file vtkImagePointDataIterator.h.
|
inline |
Get the point Id at the beginning of the current span.
Definition at line 125 of file vtkImagePointDataIterator.h.
|
inline |
Get the end of the span.
Definition at line 133 of file vtkImagePointDataIterator.h.
|
static |
Get a void pointer and pixel increment for the given point Id.
The pixel increment is the number of scalar components.
|
static |
Get a void pointer and pixel increment for the given point Id.
The array must be the same size as the image. The pixel increment that is returned will be the number of components for the array.
|
protected |
Set all the state variables for the stencil span that includes idX.
|
protected |
Report the progress and do an abort check, for compatibility with existing image filters.
If an algorithm was provided to the constructor, then this is called every time that one row of the image is completed.
|
protected |
Definition at line 169 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 170 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 171 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 172 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 173 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 176 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 177 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 178 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 179 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 182 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 185 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 186 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 189 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 190 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 191 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 192 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 193 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 194 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 195 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 198 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 199 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 200 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 201 of file vtkImagePointDataIterator.h.