pandore::Imx3d< T > Class Template Reference

#include <image.h>

Inheritance diagram for pandore::Imx3d< T >:

pandore::Imc3d< T > pandore::Img3d< T > pandore::Imx1d< T > pandore::Imx2d< T > pandore::Img1d< T > pandore::Imc2d< T > pandore::Img2d< T > List of all members.

Detailed Description

template<typename T>
class pandore::Imx3d< T >

The 3D multispectral image.

A Imx3d is a multispectral 3D image. It is implemented as n 3D arrays of pixels, where a pixel is of T type and n is the band number. This class is the base class of all other image classes, it means that other image classes are only rewriting of this class. For example, a Img2duc is an image with one band and one plane for the depth dimension.
For the use of Imx3d images see The Images.


Public Types

typedef T ValueType

Public Member Functions

Typobj Type () const
std::string Name () const
Long Width () const
Long Height () const
Long Depth () const
Long Bands () const
Dimension3d Size () const
Ulong VectorSize () const
PobjectProps Props () const
 Imx3d ()
 Imx3d (Long b, Long d, Long h, Long w, T *data=0, bool isOwner=false)
 Imx3d (Long b, const Dimension3d &d, T *data=0, bool isOwner=false)
 Imx3d (const PobjectProps &p, T *data=0, bool isOwner=false)
 Imx3d (const Imx3d &ims)
void New (Long b, Long d, Long h, Long w, T *data=0, bool isOwner=false)
void New (Long b, const Dimension3d &d, T *data=0)
virtual void New (const PobjectProps &p, T *data=0, bool isOwner=false)
void Delete ()
virtual Pobject * Clone () const
Imx3d< T > & operator= (const T val)
template<typename U>
Imx3d< T > & operator= (const Imx3d< U > &src)
Imx3d< T > & operator= (const Imx3d< T > &src)
T * Vector (Long band=0) const
Band3d operator[] (Long band)
const Band3d operator[] (Long band) const
T & operator() (Long b, Long z, Long y, Long x)
const T & operator() (Long b, Long z, Long y, Long x) const
T & operator() (Long b, Point3d &p)
const T & operator() (Long b, Point3d &p) const
virtual Errc LoadAttributes (FILE *file)
virtual Errc SaveAttributes (FILE *file) const
virtual Errc LoadData (FILE *file)
virtual Errc SaveData (FILE *file) const
virtual Pobject * Mask (const Pobject *mask)
virtual Pobject * UnMask (const Pobject *mask, const Pobject *reference)
PColorSpace ColorSpace () const
PColorSpace ColorSpace (PColorSpace e)
bool Hold (Long z, Long y, Long x) const
bool Hold (const Point3d &pt) const
Errc Frame (ValueType val, Long d, Long h, Long l)
Errc Frame (ValueType v, Long d)
template<typename U>
Errc Frame (const Imx3d< U > &ims, Long d)
template<typename U>
Errc Frame (const Imx3d< U > &ims, Long d, Long h, Long l)

Protected Attributes

T * _data
bool _isDataOwner
Long nbands
Long ncol
Long nrow
Long ndep
Long matrixSize
Long volumeSize

Classes

class  Band1d
 The 1D image data. More...
class  Band2d
 The 2D image data. More...
class  Band3d
 The 3D image data. More...


Member Typedef Documentation

template<typename T>
typedef T pandore::Imx3d< T >::ValueType
 

The type of the data (Uchar, Long or Float).

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.


Constructor & Destructor Documentation

template<typename T>
pandore::Imx3d< T >::Imx3d  )  [inline]
 

Creates a new image with no size and no data.

template<typename T>
pandore::Imx3d< T >::Imx3d Long  b,
Long  d,
Long  h,
Long  w,
T *  data = 0,
bool  isOwner = false
[inline]
 

Creates a new image with the specified dimensions, and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the depth of the image.
h the height of the image.
w the width of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx3d< T >::Imx3d Long  b,
const Dimension3d d,
T *  data = 0,
bool  isOwner = false
[inline]
 

Creates a new image with the specified dimensions, and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the dimension of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx3d< T >::Imx3d const PobjectProps &  p,
T *  data = 0,
bool  isOwner = false
[inline]
 

Creates a new image with the specified properties. Allocates therefrom the related data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Warning:
the pixel values are not initialized with 0.
Parameters:
p the properties.
data the vector of data.
isOwner is the image responsible for deleting the data.

template<typename T>
pandore::Imx3d< T >::Imx3d const Imx3d< T > &  ims  )  [inline]
 

Creates the image content by copy. Allocates the related data and sets the values with the ims values. If needed casts the values by using the C casting.

Parameters:
ims the specified image.


Member Function Documentation

template<typename T>
Long pandore::Imx3d< T >::Bands  )  const [inline]
 

Returns the number of bands.

template<typename T>
virtual Pobject* pandore::Imx3d< T >::Clone  )  const [inline, virtual]
 

Creates and returns a distinct copy of this object.

Returns:
a new image.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
PColorSpace pandore::Imx3d< T >::ColorSpace PColorSpace  e  )  [inline]
 

Sets the current colorspace of the color image with the specified value.

Parameters:
e the new colorspace.

template<typename T>
PColorSpace pandore::Imx3d< T >::ColorSpace  )  const [inline]
 

Returns the current colorspace of the color image.

template<typename T>
void pandore::Imx3d< T >::Delete  )  [inline]
 

Deletes the image data without deleting the image itself.

Reimplemented in pandore::Reg1d, pandore::Reg2d, and pandore::Reg3d.

template<typename T>
Long pandore::Imx3d< T >::Depth  )  const [inline]
 

Returns the number of planes.

template<typename T>
template<typename U>
Errc pandore::Imx3d< T >::Frame const Imx3d< U > &  ims,
Long  d,
Long  h,
Long  l
[inline]
 

Fills the specified border of the image with the related values of the specified image.

Parameters:
ims the reference image.
d the depth of the border.
h the height of the border.
l the width of the border.

template<typename T>
template<typename U>
Errc pandore::Imx3d< T >::Frame const Imx3d< U > &  ims,
Long  d
[inline]
 

Fills the specified border of the image with the related values of the specified image.

Parameters:
ims the reference image.
d the depth, height and width of the border.

template<typename T>
Errc pandore::Imx3d< T >::Frame ValueType  v,
Long  d
[inline]
 

Fills the specified border of the image with the specified value.

Parameters:
v the value.
d the height, width and depth of the border.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
Errc pandore::Imx3d< T >::Frame ValueType  val,
Long  d,
Long  h,
Long  l
[inline]
 

Fills the specified border of the image with the specified value.

Parameters:
val the value.
d the depth of the border.
h the height of the border.
l the width of the border.

template<typename T>
Long pandore::Imx3d< T >::Height  )  const [inline]
 

Returns the number of rows.

template<typename T>
bool pandore::Imx3d< T >::Hold const Point3d pt  )  const [inline]
 

Checks if the image contains the point.

Parameters:
pt the point.
Returns:
true if the point is in the image boundary.

template<typename T>
bool pandore::Imx3d< T >::Hold Long  z,
Long  y,
Long  x
const [inline]
 

Checks if the image contains the point at the specified location (x, y).

Parameters:
x the column coordinate.
y the row coordinate.
z the plane coordinate.
Returns:
true if the coordinate are in the image boundary.

template<typename T>
virtual Errc pandore::Imx3d< T >::LoadAttributes FILE *  file  )  [inline, virtual]
 

Loads attribute values from the given file. Allocates therefrom the related data.

Warning:
the pixel values are not initialized with 0.
Parameters:
file the file where to read attributes values.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
virtual Errc pandore::Imx3d< T >::LoadData FILE *  file  )  [inline, virtual]
 

Loads data from the given file. Allocates therefrom the related data.

Warning:
the pixel values are not initialized with 0.
Parameters:
file the file where to read data.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented in pandore::Reg1d, pandore::Reg2d, and pandore::Reg3d.

template<typename T>
virtual Pobject* pandore::Imx3d< T >::Mask const Pobject *  mask  )  [inline, virtual]
 

Masks the data from the given mask. It means that pixels are set to 0 when the related label in the mask is 0.

Parameters:
mask the region map that is used as a mask.
Returns:
a new image.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
std::string pandore::Imx3d< T >::Name  )  const [inline]
 

Returns the type name (for instance Imx3duc or Imx3dsl or Imx3dsf).

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
virtual void pandore::Imx3d< T >::New const PobjectProps &  p,
T *  data = 0,
bool  isOwner = false
[inline, virtual]
 

Allocates the image data from the specified properties. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
p the properties of the image.
data the vector of data.
isOwner is the image responsible for deleting the data.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
void pandore::Imx3d< T >::New Long  b,
const Dimension3d d,
T *  data = 0
[inline]
 

Allocates the image data from the specified band number and dimensions and the specified data. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the dimension of the image.
data the vector of data.

template<typename T>
void pandore::Imx3d< T >::New Long  b,
Long  d,
Long  h,
Long  w,
T *  data = 0,
bool  isOwner = false
[inline]
 

Allocates the image data from the specified band number, depth, height and width values. If data=0 then data are allocated and freed by the image else data are allocated and freed externally.

Parameters:
b the number of bands of the image.
d the depth of the image.
h the heigth of the image.
w the width of the image.
data the vector of data (if any).
isOwner is the image responsible for deleting the data.

Reimplemented in pandore::Imc3d< T >.

template<typename T>
const T& pandore::Imx3d< T >::operator() Long  b,
Point3d p
const [inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
p point3d.

template<typename T>
T& pandore::Imx3d< T >::operator() Long  b,
Point3d p
[inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
p point3d.

template<typename T>
const T& pandore::Imx3d< T >::operator() Long  b,
Long  z,
Long  y,
Long  x
const [inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
z the z-coordinate.
y the y-coordinate.
x the x-coordinate.

template<typename T>
T& pandore::Imx3d< T >::operator() Long  b,
Long  z,
Long  y,
Long  x
[inline]
 

Returns the pixel value at the specified coordinates.

Parameters:
b the band.
z the z-coordinate.
y the y-coordinate.
x the x-coordinate.

template<typename T>
Imx3d< T >& pandore::Imx3d< T >::operator= const Imx3d< T > &  src  )  [inline]
 

Sets the pixel values with the pixel values of the given image. This supposes that images have the same dimensions.

Parameters:
src the given image.
Returns:
the image itself.

template<typename T>
template<typename U>
Imx3d< T >& pandore::Imx3d< T >::operator= const Imx3d< U > &  src  )  [inline]
 

Sets the pixel values with the pixel values of the given image. This supposes that the two images have the same dimensions.

Parameters:
src the given image.
Returns:
the image itself.

template<typename T>
Imx3d< T >& pandore::Imx3d< T >::operator= const T  val  )  [inline]
 

Sets all pixels with the given value.

Parameters:
val the given value.
Returns:
the image itself.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
const Band3d pandore::Imx3d< T >::operator[] Long  band  )  const [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
Band3d pandore::Imx3d< T >::operator[] Long  band  )  [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
PobjectProps pandore::Imx3d< T >::Props  )  const [inline]
 

Returns the related vector of properties.

Returns:
the vector of properties.

Reimplemented in pandore::Reg1d, pandore::Reg2d, and pandore::Reg3d.

template<typename T>
virtual Errc pandore::Imx3d< T >::SaveAttributes FILE *  file  )  const [inline, virtual]
 

Saves the current attribute values in the specified file.

Parameters:
file the file.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
virtual Errc pandore::Imx3d< T >::SaveData FILE *  file  )  const [inline, virtual]
 

Saves data in the given file.

Parameters:
file the file where to save data.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented in pandore::Reg1d, pandore::Reg2d, and pandore::Reg3d.

template<typename T>
Dimension3d pandore::Imx3d< T >::Size  )  const [inline]
 

Returns the dimension of the image.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
Typobj pandore::Imx3d< T >::Type  )  const [inline]
 

Returns the identifier of the object (ie. the magic number).

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Img1d< T >, pandore::Img2d< T >, pandore::Img3d< T >, pandore::Imc2d< T >, pandore::Imc3d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, pandore::Imx1d< Long >, pandore::Img1d< Long >, pandore::Img2d< Long >, and pandore::Img3d< Long >.

template<typename T>
virtual Pobject* pandore::Imx3d< T >::UnMask const Pobject *  mask,
const Pobject *  reference
[inline, virtual]
 

Unmasks the data from the given mask. It means that pixels are set to the pixel value of the reference image when the related label in the mask is 0.

Parameters:
mask the region map that is used as a mask.
reference the image that is used as a reference.
Returns:
a new image.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Reg1d, pandore::Reg2d, pandore::Reg3d, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
T* pandore::Imx3d< T >::Vector Long  band = 0  )  const [inline]
 

Returns the specified band of the image data as a unique vector.

Parameters:
band the band number.

Reimplemented in pandore::Imx2d< T >, pandore::Imx1d< T >, pandore::Imx2d< Long >, and pandore::Imx1d< Long >.

template<typename T>
Ulong pandore::Imx3d< T >::VectorSize  )  const [inline]
 

Returns the number of pixels in the image.

template<typename T>
Long pandore::Imx3d< T >::Width  )  const [inline]
 

Returns the number of columns.


Member Data Documentation

template<typename T>
T* pandore::Imx3d< T >::_data [protected]
 

The memory block for data.

template<typename T>
bool pandore::Imx3d< T >::_isDataOwner [protected]
 

Specifies if the data has been created by the image.

template<typename T>
Long pandore::Imx3d< T >::matrixSize [protected]
 

The matrix size

template<typename T>
Long pandore::Imx3d< T >::nbands [protected]
 

The number of bands.

template<typename T>
Long pandore::Imx3d< T >::ncol [protected]
 

The number of columns.

template<typename T>
Long pandore::Imx3d< T >::ndep [protected]
 

The number of planes.

template<typename T>
Long pandore::Imx3d< T >::nrow [protected]
 

The number of rows.

template<typename T>
Long pandore::Imx3d< T >::volumeSize [protected]
 

The voloume size


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

The Pantheon project
Image Team GREYC Laboratory
UMR CNRS 6072 - ENSICAEN - University of Caen, France
This page was last modified on 19 June 2015