OpenWalnut  1.4.0
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Static Private Member Functions
WDataSetSegmentation Class Reference

A dataset that stores the segmentation of the brain into CSF, white and gray matter. More...

#include <WDataSetSegmentation.h>

+ Inheritance diagram for WDataSetSegmentation:

List of all members.

Public Types

enum  matterType { whiteMatter = 0, grayMatter = 1, csf = 2 }
 Enumerator for the three different classification types. More...

Public Member Functions

 WDataSetSegmentation (boost::shared_ptr< WValueSetBase > segmentation, boost::shared_ptr< WGrid > grid)
 Constructs an instance out of a value set and a grid.
 WDataSetSegmentation (boost::shared_ptr< WDataSetScalar > whiteMatter, boost::shared_ptr< WDataSetScalar > grayMatter, boost::shared_ptr< WDataSetScalar > cerebrospinalFluid)
 Constructs an instance out of three WDataSetScalar.
 WDataSetSegmentation ()
 Construct an empty and unusable instance.
virtual ~WDataSetSegmentation ()
 Destroys this DataSet instance.
float getWMProbability (int x, int y, int z) const
 Returns the white matter probability for the given cell.
float getGMProbability (int x, int y, int z) const
 Returns the gray matter probability for the given cell.
float getCSFProbability (int x, int y, int z) const
 Returns the cerebrospinal fluid probability for the given cell.
virtual const std::string getName () const
 Gets the name of this prototype.
virtual const std::string getDescription () const
 Gets the description for this prototype.
virtual WDataSetSingle::SPtr clone (boost::shared_ptr< WValueSetBase > newValueSet) const
 Creates a copy (clone) of this instance but allows one to change the valueset.
virtual WDataSetSingle::SPtr clone (boost::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows one to change the grid.
virtual WDataSetSingle::SPtr clone () const
 Creates a copy (clone) of this instance.

Static Public Member Functions

static boost::shared_ptr
< WPrototyped
getPrototype ()
 Returns a prototype instantiated with the true type of the deriving class.

Static Protected Attributes

static boost::shared_ptr
< WPrototyped
m_prototype = boost::shared_ptr< WPrototyped >()
 The prototype as singleton.

Static Private Member Functions

static boost::shared_ptr
< WValueSetBase
convert (boost::shared_ptr< WDataSetScalar > whiteMatter, boost::shared_ptr< WDataSetScalar > grayMatter, boost::shared_ptr< WDataSetScalar > cerebrospinalFluid)
 This helper function converts the probabilities given by three separate WDataSetScalars to one WValueSetBase.
template<typename T >
static std::vector< T > copyDataSetsToArray (const std::vector< boost::shared_ptr< WDataSetScalar > > &dataSets)
 This helper function copies the content of several WDataSetScalars to one std::vector.

Detailed Description

A dataset that stores the segmentation of the brain into CSF, white and gray matter.

It also offers some convenience functions for this task.

Definition at line 45 of file WDataSetSegmentation.h.


Member Enumeration Documentation

Enumerator for the three different classification types.

Definition at line 161 of file WDataSetSegmentation.h.


Constructor & Destructor Documentation

WDataSetSegmentation::WDataSetSegmentation ( boost::shared_ptr< WValueSetBase segmentation,
boost::shared_ptr< WGrid grid 
)

Constructs an instance out of a value set and a grid.

Parameters:
segmentationthe value set to use
gridthe grid which maps world space to the value set

Definition at line 43 of file WDataSetSegmentation.cpp.

WDataSetSegmentation::WDataSetSegmentation ( boost::shared_ptr< WDataSetScalar whiteMatter,
boost::shared_ptr< WDataSetScalar grayMatter,
boost::shared_ptr< WDataSetScalar cerebrospinalFluid 
)

Constructs an instance out of three WDataSetScalar.

Parameters:
whiteMatterthe value set to use
grayMatterthe value set to use
cerebrospinalFluidthe value set to use

Definition at line 35 of file WDataSetSegmentation.cpp.

Construct an empty and unusable instance.

This is useful for prototypes.

Definition at line 50 of file WDataSetSegmentation.cpp.

Referenced by clone(), and getPrototype().

Destroys this DataSet instance.

Definition at line 56 of file WDataSetSegmentation.cpp.


Member Function Documentation

WDataSetSingle::SPtr WDataSetSegmentation::clone ( boost::shared_ptr< WValueSetBase newValueSet) const [virtual]

Creates a copy (clone) of this instance but allows one to change the valueset.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Parameters:
newValueSetthe new valueset.
Returns:
the clone

Reimplemented from WDataSetSingle.

Definition at line 71 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getGrid(), and WDataSetSegmentation().

WDataSetSingle::SPtr WDataSetSegmentation::clone ( boost::shared_ptr< WGrid newGrid) const [virtual]

Creates a copy (clone) of this instance but allows one to change the grid.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Parameters:
newGridthe new grid.
Returns:
the clone

Reimplemented from WDataSetSingle.

Definition at line 76 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getValueSet(), and WDataSetSegmentation().

Creates a copy (clone) of this instance.

Unlike copy construction, this is a very useful function if you want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.

Returns:
the clone

Reimplemented from WDataSetSingle.

Definition at line 81 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getGrid(), WDataSetSingle::getValueSet(), and WDataSetSegmentation().

boost::shared_ptr< WValueSetBase > WDataSetSegmentation::convert ( boost::shared_ptr< WDataSetScalar whiteMatter,
boost::shared_ptr< WDataSetScalar grayMatter,
boost::shared_ptr< WDataSetScalar cerebrospinalFluid 
) [static, private]

This helper function converts the probabilities given by three separate WDataSetScalars to one WValueSetBase.

Parameters:
whiteMatterthe probabilities for white matter.
grayMatterthe probabilities for gray matter.
cerebrospinalFluidthe probabilities for cerebrospinal fluid.
Returns:
The probabilities in one value set.

Definition at line 135 of file WDataSetSegmentation.cpp.

template<typename T >
std::vector< T > WDataSetSegmentation::copyDataSetsToArray ( const std::vector< boost::shared_ptr< WDataSetScalar > > &  dataSets) [static, private]

This helper function copies the content of several WDataSetScalars to one std::vector.

Parameters:
dataSetsthe std::vector of data WDataSetScalars.
Returns:
The WDataSetScalars merged to a std::vector.

Definition at line 203 of file WDataSetSegmentation.h.

References WDataSetSingle::getValueSet().

float WDataSetSegmentation::getCSFProbability ( int  x,
int  y,
int  z 
) const

Returns the cerebrospinal fluid probability for the given cell.

Parameters:
x,y,zThe coordinates in grid space.
Returns:
cerebrospinal fluid probability.

Definition at line 127 of file WDataSetSegmentation.cpp.

References WGridRegular3DTemplate< T >::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.

const std::string WDataSetSegmentation::getDescription ( ) const [virtual]

Gets the description for this prototype.

Returns:
the description

Reimplemented from WDataSetSingle.

Definition at line 66 of file WDataSetSegmentation.cpp.

float WDataSetSegmentation::getGMProbability ( int  x,
int  y,
int  z 
) const

Returns the gray matter probability for the given cell.

Parameters:
x,y,zThe coordinates in grid space.
Returns:
gray matter probability.

Definition at line 119 of file WDataSetSegmentation.cpp.

References WGridRegular3DTemplate< T >::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.

const std::string WDataSetSegmentation::getName ( ) const [virtual]

Gets the name of this prototype.

Returns:
the name.

Reimplemented from WDataSetSingle.

Definition at line 61 of file WDataSetSegmentation.cpp.

boost::shared_ptr< WPrototyped > WDataSetSegmentation::getPrototype ( ) [static]

Returns a prototype instantiated with the true type of the deriving class.

Returns:
the prototype.

Reimplemented from WDataSetSingle.

Definition at line 86 of file WDataSetSegmentation.cpp.

References m_prototype, and WDataSetSegmentation().

float WDataSetSegmentation::getWMProbability ( int  x,
int  y,
int  z 
) const

Returns the white matter probability for the given cell.

Parameters:
x,y,zThe coordinates in grid space.
Returns:
white matter probability.

Definition at line 111 of file WDataSetSegmentation.cpp.

References WGridRegular3DTemplate< T >::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.


Member Data Documentation

boost::shared_ptr< WPrototyped > WDataSetSegmentation::m_prototype = boost::shared_ptr< WPrototyped >() [static, protected]

The prototype as singleton.

Reimplemented from WDataSetSingle.

Definition at line 176 of file WDataSetSegmentation.h.

Referenced by getPrototype().


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