ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
#include <itkShapedNeighborhoodIterator.h>
A neighborhood iterator which can take on an arbitrary shape.
typedef Image<float, 3> ImageType; ShapedNeighborhoodIterator<ImageType> it(radius, image, region); ShapedNeighborhoodIterator<ImageType>::OffsetType offset = {{0,0,0}}; it.ActivateOffset(offset);
where radius, image, and region are as described in NeighborhoodIterator.
Once a neighborhood location has been activated, iteration (operator++, operator--, operator+=, operator-=) will update the value at the active location. Note that values at inactive locations will NOT be valid if queried.
A second way to access active shaped neighborhood values is through a ShapedNeighborhoodIterator::Iterator or ConstShapedNeighborhoodIterator::ConstIterator. The following example demonstrates the use of these iterators.
typedef Image<float, 3> ImageType; ShapedNeighborhoodIterator<ImageType> it(radius, image, region); . . . it.ActivateOffset(offset1); it.ActivateOffset(offset2); it.ActivateOffset(offset3); etc.. . . . ShapedNeighborhoodIterator<ImageType>::Iterator i; for (i = it.Begin(); ! i.IsAtEnd(); i++) { i.Set(i.Get() + 1.0); } \\ you may also use i != i.End(), but IsAtEnd() may be slightly faster.
You can also iterate backward through the neighbohood active list.
i = it.End();
i--;
while (i != it.Begin())
{
i.Set(i.Get() + 1.0);
i--;
}
i.Set(i.Get() + 1.0);
The Get() Set() syntax was chosen versus defining operator* for these iterators because lvalue vs. rvalue context information is needed to determine whether bounds checking must take place.
Definition at line 152 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::BoundaryConditionType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::BoundaryConditionType |
Typedef for boundary condition type.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 176 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::ConstIterator itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ConstIterator |
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 174 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::ImageBoundaryConditionPointerType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ImageBoundaryConditionPointerType |
Typedef for generic boundary condition pointer
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 177 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::ImageType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ImageType |
Typedef support for common objects
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 180 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::IndexListType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::IndexListType |
An stl storage container type that can be sorted. The type used for the list of active offsets in the neighborhood.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 175 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::IndexType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::IndexType |
Typedef support for common objects
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 179 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::IndexValueType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::IndexValueType |
Typedef support for common objects
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 182 of file itkShapedNeighborhoodIterator.h.
typedef TImage::InternalPixelType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::InternalPixelType |
Extract image type information.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 157 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::NeighborhoodType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::NeighborhoodType |
Typedef support for common objects
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 178 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::NeighborIndexType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::NeighborIndexType [protected] |
Type used to refer to the elements in the list of neighbor pixels.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 272 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::OffsetType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::OffsetType |
Inherit typedefs from superclass
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 169 of file itkShapedNeighborhoodIterator.h.
typedef OffsetType::OffsetValueType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::OffsetValueType |
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 170 of file itkShapedNeighborhoodIterator.h.
typedef TImage::PixelType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::PixelType |
External support for pixel type.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 158 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::RadiusType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::RadiusType |
Radius typedef support.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 171 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::RegionType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::RegionType |
Typedef support for common objects
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 181 of file itkShapedNeighborhoodIterator.h.
typedef ShapedNeighborhoodIterator itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::Self |
Standard class typedefs.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 164 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::SizeType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::SizeType |
Size and value typedef support.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 172 of file itkShapedNeighborhoodIterator.h.
typedef Superclass::SizeValueType itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::SizeValueType |
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 173 of file itkShapedNeighborhoodIterator.h.
typedef ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition > itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::Superclass |
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 166 of file itkShapedNeighborhoodIterator.h.
itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ShapedNeighborhoodIterator | ( | ) | [inline] |
Default constructor
Definition at line 203 of file itkShapedNeighborhoodIterator.h.
virtual itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::~ShapedNeighborhoodIterator | ( | ) | [inline, virtual] |
Virtual destructor
Definition at line 212 of file itkShapedNeighborhoodIterator.h.
itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ShapedNeighborhoodIterator | ( | const SizeType & | radius, |
const ImageType * | ptr, | ||
const RegionType & | region | ||
) | [inline] |
Constructor which establishes the region size, neighborhood, and image over which to walk.
Definition at line 216 of file itkShapedNeighborhoodIterator.h.
itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ShapedNeighborhoodIterator | ( | const ShapedNeighborhoodIterator< TImage, TBoundaryCondition > & | o | ) | [protected] |
Copy constructor
void itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ActivateIndex | ( | NeighborIndexType | ) | [inline, protected, virtual] |
Class is protected here so that it is not publicly accessible, but can be accessed by subclasses.. Add/Remove a neighborhood index to/from the active. Locations in the active list are the only accessible elements in the neighborhood. The argument is an index location calculated as an offset into a linear array which represents the image region defined by the radius of this iterator, with the smallest dimension as the fastest increasing index.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 274 of file itkShapedNeighborhoodIterator.h.
Iterator& itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::Begin | ( | void | ) | [inline] |
Returns a const iterator for the neighborhood which points to the first pixel in the neighborhood.
Reimplemented from itk::Neighborhood< TImage::InternalPixelType *, TImage::ImageDimension >.
Definition at line 250 of file itkShapedNeighborhoodIterator.h.
void itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::ClearActiveList | ( | ) | [inline, virtual] |
Removes all active pixels from this neighborhood.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 259 of file itkShapedNeighborhoodIterator.h.
void itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::DeactivateIndex | ( | NeighborIndexType | n | ) | [inline, protected, virtual] |
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 281 of file itkShapedNeighborhoodIterator.h.
Iterator& itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::End | ( | void | ) | [inline] |
Returns a const iterator for the neighborhood which points to the first pixel in the neighborhood.
Reimplemented from itk::Neighborhood< TImage::InternalPixelType *, TImage::ImageDimension >.
Definition at line 251 of file itkShapedNeighborhoodIterator.h.
const ConstIterator& itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::End | ( | void | ) | const [inline] |
Returns a const iterator for the neighborhood which points to the last pixel in the neighborhood.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 256 of file itkShapedNeighborhoodIterator.h.
Self& itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::operator= | ( | const Self & | orig | ) | [inline] |
Assignment operator
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 235 of file itkShapedNeighborhoodIterator.h.
virtual void itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::PrintSelf | ( | std::ostream & | , |
Indent | |||
) | const [virtual] |
Standard itk print method
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
const unsigned int itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::Dimension = TImage::ImageDimension [static] |
Save the image dimension.
Reimplemented from itk::ConstShapedNeighborhoodIterator< TImage, TBoundaryCondition >.
Definition at line 161 of file itkShapedNeighborhoodIterator.h.
Iterator itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::m_BeginIterator [protected] |
Definition at line 289 of file itkShapedNeighborhoodIterator.h.
Iterator itk::ShapedNeighborhoodIterator< TImage, TBoundaryCondition >::m_EndIterator [protected] |
Definition at line 288 of file itkShapedNeighborhoodIterator.h.