The Pandore objects

The Basis Class Pobject

All the Pandore objects inherit from the basis class Pobject. A Pandore object is an object that can be loaded from a file and saved in a file. Pandore distinguishes six objects divided in four basic objects and two compound objects.

The Basic Objects

There exists only 4 types of basic Pandore objects:
  1. The point (Point1d, Point2d, Point3d) represents a location in coordinate space specified in Long precision;
  2. The dimension (Dimension1d, Dimension2d, Dimension3d) encapsulates size measures specified in Long precision;
  3. The image (Imx1d, Img1d, Imx2d, Img2d, Imc2d, Imx3d, Img3d, Imc3d) is an array of pixels;
  4. The region map (Reg1d, Reg2d, Reg3d) is an array of labels.

The Compound Objects

The compound objects are composition of several base types or basic Pandore objects or even compound Pandore objects. There exists 2 types of compound objects:
  1. The collection (Collection) is a map of any base type or Pandore object referenced by a name;
  2. The graph (Graph2d, Graph3d) is a graph of indexes, where an index refers to an element in an array. Any array is available which allows to create a graph of anything: a graph of points (index refers to element in an array of points), a graph of region maps (an array of region maps), a graph of integer, etc.

The Pandore Object Types

Each Pandore object is identified by a magic number and a name. The file panfile.h contains the enumerated list Typobj of all the magic numbers. Each item in the enumerated list is built with the name of the class and the prefix Po_. For instance Po_Img2duc is set with the magic number of the object Img2duc (a 2D gray levels image of bytes) or Po_Point2d corresponds to a Point2d.

The magic number and the name are accessible from the member function:

For example:

Pobject *p = new Img2duc(122,256);
if (p->Type() == Po_Img2duc)
   std::cout << p->Name() << std::endl;

The Pandore Object Attributes

Each object is defined by its own list of attributes. For example, the class Imc2duc is defined by the dimension of the array and the color space or the class Reg2d is defined by the dimension and the higher label value. However, there exists a structure named PobjectProps which gathers all the attributes that are exchangeable between objects, such as the dimension, the number of bands, the color space, the higher label value for region maps, etc. This structure can be used to create an object with the properties of an another object.

For example, to build a region map with the same size than a given image, use:

Img2duc ims1(40,125);
Reg2d rgs(ims1.Props());

For example, to build a graph from a region map dimension and then an image from the resulted graph dimension use:

Reg2d rgs(120,256);
Graph2d *g=new Graph2d(rgs.Props());
Imc2duc ims2;

The Pandore Object member functions

A Pandore object has 4 categories of member functions:
  1. Construction of the internal representation;
  2. Data consultation;
  3. File transfer;
  4. Miscellaneous functions.

The Pandore Object Files

A Pandore object can be saved in or loaded from a normalized file (suffixed by ".pan" by pure convention). The file are composed of a common heading followed by an object specific heading and then the data.

Even if the files are binary files, loading is independent from the platform architecture. A Pandore object saved in MSB (Most Significant Bit first) platform can be loaded on LSB (Most Significant Bit first) platform and vice versa.

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