i3dlib

Documentation

i3d::LabeledImage3d< LABEL, VOXEL > Class Template Reference

#include <regions.h>

Inheritance diagram for i3d::LabeledImage3d< LABEL, VOXEL >:

i3d::Image3d< LABEL > List of all members.

Public Member Functions

 LabeledImage3d (const Offset *off_=0, const Resolution *res_=0)
void CreateRegions (Image3d< VOXEL > &, const Neighbourhood &nb=nb3D_6)
void CreateRegionsFF (Image3d< VOXEL > &, const Neighbourhood &nb=nb3D_6)
void CreateForegroundRegionsFF (const Image3d< VOXEL > &, const Neighbourhood &nb=nb3D_6)
template<class Predicate>
void MergeComponents (LABEL comp, Predicate pred)
void MergeComponents (LABEL comp1, LABEL comp2)
template<class T>
bool Convert (Image3d< T > &img)
size_t NumberOfComponents ()
Vector3d< int > GetDisplacement () const
 get the image displacement
void SetDisplacement (const Vector3d< int > &d)
 set the image displacement

Public Attributes

ComponentInfo< VOXEL >::Container components

Detailed Description

template<class LABEL, class VOXEL>
class i3d::LabeledImage3d< LABEL, VOXEL >

class LabeledImage3d implements a labeled image


Constructor & Destructor Documentation

template<class LABEL, class VOXEL>
i3d::LabeledImage3d< LABEL, VOXEL >::LabeledImage3d ( const Offset off_ = 0,
const Resolution res_ = 0 
) [inline, explicit]

Empty image:


Member Function Documentation

template<class LABEL, class VOXEL>
void i3d::LabeledImage3d< LABEL, VOXEL >::CreateRegions ( Image3d< VOXEL > &  ,
const Neighbourhood nb = nb3D_6 
)

CreateRegions performs region labeling algorithm on an input Image3d<VOXEL> image. Size of *this LabeledImage3d will be same as of the input image. Information about regions is stored into this->components container. Neigbourhood nb is expected to be symetric. If it is not, the algorithm create symetric neigbourhood from offsets (x, y, z) of nb where (x <= 0 && y == 0 && z == 0) || (y < 0 && z == 0) || (y <= 0 && z < 0)

template<class LABEL, class VOXEL>
void i3d::LabeledImage3d< LABEL, VOXEL >::CreateRegionsFF ( Image3d< VOXEL > &  ,
const Neighbourhood nb = nb3D_6 
)

The results are same as for CreateRegions function. Different algorithm (based on FloodFill) is used. Neighbourhood nb3D_6 is imlicitly assumed

template<class LABEL, class VOXEL>
void i3d::LabeledImage3d< LABEL, VOXEL >::CreateForegroundRegionsFF ( const Image3d< VOXEL > &  ,
const Neighbourhood nb = nb3D_6 
)

If we know the background needn't be labeled we can speed up the labeling process.

template<class LABEL, class VOXEL>
template<class Predicate>
void i3d::LabeledImage3d< LABEL, VOXEL >::MergeComponents ( LABEL  comp,
Predicate  pred 
) [inline]

Component comp is merged with all components for which pred holds.

template<class LABEL, class VOXEL>
void i3d::LabeledImage3d< LABEL, VOXEL >::MergeComponents ( LABEL  comp1,
LABEL  comp2 
)

components comp1 and comp2 are merged

template<class LABEL, class VOXEL>
template<class T>
bool i3d::LabeledImage3d< LABEL, VOXEL >::Convert ( Image3d< T > &  img  )  [inline]

function converts LabeledImage3d to Image3d if it is possible (i.e number of components < max value of Image3d type) List of components is lost. Returned value indicate whether conversion was successful.

template<class LABEL, class VOXEL>
size_t i3d::LabeledImage3d< LABEL, VOXEL >::NumberOfComponents (  )  [inline]

return number of components


Member Data Documentation

template<class LABEL, class VOXEL>
ComponentInfo<VOXEL>::Container i3d::LabeledImage3d< LABEL, VOXEL >::components

container of ComponentInfo structures:


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