OpenWalnut
1.2.5
|
A dataset that stores the segmentation of the brain into CSF, white and gray matter. More...
#include <WDataSetSegmentation.h>
Public Types | |
enum | matterType { whiteMatter = 0, grayMatter = 1, csf = 2 } |
Enumerator for the three different classification types. More... | |
![]() | |
typedef boost::shared_ptr < WDataSetSingle > | SPtr |
Convenience typedef for a boost::shared_ptr. | |
typedef boost::shared_ptr < const WDataSetSingle > | ConstSPtr |
Convenience typedef for a boost::shared_ptr; const. |
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 to change the valueset. | |
virtual WDataSetSingle::SPtr | clone (boost::shared_ptr< WGrid > newGrid) const |
Creates a copy (clone) of this instance but allows to change the grid. | |
virtual WDataSetSingle::SPtr | clone () const |
Creates a copy (clone) of this instance. | |
![]() | |
WDataSetSingle (boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid) | |
Constructs an instance out of a value set and a grid. | |
WDataSetSingle () | |
Construct an empty and unusable instance. | |
virtual | ~WDataSetSingle () |
Destroys this DataSet instance. | |
boost::shared_ptr< WValueSetBase > | getValueSet () const |
boost::shared_ptr< WGrid > | getGrid () const |
template<typename T > | |
T | getValueAt (size_t id) |
Get the value stored at position of the value set. | |
double | getValueAt (size_t id) const |
Get the value stored at position of the value set. | |
virtual bool | isTexture () const |
Determines whether this dataset can be used as a texture. | |
virtual osg::ref_ptr < WDataTexture3D > | getTexture () const |
Returns the texture representation of the dataset. | |
![]() | |
WDataSet () | |
This constructor should be used if a dataSet does not stem from a file. | |
virtual | ~WDataSet () |
Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. | |
void | setFileName (const std::string fileName) |
Set the name of the file that this data set stems from. | |
std::string | getFileName () const |
Get the name of the file that this data set stems from. | |
virtual boost::shared_ptr < WDataSetVector > | isVectorDataSet () |
Checks if this dataset is a vector dataset. | |
boost::shared_ptr< WProperties > | getProperties () const |
Return a pointer to the properties object of the dataset. | |
boost::shared_ptr< WProperties > | getInformationProperties () const |
Return a pointer to the information properties object of the dataset. | |
![]() | |
WTransferable () | |
Default constructor. | |
virtual | ~WTransferable () |
Destructor. | |
![]() | |
WPrototyped () | |
Default constructor. | |
virtual | ~WPrototyped () |
Destructor. | |
template<typename T > | |
bool | isA () |
Checks whether the actual prototype has the specified runtime type. |
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 boost::shared_ptr < WPrototyped > | m_prototype = boost::shared_ptr< WPrototyped >() |
The prototype as singleton. | |
![]() | |
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 seperate 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. |
Additional Inherited Members | |
![]() | |
boost::shared_ptr< WGrid > | m_grid |
Stores the reference of the WGrid of this DataSetSingle instance. | |
boost::shared_ptr< WValueSetBase > | m_valueSet |
Stores the reference of the WValueSet of this DataSetSingle instance. |
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 46 of file WDataSetSegmentation.h.
Enumerator for the three different classification types.
Definition at line 163 of file WDataSetSegmentation.h.
WDataSetSegmentation::WDataSetSegmentation | ( | boost::shared_ptr< WValueSetBase > | segmentation, |
boost::shared_ptr< WGrid > | grid | ||
) |
Constructs an instance out of a value set and a grid.
segmentation | the value set to use |
grid | the grid which maps world space to the value set |
Definition at line 44 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.
whiteMatter | the value set to use |
grayMatter | the value set to use |
cerebrospinalFluid | the value set to use |
Definition at line 36 of file WDataSetSegmentation.cpp.
WDataSetSegmentation::WDataSetSegmentation | ( | ) |
Construct an empty and unusable instance.
This is useful for prototypes.
Definition at line 51 of file WDataSetSegmentation.cpp.
Referenced by clone(), and getPrototype().
|
virtual |
Destroys this DataSet instance.
Definition at line 57 of file WDataSetSegmentation.cpp.
|
virtual |
Creates a copy (clone) of this instance but allows 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.
newValueSet | the new valueset. |
Reimplemented from WDataSetSingle.
Definition at line 72 of file WDataSetSegmentation.cpp.
References WDataSetSingle::getGrid(), and WDataSetSegmentation().
|
virtual |
Creates a copy (clone) of this instance but allows 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.
newGrid | the new grid. |
Reimplemented from WDataSetSingle.
Definition at line 77 of file WDataSetSegmentation.cpp.
References WDataSetSingle::getValueSet(), and WDataSetSegmentation().
|
virtual |
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.
Reimplemented from WDataSetSingle.
Definition at line 82 of file WDataSetSegmentation.cpp.
References WDataSetSingle::getGrid(), WDataSetSingle::getValueSet(), and WDataSetSegmentation().
|
staticprivate |
This helper function converts the probabilities given by three seperate WDataSetScalars to one WValueSetBase.
whiteMatter | the probabilities for white matter. |
grayMatter | the probabilities for gray matter. |
cerebrospinalFluid | the probabilities for cerebrospinal fluid. |
Definition at line 136 of file WDataSetSegmentation.cpp.
|
staticprivate |
This helper function copies the content of several WDataSetScalars to one std::vector.
dataSets | the std::vector of data WDataSetScalars. |
Definition at line 205 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.
x,y,z | The coordinates in grid space. |
Definition at line 128 of file WDataSetSegmentation.cpp.
References WGridRegular3D::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.
|
virtual |
Gets the description for this prototype.
Reimplemented from WDataSetSingle.
Definition at line 67 of file WDataSetSegmentation.cpp.
float WDataSetSegmentation::getGMProbability | ( | int | x, |
int | y, | ||
int | z | ||
) | const |
Returns the gray matter probability for the given cell.
x,y,z | The coordinates in grid space. |
Definition at line 120 of file WDataSetSegmentation.cpp.
References WGridRegular3D::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.
|
virtual |
Gets the name of this prototype.
Reimplemented from WDataSetSingle.
Definition at line 62 of file WDataSetSegmentation.cpp.
|
static |
Returns a prototype instantiated with the true type of the deriving class.
Reimplemented from WDataSetSingle.
Definition at line 87 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.
x,y,z | The coordinates in grid space. |
Definition at line 112 of file WDataSetSegmentation.cpp.
References WGridRegular3D::getNbCoordsX(), WDataSetSingle::getValueAt(), and WDataSetSingle::m_grid.
|
staticprotected |
The prototype as singleton.
Definition at line 178 of file WDataSetSegmentation.h.
Referenced by getPrototype().