pandore::Reg3d Class Reference

#include <region.h>

Inheritance diagram for pandore::Reg3d:

pandore::Img3d< Long > pandore::Imx3d< Long > List of all members.

Detailed Description

A 3D region map.

A region is defined as a set of connected pixels.
All the pixels of a same region have the same value (called the label, a value in [0, +4294967295])
By convention, the region with the label=0 is considered as a non region (the background).
A Reg3d region map is implemented as a 3D Ulong image where each pixel is a label (in a Ulong precision).
To create a region:

 Reg3d rgs1(100, 256, 256);
 Reg3d *rgs2 = new(rgs1.Props());
 rgs1[5][10][21]=10;

For the use of Reg3d images see The Region Maps.


Public Types

typedef Ulong ValueType

Public Member Functions

Typobj Type () const
std::string Name () const
Ulong Labels () const
Ulong Labels (Ulong n)
PobjectProps Props () const
 Reg3d ()
 Reg3d (Long d, Long h, Long w)
 Reg3d (const Dimension3d &d)
 Reg3d (const PobjectProps &p)
void New (Long d, Long h, Long w)
void New (const Dimension3d &d)
void New (const PobjectProps &p, Long *data=0)
void Delete ()
Pobject * Clone () const
ValueTypeVector () const
Reg3doperator= (const Reg3d::ValueType val)
Reg3doperator= (const Reg3d &rgs)
Band2dr operator[] (Long dep)
const Band2dr operator[] (Long dep) const
ValueTypeoperator() (Long z, Long y, Long x)
const ValueTypeoperator() (Long z, Long y, Long x) const
ValueTypeoperator[] (const Point3d &p)
const ValueTypeoperator[] (const Point3d &p) const
Errc LoadAttributes (FILE *file)
Errc SaveAttributes (FILE *file) const
Errc LoadData (FILE *file)
Errc SaveData (FILE *file) const
Pobject * Mask (const Pobject *mask)
Pobject * UnMask (const Pobject *mask, const Pobject *reference)
 Reg3d (const Reg3d &rgs)

Protected Attributes

Ulong nlabels


Member Typedef Documentation

typedef Ulong pandore::Reg3d::ValueType
 

The type of the labels (for instance Ulong).

Reimplemented from pandore::Img3d< Long >.


Constructor & Destructor Documentation

pandore::Reg3d::Reg3d  )  [inline]
 

Creates a new region map with no size and no data.

pandore::Reg3d::Reg3d Long  d,
Long  h,
Long  w
[inline]
 

Creates a new region map with the specified width, height and depth. Allocates therefrom the related data.

Warning:
the label values are not initialized with 0.
Parameters:
d the depth of the map.
h the height of the map.
w the width of the map.

pandore::Reg3d::Reg3d const Dimension3d d  )  [inline]
 

Creates a new region map with the specified dimension. Allocates therefrom the related data.

Warning:
the label values are not initialized with 0.
Parameters:
d the dimension of the map.

pandore::Reg3d::Reg3d const PobjectProps &  p  )  [inline]
 

Creates a new region map with the specified properties. Allocates therefrom the related data.

Warning:
the label values are not initialized with 0.
Parameters:
p the properties.

pandore::Reg3d::Reg3d const Reg3d rgs  )  [inline]
 

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

Parameters:
rgs the specified image.


Member Function Documentation

Pobject* pandore::Reg3d::Clone  )  const [inline, virtual]
 

Creates and returns a distinct copy of this object.

Returns:
a new region map.

Reimplemented from pandore::Img3d< Long >.

void pandore::Reg3d::Delete  )  [inline]
 

Deletes the region map data without deleting the object itself.

Reimplemented from pandore::Imx3d< Long >.

Ulong pandore::Reg3d::Labels Ulong  n  )  [inline]
 

Sets the new higher label value.

Parameters:
n the new higher label value.
Returns:
the new higher label value.

Ulong pandore::Reg3d::Labels  )  const [inline]
 

Returns the current higher label value.

Returns:
the higher label value.

Errc pandore::Reg3d::LoadAttributes FILE *  file  )  [virtual]
 

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

Parameters:
file ēthe file where to read attributes values.
Returns:
SUCCESS or FAILURE in case of IO errors.

Reimplemented from pandore::Imx3d< Long >.

Errc pandore::Reg3d::LoadData FILE *  file  )  [virtual]
 

Loads data from the given file.

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

Reimplemented from pandore::Imx3d< Long >.

Pobject* pandore::Reg3d::Mask const Pobject *  mask  )  [virtual]
 

Creates a new Reg3d where the data are masked by the given mask. It means that value 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 region map.

Reimplemented from pandore::Imx3d< Long >.

std::string pandore::Reg3d::Name  )  const [inline]
 

Returns the name of the region type (for instance Reg3d).

Returns:
the string with the name.

Reimplemented from pandore::Img3d< Long >.

void pandore::Reg3d::New const PobjectProps &  p,
Long *  data = 0
[inline]
 

Allocates the region map data from the specified properties.

Warning:
the label values are not initialized with 0.
Parameters:
p the properties of the map.

void pandore::Reg3d::New const Dimension3d d  )  [inline]
 

Allocates the region map data from the specified dimension.

Warning:
the label values are not initialized with 0.
Parameters:
d the dimension of the map.

void pandore::Reg3d::New Long  d,
Long  h,
Long  w
[inline]
 

Allocates the region map data from the specified depth, height and width.

Warning:
the label values are not initialized with 0.
Parameters:
d the depth of the map.
h the heigth of the map.
w the width of the map.

const ValueType& pandore::Reg3d::operator() Long  z,
Long  y,
Long  x
const [inline]
 

Returns the specified label at the specified coordinates. Returns the specified label at the specified coordinates.

Parameters:
z the z-coordinate.
y the y-coordinate.
x the x-coordinate.
Returns:
the label at the specified coordinates.

Reimplemented from pandore::Img3d< Long >.

ValueType& pandore::Reg3d::operator() Long  z,
Long  y,
Long  x
[inline]
 

Returns the specified label at the specified coordinates.

Parameters:
z the z-coordinate.
y the y-coordinate.
x the x-coordinate.
Returns:
the label at the specified coordinates.

Reimplemented from pandore::Img3d< Long >.

Reg3d& pandore::Reg3d::operator= const Reg3d rgs  )  [inline]
 

Sets the region map labels with the specified region map labels.

Parameters:
reg a region map.
Returns:
the region map itself.

Reg3d& pandore::Reg3d::operator= const Reg3d::ValueType  val  )  [inline]
 

Sets the labels with the given value. This also sets the higher label value with the given value.

Parameters:
val the value.
Returns:
the region map itself.

const ValueType& pandore::Reg3d::operator[] const Point3d p  )  const [inline]
 

Returns the specified label at the specified coordinates.

Parameters:
p the coordinates.
Returns:
the label at the specified coordinates.

Reimplemented from pandore::Img3d< Long >.

ValueType& pandore::Reg3d::operator[] const Point3d p  )  [inline]
 

Returns the specified label at the specified coordinates.

Parameters:
p the coordinates.
Returns:
the label at the specified coordinates.

Reimplemented from pandore::Img3d< Long >.

const Band2dr pandore::Reg3d::operator[] Long  dep  )  const [inline]
 

Returns the plane at the specified depth.

Parameters:
dep the depth.
Returns:
the plane at the specified depth.

Reimplemented from pandore::Img3d< Long >.

Band2dr pandore::Reg3d::operator[] Long  dep  )  [inline]
 

Returns the plane at the specified depth.

Parameters:
dep the depth.
Returns:
the plane at the specified depth.

Reimplemented from pandore::Img3d< Long >.

PobjectProps pandore::Reg3d::Props  )  const [inline]
 

Returns the related vector of properties.

Returns:
the vector of properties.

Reimplemented from pandore::Imx3d< Long >.

Errc pandore::Reg3d::SaveAttributes FILE *  file  )  const [virtual]
 

Saves the current attribute values.

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

Reimplemented from pandore::Imx3d< Long >.

Errc pandore::Reg3d::SaveData FILE *  file  )  const [virtual]
 

Saves data in the given file. Allocates therefrom the related data.

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

Reimplemented from pandore::Imx3d< Long >.

Typobj pandore::Reg3d::Type  )  const [inline]
 

Returns the region map identifier.

Returns:
the identifier.

Reimplemented from pandore::Img3d< Long >.

Pobject* pandore::Reg3d::UnMask const Pobject *  mask,
const Pobject *  reference
[virtual]
 

Creates a new region map where the data are ummasked by the given mask and the given reference image. It means that values are set to the value of the reference object when the related label in the mask is 0.

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

Reimplemented from pandore::Imx3d< Long >.

ValueType* pandore::Reg3d::Vector  )  const [inline]
 

Returns the region data as a vector.

Returns:
the vector of all data.

Reimplemented from pandore::Img3d< Long >.


Member Data Documentation

Ulong pandore::Reg3d::nlabels [protected]
 

The maximum label value: could be different from the number of labels if some labels are unused.


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