VTK
9.3.20241007
|
iterate over point data in an image. More...
#include <vtkImagePointDataIterator.h>
Public Member Functions | |
vtkImagePointDataIterator () | |
Default constructor, its use must be followed by Initialize(). | |
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. | |
void | Initialize (vtkImageData *image, const int extent[6]=nullptr, vtkImageStencilData *stencil=nullptr, vtkAlgorithm *algorithm=nullptr, int threadId=0) |
Initialize an iterator. | |
void | NextSpan () |
Move the iterator to the beginning of the next span. | |
bool | IsAtEnd () |
Test if the iterator has completed iterating over the entire extent. | |
bool | IsInStencil () |
Check if the iterator is within the region specified by the stencil. | |
const int * | GetIndex () |
Get the index at the beginning of the current span. | |
vtkIdType | GetId () |
Get the point Id at the beginning of the current span. | |
vtkIdType | SpanEndId () |
Get the end of the span. | |
void | GetIndex (int result[3]) |
Get the index at the beginning of the current span. | |
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. | |
static void * | GetVoidPointer (vtkDataArray *array, vtkIdType i=0, int *pixelIncrement=nullptr) |
Get a void pointer and pixel increment for the given point Id. | |
Protected Member Functions | |
void | SetSpanState (int idX) |
Set all the state variables for the stencil span that includes idX. | |
void | ReportProgress () |
Report the progress and do an abort check, for compatibility with existing image filters. | |
Protected Attributes | |
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 |
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 34 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 51 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 73 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 79 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 85 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 96 of file vtkImagePointDataIterator.h.
|
inline |
Get the point Id at the beginning of the current span.
Definition at line 101 of file vtkImagePointDataIterator.h.
|
inline |
Get the end of the span.
Definition at line 106 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 134 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 135 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 136 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 137 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 138 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 141 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 142 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 143 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 144 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 147 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 150 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 151 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 154 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 155 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 156 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 157 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 158 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 159 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 160 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 163 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 164 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 165 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 166 of file vtkImagePointDataIterator.h.