Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
Bial::Image< D > Class Template Reference

The Image class is used to handle N-Dimensional images, and has support to Read and Write image files. More...

#include <Adjacency.hpp>

Collaboration diagram for Bial::Image< D >:
Collaboration graph

Public Member Functions

 Image ()
 Basic Constructor. More...
 
 Image (const Vector< size_t > &spc_dim)
 Basic Constructor. Two to three dimensions. More...
 
 Image (D *new_data, const Vector< size_t > &new_dim)
 Basic Constructor. Two to four dimensions. This constructor works as a wrapper for data already allocated. It will use the same space pointed by new_data to manipulate the image. Use this for compatibility with other data structures, in a easy convertion to Image class. More...
 
 Image (const Vector< size_t > &spc_dim, const Vector< float > &pixel_size)
 Basic Constructor. More...
 
 Image (size_t spc_dim_0, size_t spc_dim_1)
 Basic Constructor for 2D image. More...
 
 Image (size_t spc_dim_0, size_t spc_dim_1, size_t spc_dim_2)
 Basic Constructor for 3D image. More...
 
 Image (const Matrix< D > &mtx)
 Basic Constructor for 3D image. More...
 
 Image (const Matrix< D > &mtx, const Vector< float > &pixel_size)
 Basic Constructor for 3D image. More...
 
template<class D2 >
 Image (const Image< D2 > &img)
 Copy constructor. More...
 
 Image (const Image< D > &img)
 Copy Constructor. More...
 
 Image (Image< D > &&img)
 Move Constructor. More...
 
 ~Image ()
 
Image< D > & operator= (const Image< D > &other)
 Assigns 'other'image to this image. More...
 
Image< D > & operator= (Image< D > &&other)
 Assigns 'other'image to this image, moving the content. More...
 
Image< D > & operator= (D scalar)
 Assigns scalar to all image pixels. More...
 
template<class D2 >
Image< D > & operator= (const Image< D2 > &other)
 Assigns 'other'image to this image. More...
 
const D & operator[] (size_t p) const
 Returns a constant reference of data pointed by index p. Same as operator()( p ). More...
 
D & operator[] (size_t p)
 Returns the reference for data pointed by index p. Same as operator()( p ). More...
 
const D & operator() (size_t p) const
 Returns constant reference of data pointed by index p. It has the same effect as operator data[ p ]. More...
 
D & operator() (size_t p)
 Returns the reference for data pointed by index p. It has the same effect as operator data[ p ]. More...
 
const D & operator() (size_t p_0, size_t p_1) const
 Returns constant reference of data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ]. More...
 
D & operator() (size_t p_0, size_t p_1)
 Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ]. More...
 
const D & operator() (size_t p_0, size_t p_1, size_t p_2) const
 Returns constant reference of data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * dim_size[ 0 ] * dim_size[ 1 ] ]. More...
 
D & operator() (size_t p_0, size_t p_1, size_t p_2)
 Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * dim_size[ 0 ] * dim_size[ 1 ] ]. More...
 
const D & operator() (const Vector< size_t > &p) const
 Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], [ p[ 2 ] ] ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + [ p_2 * dim_size[ 0 ] * dim_size[ 1 ] ] ]. More...
 
D & operator() (const Vector< size_t > &p)
 Returns a reference of data pointed by index ( p[ 0 ], p[ 1 ], [ p[ 2 ] ] ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + [ p_2 * dim_size[ 0 ] * dim_size[ 1 ] ] ]. More...
 
std::vector< D >::iterator begin () noexcept
 Returns iterator begin() of data. More...
 
std::vector< D >::const_iterator begin () const noexcept
 Returns const_iterator begin() of data Vector. More...
 
std::vector< D >::iterator end () noexcept
 Returns iterator end() of data. More...
 
std::vector< D >::const_iterator end () const noexcept
 Returns const_iterator end() of data. More...
 
std::vector< D >::reverse_iterator rbegin () noexcept
 Returns the iterator rbegin() of data Vector. More...
 
std::vector< D >::const_reverse_iterator rbegin () const noexcept
 Returns const_iterator rbegin() of data Vector. More...
 
std::vector< D >::reverse_iterator rend () noexcept
 Returns iterator rend() of data Vector. More...
 
std::vector< D >::const_reverse_iterator rend () const noexcept
 Returns const_iterator rend() of data Vector. More...
 
std::vector< D >::const_iterator cbegin () const noexcept
 Returns the iterator cbegin() of data Vector. More...
 
std::vector< D >::const_iterator cend () const noexcept
 Returns the iterator cend() of data Vector. More...
 
std::vector< D >::const_reverse_iterator crbegin () const noexcept
 Returns the iterator crbegin() of data Vector. More...
 
std::vector< D >::const_reverse_iterator crend () const noexcept
 Returns the iterator crend() of data Vector. More...
 
const Matrix< D > & DataMatrix () const
 Returns a pointer to data in Matrix. More...
 
Matrix< D > & DataMatrix ()
 Returns a pointer to data in Matrix. More...
 
const D * Data () const
 Returns a pointer to data in Matrix. More...
 
D * Data ()
 Returns a pointer to data in Matrix. More...
 
const D * data () const
 Returns a pointer to data in Matrix. More...
 
D * data ()
 Returns a pointer to data in Matrix. More...
 
size_t Size () const
 Returns the image size. More...
 
size_t size () const
 Returns the image size. Same as Size( ), just for compatibility with std containers. More...
 
size_t Coordinate (size_t position, size_t dimension) const
 Returns the coordinate of position in given dimension. More...
 
Vector< size_t > Coordinates (size_t position) const
 Returns the coordinates of the input position in this image. More...
 
size_t Position (size_t p_0, size_t p_1) const
 Returns the position corresponding to the input coordinates in this image. More...
 
size_t Position (size_t p_0, size_t p_1, size_t p_2) const
 Returns the position corresponding to the input coordinates in this image. More...
 
size_t Position (const Vector< size_t > &coordinates) const
 Returns the position corresponding to the input coordinates in this image. More...
 
size_t Position (const Vector< int > &coordinates) const
 Returns the position corresponding to the input coordinates in this image. More...
 
size_t Position (const Vector< float > &coordinates) const
 Returns the position corresponding to the input coordinates in this image. More...
 
void Set (D val)
 Sets val to each element of the entire image. More...
 
Vector< size_t > Dim () const
 Returns a Vector with image dimensions. More...
 
size_t MinDim () const
 Returns the minimum size among dimensions. More...
 
size_t MaxDim () const
 Returns the maximum size among dimensions. More...
 
size_t Size (size_t dms) const
 Returns image dimension dms. More...
 
size_t size (size_t dms) const
 Returns image dimension dms. Just for symmetry with size( ) and Size( ) functions. More...
 
size_t Dims () const
 Returns the number of dimensions of the image. More...
 
size_t Displacement (size_t dms) const
 Returns the position displacement of one unit in dimension dms. More...
 
const D & at (size_t p) const
 Reads the constant reverence of value contained at position p of data Vector. More...
 
D & at (size_t p)
 Reads the value contained at position p of data Vector and returns its reference. More...
 
const D & at (size_t p_0, size_t p_1) const
 Reads the constant reverence of value contained at position p_0, p_1 of data Vector. More...
 
D & at (size_t p_0, size_t p_1)
 Reads the value contained at position p_0, p_1 of data Vector and returns its reference. More...
 
const D & at (size_t p_0, size_t p_1, size_t p_2) const
 Reads the constant reverence of value contained at position p_0, p_1, p_2 of data Vector. More...
 
D & at (size_t p_0, size_t p_1, size_t p_2)
 Reads the value contained at position p_0, p_1, p_2 of data Vector and returns its reference. More...
 
const D & at (size_t p_0, size_t p_1, size_t p_2, size_t p_3) const
 Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3 of data Vector. More...
 
D & at (size_t p_0, size_t p_1, size_t p_2, size_t p_3)
 Reads the value contained at position p_0, p_1, p_2, p_3 of data Vector and returns its reference. More...
 
const D & at (const Vector< size_t > &p) const
 Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More...
 
D & at (const Vector< size_t > &p)
 Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ]. More...
 
Vector< float > PixelSize () const
 Returns a Vector with all pixel dimensions. More...
 
void PixelSize (const Vector< float > &val)
 Update pixel dimensions. More...
 
float PixelSize (size_t dms) const
 Returns pixel dimension dms. More...
 
void PixelSize (size_t dms, float val)
 Assigns val to pixel dimension dms. More...
 
bool ValidCoordinate (const Vector< size_t > &pxl) const
 Verifies if a given pixel coordinate is in image domain. More...
 
bool ValidCoordinate (size_t x, size_t y) const
 Verifies if a given pixel coordinate is in image domain. More...
 
bool ValidCoordinate (size_t x, size_t y, size_t z) const
 Verifies if a given pixel coordinate is in image domain. More...
 
template<class D2 >
void SetRange (D2 min, D2 max)
 Recalculate the intensity scale of the data by the following formula: img[ pxl ] = min + ( img[ pxl ] - img_min ) * ( max - min ) / ( img_max - img_min ) More...
 
Minimum () const
 Returns the minimum value in Image. More...
 
Maximum () const
 Returns the maximum value in Image. More...
 
template<class O >
void PrintPixelSize (O &os) const
 Prints image dimensions to output stream os. More...
 
template<class O >
void Print (O &os) const
 Prints image containts to output stream os. More...
 
template<class O >
void PrintDimensions (O &os) const
 Prints image dimensions to output stream os. More...
 

Protected Member Functions

void CreateTables ()
 Creates y_table and z_table with correct references to qk_data. More...
 
void DestroyTables ()
 Destroys y_table and z_table. More...
 

Protected Attributes

Matrix< D > _data
 All pixel's information here. Dimension order: space -> color. More...
 
D * qk_data
 Quick access reference for data. More...
 
Vector< float > pixel_size
 Dimensions of the pixels (dpi). Its size is the number of dimensions. More...
 
D ** y_table
 Pointer to qk_data element in the case of 2D image access by coordinates. More...
 
D *** z_table
 Pointer to y_table element in the case of 3D image access by coordinates. More...
 

Friends

template<class D2 >
class Image
 

Detailed Description

template<class D = int>
class Bial::Image< D >

The Image class is used to handle N-Dimensional images, and has support to Read and Write image files.

Definition at line 22 of file Adjacency.hpp.

Constructor & Destructor Documentation

template<class D = int>
Bial::Image< D >::Image ( )

Basic Constructor.

Date
2014/Oct/16
Parameters
none.
Returns
none.
Warning
2D image with 1 pixel.
template<class D = int>
Bial::Image< D >::Image ( const Vector< size_t > &  spc_dim)

Basic Constructor. Two to three dimensions.

Date
2013/Jun/21
Parameters
spc_dimVector with image dimensions.
Returns
none.
Warning
Zero is assigned to all elements. Pixel dimensions are set to 1.0.
template<class D = int>
Bial::Image< D >::Image ( D *  new_data,
const Vector< size_t > &  new_dim 
)

Basic Constructor. Two to four dimensions. This constructor works as a wrapper for data already allocated. It will use the same space pointed by new_data to manipulate the image. Use this for compatibility with other data structures, in a easy convertion to Image class.

Date
2015/Set/10
Parameters
new_dataPointer to data allocated elsewhere.
new_dimImage dimensions.
Returns
none.
Warning
Data is not deallocated automatcally, since it may be stored in the stack. Also, DO NOT USE this constructure in Verbose or Debug compilation mode, as it will try to access invalid memory positions. Just compile without any Verbosity or Debug flags.
template<class D = int>
Bial::Image< D >::Image ( const Vector< size_t > &  spc_dim,
const Vector< float > &  pixel_size 
)

Basic Constructor.

Date
2013/Jun/21
Parameters
spc_dimVector with image dimensions. Must be two or three.
pixel_sizearray with pixel dimensions. Must be two or three.
Returns
none.
Warning
Zero is assigned to all elements.
template<class D = int>
Bial::Image< D >::Image ( size_t  spc_dim_0,
size_t  spc_dim_1 
)

Basic Constructor for 2D image.

Date
2012/Jul/02
Parameters
spc_dim_0image dimension 0.
spc_dim_1image dimension 1.
Returns
none.
Warning
Zero is assigned to all elements. Pixel dimensions are set to 1.0.
template<class D = int>
Bial::Image< D >::Image ( size_t  spc_dim_0,
size_t  spc_dim_1,
size_t  spc_dim_2 
)

Basic Constructor for 3D image.

Date
2013/Aug/03
Parameters
spc_dim_0image dimension 0.
spc_dim_1image dimension 1.
spc_dim_2image dimension 2.
Returns
none.
Warning
Zero is assigned to all elements. Pixel dimensions are set to 1.0.
template<class D = int>
Bial::Image< D >::Image ( const Matrix< D > &  mtx)

Basic Constructor for 3D image.

Date
2013/Aug/03
Parameters
mtxData matrix.
Returns
none.
Warning
Zero is assigned to all elements. Pixel dimensions are set to 1.0.
template<class D = int>
Bial::Image< D >::Image ( const Matrix< D > &  mtx,
const Vector< float > &  pixel_size 
)

Basic Constructor for 3D image.

Date
2013/Aug/03
Parameters
mtxData matrix.
pixel_sizeDimensions of the pixels.
Returns
none.
Warning
Zero is assigned to all elements. Pixel dimensions are set to 1.0.
template<class D = int>
template<class D2 >
Bial::Image< D >::Image ( const Image< D2 > &  img)

Copy constructor.

Date
2013/Jun/27
Parameters
imgSource image to be clonned.
Returns
none.
Warning
none.
template<class D = int>
Bial::Image< D >::Image ( const Image< D > &  img)

Copy Constructor.

Date
2013/Aug/07
Version
1.0.00
Parameters
filenameFile name.
Returns
none.
Warning
none.
template<class D = int>
Bial::Image< D >::Image ( Image< D > &&  img)

Move Constructor.

Date
2014/Oct/12
Version
1.0.00
Parameters
imgOther image.
Returns
none.
Warning
none.
template<class D = int>
Bial::Image< D >::~Image ( )
inline

Definition at line 194 of file Image.hpp.

Member Function Documentation

template<class D = int>
const D& Bial::Image< D >::at ( size_t  p) const

Reads the constant reverence of value contained at position p of data Vector.

Date
2014/Apr/10
Parameters
pglobal index of the data being accessed.
Returns
Constant reverence of value contained in position p of data Vector.
Warning
Works for matrices of any dimension. Index p is a global position.
template<class D = int>
D& Bial::Image< D >::at ( size_t  p)

Reads the value contained at position p of data Vector and returns its reference.

Date
2014/Apr/10
Parameters
pglobal index of the data being accessed.
Returns
Reference to position p of data Vector.
Warning
Works for matrices of any dimension. Index p is a global position.
template<class D = int>
const D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1 
) const

Reads the constant reverence of value contained at position p_0, p_1 of data Vector.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
Returns
Constant reverence of value contained in position p_0, p_1 of data Vector.
Warning
2D image access.
template<class D = int>
D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1 
)

Reads the value contained at position p_0, p_1 of data Vector and returns its reference.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
Returns
Reference to position p_0, p_1 of data Vector.
Warning
2D image access.
template<class D = int>
const D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1,
size_t  p_2 
) const

Reads the constant reverence of value contained at position p_0, p_1, p_2 of data Vector.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
p_2third index of the data being accessed.
Returns
Constant reverence of value contained in position p_0, p_1, p_2 of data Vector.
Warning
3D image access.
template<class D = int>
D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1,
size_t  p_2 
)

Reads the value contained at position p_0, p_1, p_2 of data Vector and returns its reference.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
p_2third index of the data being accessed.
Returns
Reference to position p_0, p_1, p_2 of data Vector.
Warning
3D image access.
template<class D = int>
const D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1,
size_t  p_2,
size_t  p_3 
) const

Reads the constant reverence of value contained at position p_0, p_1, p_2, p_3 of data Vector.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
p_2third index of the data being accessed.
p_3fourth index of the data being accessed.
Returns
Constant reverence of value contained in position p_0, p_1, p_2, p_3 of data Vector.
Warning
4D image access.
template<class D = int>
D& Bial::Image< D >::at ( size_t  p_0,
size_t  p_1,
size_t  p_2,
size_t  p_3 
)

Reads the value contained at position p_0, p_1, p_2, p_3 of data Vector and returns its reference.

Date
2014/Apr/10
Parameters
p_0first index of the data being accessed.
p_1second index of the data being accessed.
p_2third index of the data being accessed.
p_3fourth index of the data being accessed.
Returns
Reference to position p_0, p_1, p_2, p_3 of data Vector.
Warning
4D image access.
template<class D = int>
const D& Bial::Image< D >::at ( const Vector< size_t > &  p) const

Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].

Date
2014/Apr/10
Parameters
pVector of indexes to be acessed.
Returns
Constant reference of data pointed by index Vector p.
Warning
none.
template<class D = int>
D& Bial::Image< D >::at ( const Vector< size_t > &  p)

Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], p[ 2 ], ... ). It has the same effect as operator data[ p_0 + p_1 * acc_dim_size[ 0 ] + p_2 * acc_dim_size[ 1 ] ... ].

Date
2014/Apr/10
Parameters
pVector of indexes to be acessed.
Returns
Constant reference of data pointed by index Vector p.
Warning
none.
template<class D = int>
std::vector< D >::iterator Bial::Image< D >::begin ( )
noexcept

Returns iterator begin() of data.

Date
2014/Apr/10
Parameters
none.
Returns
iterator begin() of data.
Warning
none.
template<class D = int>
std::vector< D >::const_iterator Bial::Image< D >::begin ( ) const
noexcept

Returns const_iterator begin() of data Vector.

Date
2014/Apr/10
Parameters
none.
Returns
const_iterator begin() of data Vector.
Warning
none.
template<class D = int>
std::vector< D >::const_iterator Bial::Image< D >::cbegin ( ) const
noexcept

Returns the iterator cbegin() of data Vector.

Date
2015/Apr/06
Parameters
none.
Returns
iterator cbegin() of data Vector.
Warning
none.
template<class D = int>
std::vector< D >::const_iterator Bial::Image< D >::cend ( ) const
noexcept

Returns the iterator cend() of data Vector.

Date
2015/Apr/06
Parameters
none.
Returns
iterator cend() of data Vector.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Coordinate ( size_t  position,
size_t  dimension 
) const

Returns the coordinate of position in given dimension.

Date
2014/Apr/10
Parameters
positionDimension index.
dimensionAn image dimension.
Returns
The coordinate of position in given dimension.
Warning
Dimensions are not checked.
template<class D = int>
Vector< size_t > Bial::Image< D >::Coordinates ( size_t  position) const

Returns the coordinates of the input position in this image.

Date
2014/Apr/10
Parameters
indexelement position.
Returns
The coordinates of the input position in this image.
Warning
Dimensions are not checked.
template<class D = int>
std::vector< D >::const_reverse_iterator Bial::Image< D >::crbegin ( ) const
noexcept

Returns the iterator crbegin() of data Vector.

Date
2015/Apr/06
Parameters
none.
Returns
iterator crbegin() of data Vector.
Warning
none.
template<class D = int>
void Bial::Image< D >::CreateTables ( )
protected

Creates y_table and z_table with correct references to qk_data.

Date
2016/Oct/30
Parameters
none.
Returns
none.
Warning
none
template<class D = int>
std::vector< D >::const_reverse_iterator Bial::Image< D >::crend ( ) const
noexcept

Returns the iterator crend() of data Vector.

Date
2015/Apr/06
Parameters
none.
Returns
iterator crend() of data Vector.
Warning
none.
template<class D = int>
const D* Bial::Image< D >::Data ( ) const

Returns a pointer to data in Matrix.

Date
2015/Mar/11
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
D* Bial::Image< D >::Data ( )

Returns a pointer to data in Matrix.

Date
2015/Mar/11
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
const D* Bial::Image< D >::data ( ) const

Returns a pointer to data in Matrix.

Date
2015/Mar/11
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
D* Bial::Image< D >::data ( )

Returns a pointer to data in Matrix.

Date
2015/Mar/11
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
const Matrix< D >& Bial::Image< D >::DataMatrix ( ) const

Returns a pointer to data in Matrix.

Date
2014/Apr/10
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
Matrix< D >& Bial::Image< D >::DataMatrix ( )

Returns a pointer to data in Matrix.

Date
2015/Feb/25
Parameters
none.
Returns
A pointer to data in Matrix.
Warning
none.
template<class D = int>
void Bial::Image< D >::DestroyTables ( )
protected

Destroys y_table and z_table.

Date
2016/Oct/30
Parameters
none.
Returns
none.
Warning
none
template<class D = int>
Vector< size_t > Bial::Image< D >::Dim ( ) const

Returns a Vector with image dimensions.

Date
2014/Apr/10
Parameters
none.
Returns
A Vector with image dimensions.
Warning
It is a copy of the dimension Vector.
template<class D = int>
size_t Bial::Image< D >::Dims ( ) const

Returns the number of dimensions of the image.

Date
2014/Apr/10
Parameters
none.
Returns
The number of dimensions of the image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Displacement ( size_t  dms) const

Returns the position displacement of one unit in dimension dms.

Date
2014/Apr/10
Parameters
dmsThe required dimension.
Returns
Position displacement of one unit in dimension dms.
Warning
none.
template<class D = int>
std::vector< D >::iterator Bial::Image< D >::end ( )
noexcept

Returns iterator end() of data.

Date
2014/Apr/10
Parameters
none.
Returns
iterator end() of data.
Warning
none.
template<class D = int>
std::vector< D >::const_iterator Bial::Image< D >::end ( ) const
noexcept

Returns const_iterator end() of data.

Date
2014/Apr/10
Parameters
none.
Returns
const_iterator end() of data.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::MaxDim ( ) const

Returns the maximum size among dimensions.

Date
2014/Apr/10
Parameters
none.
Returns
Maximum size among dimensions.
Warning
none.
template<class D = int>
D Bial::Image< D >::Maximum ( ) const

Returns the maximum value in Image.

Date
2013/Jul/16
Parameters
none.
Returns
Maximum value in Image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::MinDim ( ) const

Returns the minimum size among dimensions.

Date
2014/Apr/10
Parameters
none.
Returns
Minimum size among dimensions.
Warning
none.
template<class D = int>
D Bial::Image< D >::Minimum ( ) const

Returns the minimum value in Image.

Date
2013/Jul/16
Parameters
none.
Returns
Minimum value in Image.
Warning
none.
template<class D = int>
const D& Bial::Image< D >::operator() ( size_t  p) const

Returns constant reference of data pointed by index p. It has the same effect as operator data[ p ].

Date
2012/Jun/21
Parameters
pa global index to be acessed.
Returns
Constant reference of data pointed by index p.
Warning
Image bounds are not verified.
template<class D = int>
D& Bial::Image< D >::operator() ( size_t  p)

Returns the reference for data pointed by index p. It has the same effect as operator data[ p ].

Date
2012/Jun/21
Parameters
pa global index to be acessed.
Returns
Reference of data pointed by index p.
Warning
Image bounds are not verified.
template<class D = int>
const D& Bial::Image< D >::operator() ( size_t  p_0,
size_t  p_1 
) const

Returns constant reference of data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ].

Date
2012/Jun/21
Parameters
p_0first index to be acessed.
p_1second index to be acessed.
Returns
Constant reference of data pointed by index ( p_0, p_1 ).
Warning
Image dimensions and bounds are not verified. Designed for 2D matrices. The behavior is undefined for other dimensions.
template<class D = int>
D& Bial::Image< D >::operator() ( size_t  p_0,
size_t  p_1 
)

Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] ].

Date
2012/Jun/21
Parameters
p_0first index to be acessed.
p_1second index to be acessed.
Returns
Reference of data pointed by index ( p_0, p_1 ).
Warning
Image dimensions and bounds are not verified. Designed for 2D images. The behavior is undefined for other dimensions.
template<class D = int>
const D& Bial::Image< D >::operator() ( size_t  p_0,
size_t  p_1,
size_t  p_2 
) const

Returns constant reference of data pointed by index ( p_0, p_1, p_2 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * dim_size[ 0 ] * dim_size[ 1 ] ].

Date
2012/Jun/21
Parameters
p_0first index to be acessed.
p_1second index to be acessed.
p_2third index to be acessed.
Returns
Constant reference of data pointed by index ( p_0, p_1, p_2 ).
Warning
Image dimensions and bounds are not verified. Designed for 3D images. The behavior is undefined for other dimensions.
template<class D = int>
D& Bial::Image< D >::operator() ( size_t  p_0,
size_t  p_1,
size_t  p_2 
)

Returns the reference for data pointed by index ( p_0, p_1 ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + p_2 * dim_size[ 0 ] * dim_size[ 1 ] ].

Date
2012/Jun/21
Parameters
p_0first index to be acessed.
p_1second index to be acessed.
p_2third index to be acessed.
Returns
Reference of data pointed by index ( p_0, p_1, p_2 ).
Warning
Image dimensions and bounds are not verified. Designed for 3D images. The behavior is undefined for other dimensions.
template<class D = int>
const D& Bial::Image< D >::operator() ( const Vector< size_t > &  p) const

Returns constant reference of data pointed by index ( p[ 0 ], p[ 1 ], [ p[ 2 ] ] ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + [ p_2 * dim_size[ 0 ] * dim_size[ 1 ] ] ].

Date
2013/Jun/25
Parameters
pVector of indexes to be acessed.
Returns
Constant reference of data pointed by index Vector p.
Warning
Image dimensions and input vector bounds are not verified. Designed for 2D or 3D images.
template<class D = int>
D& Bial::Image< D >::operator() ( const Vector< size_t > &  p)

Returns a reference of data pointed by index ( p[ 0 ], p[ 1 ], [ p[ 2 ] ] ). It has the same effect as operator data[ p_0 + p_1 * dim_size[ 0 ] + [ p_2 * dim_size[ 0 ] * dim_size[ 1 ] ] ].

Date
2013/Jun/25
Parameters
pVector of indexes to be acessed.
Returns
Reference of data pointed by index Vector p.
Warning
Image dimensions and input vector bounds are not verified. Designed for 2D or 3D images.
template<class D = int>
Image< D >& Bial::Image< D >::operator= ( const Image< D > &  other)

Assigns 'other'image to this image.

Date
2014/Oct/11
Parameters
otherImage to be assigned to this.
Returns
none.
Warning
none.
template<class D = int>
Image< D >& Bial::Image< D >::operator= ( Image< D > &&  other)

Assigns 'other'image to this image, moving the content.

Date
2015/Feb/27
Parameters
otherImage to be assigned to this.
Returns
none.
Warning
none.
template<class D = int>
Image< D >& Bial::Image< D >::operator= ( scalar)

Assigns scalar to all image pixels.

Date
2015/Oct/05
Parameters
scalarScalar to be assigned.
Returns
Referente to this image.
Warning
none.
template<class D = int>
template<class D2 >
Image< D >& Bial::Image< D >::operator= ( const Image< D2 > &  other)

Assigns 'other'image to this image.

Date
2014/Oct/10
Parameters
otherImage to be assigned to this.
Returns
none.
Warning
none.
template<class D = int>
const D& Bial::Image< D >::operator[] ( size_t  p) const

Returns a constant reference of data pointed by index p. Same as operator()( p ).

Date
2014/Apr/08
Parameters
pa global index to be acessed.
Returns
Constant reference of data pointed by index p.
Warning
Image bounds are not verified.
template<class D = int>
D& Bial::Image< D >::operator[] ( size_t  p)

Returns the reference for data pointed by index p. Same as operator()( p ).

Date
2014/Apr/08
Parameters
pa global index to be acessed.
Returns
Reference of data pointed by index p.
Warning
Image bounds are not verified.
template<class D = int>
Vector< float > Bial::Image< D >::PixelSize ( ) const

Returns a Vector with all pixel dimensions.

Date
2012/Jun/21
Parameters
none.
Returns
Pixel dimensions.
Warning
It is a copy of the pixel dimension vector.
template<class D = int>
void Bial::Image< D >::PixelSize ( const Vector< float > &  val)

Update pixel dimensions.

Date
2013/Aug/09
Parameters
valnew pixel dimensions.
Returns
none.
Warning
none.
template<class D = int>
float Bial::Image< D >::PixelSize ( size_t  dms) const

Returns pixel dimension dms.

Date
2012/Jun/21
Parameters
dmsA dimension.
Returns
Pixel dimension dms.
Warning
none.
template<class D = int>
void Bial::Image< D >::PixelSize ( size_t  dms,
float  val 
)

Assigns val to pixel dimension dms.

Date
2013/Aug/09
Parameters
dmsThe required dimension.
valDimension value.
Returns
none.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Position ( size_t  p_0,
size_t  p_1 
) const

Returns the position corresponding to the input coordinates in this image.

Date
2014/Apr/10
Parameters
p_0dim 0 coordinate.
p_1dim 1 coordinate.
Returns
The position corresponding to the input coordinates in this image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Position ( size_t  p_0,
size_t  p_1,
size_t  p_2 
) const

Returns the position corresponding to the input coordinates in this image.

Date
2014/Apr/10
Parameters
p_0dim 0 coordinate.
p_1dim 1 coordinate.
p_2dim 2 coordinate.
Returns
The position corresponding to the input coordinates in this image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Position ( const Vector< size_t > &  coordinates) const

Returns the position corresponding to the input coordinates in this image.

Date
2014/Apr/10
Parameters
coordinateselement coordinates.
Returns
The position corresponding to the input coordinates in this image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Position ( const Vector< int > &  coordinates) const

Returns the position corresponding to the input coordinates in this image.

Date
2015/Jul/07
Parameters
coordinateselement coordinates.
Returns
The position corresponding to the input coordinates in this image.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Position ( const Vector< float > &  coordinates) const

Returns the position corresponding to the input coordinates in this image.

Date
2015/Jul/07
Parameters
coordinateselement coordinates.
Returns
The position corresponding to the input coordinates in this image.
Warning
none.
template<class D >
template<class O >
void Bial::Image< D >::Print ( O &  os) const

Prints image containts to output stream os.

Date
2014/Apr/14
Parameters
osan output stream.
Returns
none.
Warning
none.

Definition at line 1108 of file Image.hpp.

template<class D >
template<class O >
void Bial::Image< D >::PrintDimensions ( O &  os) const

Prints image dimensions to output stream os.

Date
2014/Apr/22
Parameters
osan output stream.
Returns
none.
Warning
none.

Definition at line 1140 of file Image.hpp.

template<class D >
template<class O >
void Bial::Image< D >::PrintPixelSize ( O &  os) const

Prints image dimensions to output stream os.

Date
2012/Jun/21
Parameters
none.
Returns
os: an output stream.
Warning
none.

Definition at line 1100 of file Image.hpp.

template<class D = int>
std::vector< D >::reverse_iterator Bial::Image< D >::rbegin ( )
noexcept

Returns the iterator rbegin() of data Vector.

Date
2014/Apr/10
Parameters
none.
Returns
iterator rbegin() of data Vector.
Warning
none.
template<class D = int>
std::vector< D >::const_reverse_iterator Bial::Image< D >::rbegin ( ) const
noexcept

Returns const_iterator rbegin() of data Vector.

Date
2014/Apr/10
Parameters
none.
Returns
const_iterator rbegin() of data Vector.
Warning
none.
template<class D = int>
std::vector< D >::reverse_iterator Bial::Image< D >::rend ( )
noexcept

Returns iterator rend() of data Vector.

Date
2014/Apr/10
Parameters
none.
Returns
iterator rend() of data Vector.
Warning
none.
template<class D = int>
std::vector< D >::const_reverse_iterator Bial::Image< D >::rend ( ) const
noexcept

Returns const_iterator rend() of data Vector.

Date
2014/Apr/10
Parameters
none.
Returns
const_iterator rend() of data Vector.
Warning
none.
template<class D = int>
void Bial::Image< D >::Set ( val)

Sets val to each element of the entire image.

Date
2014/Apr/10
Parameters
valvalue to be set to the entire image.
Returns
none.
Warning
none.
template<class D = int>
template<class D2 >
void Bial::Image< D >::SetRange ( D2  min,
D2  max 
)

Recalculate the intensity scale of the data by the following formula: img[ pxl ] = min + ( img[ pxl ] - img_min ) * ( max - min ) / ( img_max - img_min )

Date
2014/Apr/23
Parameters
minminimum value of the new intensity scale max: maximum value of the new intensity scale
Returns
none
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Size ( ) const

Returns the image size.

Date
2014/Apr/10
Parameters
none.
Returns
The image size.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::size ( ) const

Returns the image size. Same as Size( ), just for compatibility with std containers.

Date
2014/Apr/10
Parameters
none.
Returns
The image size.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::Size ( size_t  dms) const

Returns image dimension dms.

Date
2014/Apr/10
Parameters
dmsThe required dimension.
Returns
Image dimension dms.
Warning
none.
template<class D = int>
size_t Bial::Image< D >::size ( size_t  dms) const

Returns image dimension dms. Just for symmetry with size( ) and Size( ) functions.

Date
2014/Apr/10
Parameters
dmsThe required dimension.
Returns
Image dimension dms.
Warning
none.
template<class D = int>
bool Bial::Image< D >::ValidCoordinate ( const Vector< size_t > &  pxl) const

Verifies if a given pixel coordinate is in image domain.

Date
2013/Sep/26
Parameters
pxlCoordinates of a pixel.
Returns
True if coordinates are in image domain.
Warning
Does not verify pxl and image dimensions match.
template<class D = int>
bool Bial::Image< D >::ValidCoordinate ( size_t  x,
size_t  y 
) const

Verifies if a given pixel coordinate is in image domain.

Date
2014/Nov/06
Parameters
x,yCoordinates of a pixel.
Returns
True if coordinates are in image domain.
Warning
Does not verify pxl and image dimensions match.
template<class D = int>
bool Bial::Image< D >::ValidCoordinate ( size_t  x,
size_t  y,
size_t  z 
) const

Verifies if a given pixel coordinate is in image domain.

Date
2014/Nov/06
Parameters
x,y,zCoordinates of a pixel.
Returns
True if coordinates are in image domain.
Warning
Does not verify pxl and image dimensions match.

Friends And Related Function Documentation

template<class D = int>
template<class D2 >
friend class Image
friend

Definition at line 32 of file Image.hpp.

Member Data Documentation

template<class D = int>
Matrix< D > Bial::Image< D >::_data
protected

All pixel's information here. Dimension order: space -> color.

Definition at line 38 of file Image.hpp.

template<class D = int>
Vector< float > Bial::Image< D >::pixel_size
protected

Dimensions of the pixels (dpi). Its size is the number of dimensions.

Definition at line 46 of file Image.hpp.

template<class D = int>
D* Bial::Image< D >::qk_data
protected

Quick access reference for data.

Definition at line 42 of file Image.hpp.

template<class D = int>
D** Bial::Image< D >::y_table
protected

Pointer to qk_data element in the case of 2D image access by coordinates.

Definition at line 50 of file Image.hpp.

template<class D = int>
D*** Bial::Image< D >::z_table
protected

Pointer to y_table element in the case of 3D image access by coordinates.

Definition at line 54 of file Image.hpp.


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