VTK
9.1.0
|
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... | |
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 42 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 59 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 81 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 87 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 93 of file vtkImagePointDataIterator.h.
|
inline |
Get the index at the beginning of the current span.
Definition at line 104 of file vtkImagePointDataIterator.h.
|
inline |
Get the point Id at the beginning of the current span.
Definition at line 109 of file vtkImagePointDataIterator.h.
|
inline |
Get the end of the span.
Definition at line 114 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 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 145 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 146 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 149 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 152 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 155 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 162 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.
|
protected |
Definition at line 167 of file vtkImagePointDataIterator.h.
|
protected |
Definition at line 168 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 174 of file vtkImagePointDataIterator.h.