| IOLink 1.11.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
iolink::RegionX< T > Class Template Referencefinal

A Region using dynamic vectors. More...

`#include <iolink/RegionX.h>`

## Public Types
using | VectorType = VectorX< T >
using | SizeType = VectorX< T >

## Public Member Functions
| RegionX (size_t dimension)
| Creates an empty region.
| RegionX (const RegionX &region)=default
| copy constructor
RegionX & | operator= (const RegionX &other)=default
| RegionX (RegionX &&region) noexcept=default
| move constructor
RegionX & | operator= (RegionX &&other) noexcept=default
| RegionX (const VectorType &origin, const SizeType &size)
| Builds a region from its origin and size.
size_t | dimensionCount () const
| The dimension of this region.
const VectorType & | origin () const
| Returns the position of the region's origin.
const SizeType & | size () const
| Returns the region's size.
VectorType | min () const
| Returns the minimal point of the region.
VectorType | max () const
| Return the maximal point of the region.
size_t | elementCount () const
| Returns the number of cells in this region.
bool | isEmpty () const
| Checks if the region is empty.
bool | contains (const RegionX &other) const
| Checks if this region conatins another.
bool | contains (const VectorType &position) const
| Checks if this region contains a point.
bool | intersect (const RegionX &other) const
| Checks if this region intersect another.
RegionX | intersection (const RegionX &other) const
| Returns the intersection of this region and another.
RegionX | extractSliceFromAxis (size_t dimension, T origin) const
| Returns a region of size one along one axis.
bool | operator== (const RegionX &other) const
bool | operator!= (const RegionX &other) const
std::string | toString () const
| Return a string representation.

## Static Public Member Functions
static RegionX | fromIndex (const VectorX< T > &index)
static RegionX | createFullRegion (const SizeType &regionSize)
| Utility factory that create the region of origin [0, 0, 0] and given size.

## Detailed Description

template<typename T>
class iolink::RegionX< T >

A Region using dynamic vectors.

Examples
  CheckerBoardFast.cpp, DiskImageView.cpp, copyImageView.cpp, customImageView.cpp, gradientFloatImage.cpp, gradientFloatToInt.cpp, and volumeFromStack.cpp.

## Constructor & Destructor Documentation

## ◆ RegionX()

template<typename T >

iolink::RegionX< T >::RegionX | ( | size_t | dimension | ) |
| explicit

Creates an empty region.

Parameters

  dimension | The dimension of the region.

## Member Function Documentation

## ◆ contains() [1/2]

template<typename T >

bool iolink::RegionX< T >::contains | ( | const RegionX< T > & | other | ) | const

Checks if this region conatins another.

Exceptions

  InvalidArgument | if region don't have compatible dimensions

Examples
  customImageView.cpp.

## ◆ contains() [2/2]

template<typename T >

bool iolink::RegionX< T >::contains | ( | const VectorType & | position | ) | const

Checks if this region contains a point.

Exceptions

  InvalidArgument | if region don't have compatible dimensions

## ◆ elementCount()

template<typename T >

size_t iolink::RegionX< T >::elementCount | ( |  | ) | const

Returns the number of cells in this region.

Only applicable to integer typed regions. It will return 0 for floating point regions.

Examples
  CheckerBoardFast.cpp, copyImageView.cpp, customImageView.cpp, gradientFloatImage.cpp, and gradientFloatToInt.cpp.

## ◆ extractSliceFromAxis()

template<typename T >

RegionX iolink::RegionX< T >::extractSliceFromAxis | ( | size_t | dimension,
|  | T | origin
| ) |  | const

Returns a region of size one along one axis.

Parameters

  dimension | axis on which the slice must be selected
  origin | position of slice in given dimension

Returns
  the slice at given position for given dimension

Exceptions

  InvalidArgument | if dimension or origin are out of range

e.g. a 3D region {{0, 0, 0}, {5, 6, 7}}

- extractSliceFromAxis(0, 3) returns 3D region {{3, 0, 0}, {1, 6, 7}}
- extractSliceFromAxis(1, 4) returns 3D region {{0, 4, 0}, {5, 1, 7}}
- extractSliceFromAxis(2, 5) returns 3D region {{0, 0, 5}, {5, 6, 1}}

e.g. a 3D region with non-null origin { {2, 3, 4}, {5, 6, 7}}

extractSliceFromAxis(0, 3) returns 3D region {{5, 3, 4}, {1, 6, 7}}

## ◆ intersect()

template<typename T >

bool iolink::RegionX< T >::intersect | ( | const RegionX< T > & | other | ) | const

Checks if this region intersect another.

Exceptions

  InvalidArgument | if region don't have compatible dimensions

## ◆ intersection()

template<typename T >

RegionX iolink::RegionX< T >::intersection | ( | const RegionX< T > & | other | ) | const

Returns the intersection of this region and another.

If regions does not intersect, it returns an empty region.

Exceptions

  InvalidArgument | if region don't have compatible dimensions

## ◆ isEmpty()

template<typename T >

bool iolink::RegionX< T >::isEmpty | ( |  | ) | const

Checks if the region is empty.

An integer typed region is empty if one of its sizes is 0. A floating point region is empty is one of its sizes is Nan.

## ◆ min()

template<typename T >

VectorType iolink::RegionX< T >::min | ( |  | ) | const

Returns the minimal point of the region.

Alias for origin.

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

- iolink/public/include/iolink/RegionX.h