VTK
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(). 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 intGetIndex ()
 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
 
intSpanCountPointer
 
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 45 of file vtkImagePointDataIterator.h.

Constructor & Destructor Documentation

vtkImagePointDataIterator::vtkImagePointDataIterator ( )

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

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 62 of file vtkImagePointDataIterator.h.

Member Function Documentation

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.

bool vtkImagePointDataIterator::IsAtEnd ( )
inline

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

Definition at line 88 of file vtkImagePointDataIterator.h.

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 97 of file vtkImagePointDataIterator.h.

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

Get the index at the beginning of the current span.

Definition at line 106 of file vtkImagePointDataIterator.h.

const int* vtkImagePointDataIterator::GetIndex ( )
inline

Get the index at the beginning of the current span.

Definition at line 117 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::GetId ( )
inline

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

Definition at line 125 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::SpanEndId ( )
inline

Get the end of the span.

Definition at line 133 of file vtkImagePointDataIterator.h.

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.

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.

void vtkImagePointDataIterator::SetSpanState ( int  idX)
protected

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

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

vtkIdType vtkImagePointDataIterator::Id
protected

Definition at line 169 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::SpanEnd
protected

Definition at line 170 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::RowEnd
protected

Definition at line 171 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::SliceEnd
protected

Definition at line 172 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::End
protected

Definition at line 173 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::RowIncrement
protected

Definition at line 176 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::SliceIncrement
protected

Definition at line 177 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::RowEndIncrement
protected

Definition at line 178 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::SliceEndIncrement
protected

Definition at line 179 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::Extent[6]
protected

Definition at line 182 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::Index[3]
protected

Definition at line 185 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::StartY
protected

Definition at line 186 of file vtkImagePointDataIterator.h.

bool vtkImagePointDataIterator::HasStencil
protected

Definition at line 189 of file vtkImagePointDataIterator.h.

bool vtkImagePointDataIterator::InStencil
protected

Definition at line 190 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::SpanSliceEndIncrement
protected

Definition at line 191 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::SpanSliceIncrement
protected

Definition at line 192 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::SpanIndex
protected

Definition at line 193 of file vtkImagePointDataIterator.h.

int* vtkImagePointDataIterator::SpanCountPointer
protected

Definition at line 194 of file vtkImagePointDataIterator.h.

int** vtkImagePointDataIterator::SpanListPointer
protected

Definition at line 195 of file vtkImagePointDataIterator.h.

vtkAlgorithm* vtkImagePointDataIterator::Algorithm
protected

Definition at line 198 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::Count
protected

Definition at line 199 of file vtkImagePointDataIterator.h.

vtkIdType vtkImagePointDataIterator::Target
protected

Definition at line 200 of file vtkImagePointDataIterator.h.

int vtkImagePointDataIterator::ThreadId
protected

Definition at line 201 of file vtkImagePointDataIterator.h.


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