pandore::Reg1d Class Reference

#include <region.h>

Inheritance diagram for pandore::Reg1d:

pandore::Img1d< Long > pandore::Imx1d< Long > pandore::Imx3d< Long > List of all members.

Detailed Description

A 1D 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 Reg1d region map is implemented as a 1D Ulong image where each pixel is a label (in a Ulong precision).
To create a region:

 Reg1d rgs1(256);
 Reg1d *rgs2 = new(rgs1.Props());
 rgs1[21]=10;

For the use of Reg1d 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
 Reg1d ()
 Reg1d (Long w)
 Reg1d (const Dimension1d &d)
 Reg1d (const PobjectProps &p)
void New (Long w)
void New (const Dimension1d &d)
void New (const PobjectProps &p)
void Delete ()
Pobject * Clone () const
ValueType * Vector () const
ValueType & operator[] (Long col)
const ValueType & operator[] (Long col) const
ValueType & operator() (Long col)
const ValueType & operator() (Long col) const
ValueType & operator[] (const Point1d &p)
const ValueType & operator[] (const Point1d &p) const
Reg1d & operator= (const Reg1d::ValueType val)
Reg1d & operator= (const Reg1d &rgs)
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)
 Reg1d (const Reg1d &rgs)

Protected Attributes

Long nlabels


Member Typedef Documentation

typedef Ulong pandore::Reg1d::ValueType
 

The type of the labels (for instance Ulong).

Reimplemented from pandore::Img1d< Long >.


Constructor & Destructor Documentation

pandore::Reg1d::Reg1d (   )  [inline]
 

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

pandore::Reg1d::Reg1d (  Long  w  )  [inline]
 

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

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

pandore::Reg1d::Reg1d (  const Dimension1d &  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::Reg1d::Reg1d (  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::Reg1d::Reg1d (  const Reg1d &  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 region.


Member Function Documentation

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

Creates and returns a distinct copy of this object.

Returns:
a new region map.

Reimplemented from pandore::Img1d< Long >.

void pandore::Reg1d::Delete (   )  [inline]
 

Deletes the region map data without deleting the object itself.

Reimplemented from pandore::Imx3d< Long >.

Ulong pandore::Reg1d::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::Reg1d::Labels (   )  const [inline]
 

Returns the current higher label value.

Returns:
the total label.

Errc pandore::Reg1d::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::Imx1d< Long >.

Errc pandore::Reg1d::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::Reg1d::Mask (  const Pobject *  mask  )  [virtual]
 

Creates a new Pobject of the same type but 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::Imx1d< Long >.

std::string pandore::Reg1d::Name (   )  const [inline]
 

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

Returns:
the string with the name.

Reimplemented from pandore::Img1d< Long >.

void pandore::Reg1d::New (  const PobjectProps &  p  )  [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::Reg1d::New (  const Dimension1d &  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::Reg1d::New (  Long  w  )  [inline]
 

Allocates the region map data from the specified width.

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

const ValueType& pandore::Reg1d::operator() (  Long  col  )  const [inline]
 

Returns the specified label at the specified coordinates.

Parameters:
col the column number.
Returns:
the label at the specified coordinate.

ValueType& pandore::Reg1d::operator() (  Long  col  )  [inline]
 

Returns the specified label at the specified coordinates.

Parameters:
col the column number.
Returns:
the label at the specified coordinate.

Reimplemented from pandore::Img1d< Long >.

Reg1d& pandore::Reg1d::operator= (  const Reg1d &  rgs  )  [inline]
 

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

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

Reg1d& pandore::Reg1d::operator= (  const Reg1d::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::Reg1d::operator[] (  const Point1d &  p  )  const [inline]
 

Returns the specified label at the specified coordinates.

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

Reimplemented from pandore::Img1d< Long >.

ValueType& pandore::Reg1d::operator[] (  const Point1d &  p  )  [inline]
 

Returns the specified label at the specified coordinates.

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

Reimplemented from pandore::Img1d< Long >.

const ValueType& pandore::Reg1d::operator[] (  Long  col  )  const [inline]
 

Returns the specified label at the specified column.

Parameters:
col the column number.
Returns:
the label at the specified coordinate.

Reimplemented from pandore::Img1d< Long >.

ValueType& pandore::Reg1d::operator[] (  Long  col  )  [inline]
 

Returns the specified label at the specified column.

Parameters:
col the column number.
Returns:
the label at the specified coordinate.

Reimplemented from pandore::Img1d< Long >.

PobjectProps pandore::Reg1d::Props (   )  const [inline]
 

Returns the related vector of properties.

Returns:
the vector of properties.

Reimplemented from pandore::Imx3d< Long >.

Errc pandore::Reg1d::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::Imx1d< Long >.

Errc pandore::Reg1d::SaveData (  FILE *  file  )  const [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 from pandore::Imx3d< Long >.

Typobj pandore::Reg1d::Type (   )  const [inline]
 

Returns the region map identifier.

Returns:
the identifier.

Reimplemented from pandore::Img1d< Long >.

Pobject* pandore::Reg1d::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::Imx1d< Long >.

ValueType* pandore::Reg1d::Vector (   )  const [inline]
 

Returns the region data as a vector.

Returns:
the vector of all data.

Reimplemented from pandore::Img1d< Long >.


Member Data Documentation

Long pandore::Reg1d::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