VTK
|
iterate over all data points in an image. More...
#include <vtkImagePointIterator.h>
Public Member Functions | |
vtkImagePointIterator () | |
Default constructor, its use must be followed by Initialize(). More... | |
vtkImagePointIterator (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... | |
bool | IsAtEnd () |
Test if the iterator has completed iterating over the entire extent. More... | |
double * | GetPosition () |
Get the current position. More... | |
void | NextSpan () |
Move the iterator to the beginning of the next span. More... | |
void | Next () |
Move to the next position (rather than directly to the next span). More... | |
void | GetPosition (double x[3]) |
Get the current position and place it in the provided array. More... | |
void | GetPosition (float x[3]) |
Get the current position and place it in the provided array. More... | |
Public Member Functions inherited from vtkImagePointDataIterator | |
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... | |
Protected Member Functions | |
void | UpdatePosition () |
Helper method to update the position coordinate from the index. More... | |
Protected Member Functions inherited from vtkImagePointDataIterator | |
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... | |
Protected Attributes | |
double | Origin [3] |
double | Spacing [3] |
double | Position [3] |
Protected Attributes inherited from vtkImagePointDataIterator | |
vtkIdType | Id |
vtkIdType | SpanEnd |
vtkIdType | RowEnd |
vtkIdType | SliceEnd |
vtkIdType | End |
vtkIdType | RowIncrement |
vtkIdType | SliceIncrement |
vtkIdType | RowEndIncrement |
vtkIdType | SliceEndIncrement |
int | Extent [6] |
int | Index [3] |
int | StartY |
bool | HasStencil |
bool | InStencil |
int | SpanSliceEndIncrement |
int | SpanSliceIncrement |
int | SpanIndex |
int * | SpanCountPointer |
int ** | SpanListPointer |
vtkAlgorithm * | Algorithm |
vtkIdType | Count |
vtkIdType | Target |
int | ThreadId |
Additional Inherited Members | |
Static Public Member Functions inherited from vtkImagePointDataIterator | |
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... | |
iterate over all data points in an image.
This class will iterate over an image. For each position, it provides the (x,y,z) position, the (I,J,K) index, and the point Id. If a stencil is provided, then it also reports, for each point, whether the point is inside the stencil.
The iterator can go through the image point-by-point or span-by-span. The Next() method advances to the next point, while the NextSpan() method skips to the beginning of the next span, where a span is defined as a start position and point count within an image row.
Definition at line 39 of file vtkImagePointIterator.h.
vtkImagePointIterator::vtkImagePointIterator | ( | ) |
Default constructor, its use must be followed by Initialize().
vtkImagePointIterator::vtkImagePointIterator | ( | 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.
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, then progress events will provided by the algorithm if threadId is zero.
void vtkImagePointIterator::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.
|
inline |
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.
Definition at line 78 of file vtkImagePointIterator.h.
|
inline |
Move to the next position (rather than directly to the next span).
This will automatically advance to the next span if the end of the current span is reached.
Definition at line 91 of file vtkImagePointIterator.h.
|
inline |
Test if the iterator has completed iterating over the entire extent.
Definition at line 108 of file vtkImagePointIterator.h.
|
inline |
Get the current position.
Definition at line 116 of file vtkImagePointIterator.h.
|
inline |
Get the current position and place it in the provided array.
Definition at line 125 of file vtkImagePointIterator.h.
|
inline |
Get the current position and place it in the provided array.
Definition at line 137 of file vtkImagePointIterator.h.
|
inlineprotected |
Helper method to update the position coordinate from the index.
Definition at line 151 of file vtkImagePointIterator.h.
|
protected |
Definition at line 159 of file vtkImagePointIterator.h.
|
protected |
Definition at line 160 of file vtkImagePointIterator.h.
|
protected |
Definition at line 161 of file vtkImagePointIterator.h.