VTK  9.3.20241007
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkImagePointDataIterator Class Reference

iterate over point data in an image. More...

#include <vtkImagePointDataIterator.h>

Inheritance diagram for vtkImagePointDataIterator:
[legend]
Collaboration diagram for vtkImagePointDataIterator:
[legend]

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
 
vtkAlgorithmAlgorithm
 
vtkIdType Count
 
vtkIdType Target
 
int ThreadId
 

Detailed Description

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.

See also
vtkImageData vtkImageStencilData vtkImageProgressIterator
Tests:
vtkImagePointDataIterator (Tests)

Definition at line 34 of file vtkImagePointDataIterator.h.

Constructor & Destructor Documentation

◆ vtkImagePointDataIterator() [1/2]

vtkImagePointDataIterator::vtkImagePointDataIterator ( )

Default constructor, its use must be followed by Initialize().

◆ vtkImagePointDataIterator() [2/2]

vtkImagePointDataIterator::vtkImagePointDataIterator ( vtkImageData image,
const int  extent[6] = nullptr,
vtkImageStencilData stencil = nullptr,
vtkAlgorithm algorithm = nullptr,
int  threadId = 0 
)
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.

Member Function Documentation

◆ Initialize()

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.

◆ NextSpan()

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.

◆ IsAtEnd()

bool vtkImagePointDataIterator::IsAtEnd ( )
inline

Test if the iterator has completed iterating over the entire extent.

Definition at line 73 of file vtkImagePointDataIterator.h.

◆ IsInStencil()

bool vtkImagePointDataIterator::IsInStencil ( )
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.

◆ GetIndex() [1/2]

void vtkImagePointDataIterator::GetIndex ( int  result[3])
inline

Get the index at the beginning of the current span.

Definition at line 85 of file vtkImagePointDataIterator.h.

◆ GetIndex() [2/2]

const int * vtkImagePointDataIterator::GetIndex ( )
inline

Get the index at the beginning of the current span.

Definition at line 96 of file vtkImagePointDataIterator.h.

◆ GetId()

vtkIdType vtkImagePointDataIterator::GetId ( )
inline

Get the point Id at the beginning of the current span.

Definition at line 101 of file vtkImagePointDataIterator.h.

◆ SpanEndId()

vtkIdType vtkImagePointDataIterator::SpanEndId ( )
inline

Get the end of the span.

Definition at line 106 of file vtkImagePointDataIterator.h.

◆ GetVoidPointer() [1/2]

static void * vtkImagePointDataIterator::GetVoidPointer ( vtkImageData image,
vtkIdType  i = 0,
int *  pixelIncrement = nullptr 
)
static

Get a void pointer and pixel increment for the given point Id.

The pixel increment is the number of scalar components.

◆ GetVoidPointer() [2/2]

static void * vtkImagePointDataIterator::GetVoidPointer ( vtkDataArray array,
vtkIdType  i = 0,
int *  pixelIncrement = nullptr 
)
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.

◆ SetSpanState()

void vtkImagePointDataIterator::SetSpanState ( int  idX)
protected

Set all the state variables for the stencil span that includes idX.

◆ ReportProgress()

void vtkImagePointDataIterator::ReportProgress ( )
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.

Member Data Documentation

◆ Id

vtkIdType vtkImagePointDataIterator::Id
protected

Definition at line 134 of file vtkImagePointDataIterator.h.

◆ SpanEnd

vtkIdType vtkImagePointDataIterator::SpanEnd
protected

Definition at line 135 of file vtkImagePointDataIterator.h.

◆ RowEnd

vtkIdType vtkImagePointDataIterator::RowEnd
protected

Definition at line 136 of file vtkImagePointDataIterator.h.

◆ SliceEnd

vtkIdType vtkImagePointDataIterator::SliceEnd
protected

Definition at line 137 of file vtkImagePointDataIterator.h.

◆ End

vtkIdType vtkImagePointDataIterator::End
protected

Definition at line 138 of file vtkImagePointDataIterator.h.

◆ RowIncrement

vtkIdType vtkImagePointDataIterator::RowIncrement
protected

Definition at line 141 of file vtkImagePointDataIterator.h.

◆ SliceIncrement

vtkIdType vtkImagePointDataIterator::SliceIncrement
protected

Definition at line 142 of file vtkImagePointDataIterator.h.

◆ RowEndIncrement

vtkIdType vtkImagePointDataIterator::RowEndIncrement
protected

Definition at line 143 of file vtkImagePointDataIterator.h.

◆ SliceEndIncrement

vtkIdType vtkImagePointDataIterator::SliceEndIncrement
protected

Definition at line 144 of file vtkImagePointDataIterator.h.

◆ Extent

int vtkImagePointDataIterator::Extent[6]
protected

Definition at line 147 of file vtkImagePointDataIterator.h.

◆ Index

int vtkImagePointDataIterator::Index[3]
protected

Definition at line 150 of file vtkImagePointDataIterator.h.

◆ StartY

int vtkImagePointDataIterator::StartY
protected

Definition at line 151 of file vtkImagePointDataIterator.h.

◆ HasStencil

bool vtkImagePointDataIterator::HasStencil
protected

Definition at line 154 of file vtkImagePointDataIterator.h.

◆ InStencil

bool vtkImagePointDataIterator::InStencil
protected

Definition at line 155 of file vtkImagePointDataIterator.h.

◆ SpanSliceEndIncrement

int vtkImagePointDataIterator::SpanSliceEndIncrement
protected

Definition at line 156 of file vtkImagePointDataIterator.h.

◆ SpanSliceIncrement

int vtkImagePointDataIterator::SpanSliceIncrement
protected

Definition at line 157 of file vtkImagePointDataIterator.h.

◆ SpanIndex

int vtkImagePointDataIterator::SpanIndex
protected

Definition at line 158 of file vtkImagePointDataIterator.h.

◆ SpanCountPointer

int* vtkImagePointDataIterator::SpanCountPointer
protected

Definition at line 159 of file vtkImagePointDataIterator.h.

◆ SpanListPointer

int** vtkImagePointDataIterator::SpanListPointer
protected

Definition at line 160 of file vtkImagePointDataIterator.h.

◆ Algorithm

vtkAlgorithm* vtkImagePointDataIterator::Algorithm
protected

Definition at line 163 of file vtkImagePointDataIterator.h.

◆ Count

vtkIdType vtkImagePointDataIterator::Count
protected

Definition at line 164 of file vtkImagePointDataIterator.h.

◆ Target

vtkIdType vtkImagePointDataIterator::Target
protected

Definition at line 165 of file vtkImagePointDataIterator.h.

◆ ThreadId

int vtkImagePointDataIterator::ThreadId
protected

Definition at line 166 of file vtkImagePointDataIterator.h.


The documentation for this class was generated from the following file: