OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | Static Private Member Functions | List of all members
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:
+ Collaboration diagram for WDataSetSegmentation:

Public Types

enum  matterType { whiteMatter = 0 , grayMatter = 1 , csf = 2 }
 Enumerator for the three different classification types. More...
 
- Public Types inherited from WDataSetSingle
typedef std::shared_ptr< WDataSetSingleSPtr
 Convenience typedef for a std::shared_ptr. More...
 
typedef std::shared_ptr< const WDataSetSingleConstSPtr
 Convenience typedef for a std::shared_ptr; const. More...
 
- Public Types inherited from WDataSet
typedef std::shared_ptr< WDataSetSPtr
 Shared pointer abbreviation to a instance of this class. More...
 
typedef std::shared_ptr< const WDataSetConstSPtr
 Shared pointer abbreviation to a const instance of this class. More...
 

Public Member Functions

 WDataSetSegmentation (std::shared_ptr< WValueSetBase > segmentation, std::shared_ptr< WGrid > grid)
 Constructs an instance out of a value set and a grid. More...
 
 WDataSetSegmentation (std::shared_ptr< WDataSetScalar > whiteMatter, std::shared_ptr< WDataSetScalar > grayMatter, std::shared_ptr< WDataSetScalar > cerebrospinalFluid)
 Constructs an instance out of three WDataSetScalar. More...
 
 WDataSetSegmentation ()
 Construct an empty and unusable instance. More...
 
virtual ~WDataSetSegmentation ()
 Destroys this DataSet instance. More...
 
float getWMProbability (int x, int y, int z) const
 Returns the white matter probability for the given cell. More...
 
float getGMProbability (int x, int y, int z) const
 Returns the gray matter probability for the given cell. More...
 
float getCSFProbability (int x, int y, int z) const
 Returns the cerebrospinal fluid probability for the given cell. More...
 
virtual const std::string getName () const
 Gets the name of this prototype. More...
 
virtual const std::string getDescription () const
 Gets the description for this prototype. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows one to change the valueset. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WValueSetBase > newValueSet) const
 Creates a copy (clone) of this instance but allows one to change the valueset. More...
 
virtual WDataSetSingle::SPtr clone (std::shared_ptr< WGrid > newGrid) const
 Creates a copy (clone) of this instance but allows one to change the grid. More...
 
virtual WDataSetSingle::SPtr clone () const
 Creates a copy (clone) of this instance. More...
 
- Public Member Functions inherited from WDataSetSingle
 WDataSetSingle (std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid)
 Constructs an instance out of a value set and a grid. More...
 
 WDataSetSingle ()
 Construct an empty and unusable instance. More...
 
virtual ~WDataSetSingle ()
 Destroys this DataSet instance. More...
 
std::shared_ptr< WValueSetBasegetValueSet () const
 
std::shared_ptr< WGridgetGrid () const
 
template<typename T >
OW_API_DEPRECATEDgetValueAt (size_t id)
 Get the scalar value stored at id-th position of the array of the value set. More...
 
double OW_API_DEPRECATED getValueAt (size_t id) const
 Get the scalar value stored at id-th position of the array of the value set. More...
 
double getSingleRawValue (size_t id) const
 Get the raw scalar value stored at id-th position of the raw array of the value set. More...
 
virtual bool isTexture () const
 Determines whether this dataset can be used as a texture. More...
 
virtual osg::ref_ptr< WDataTexture3DgetTexture () const
 Returns the texture representation of the dataset. More...
 
- Public Member Functions inherited from WDataSet
 WDataSet ()
 This constructor should be used if a dataSet does not stem from a file. More...
 
virtual ~WDataSet ()
 Since WDataSet is a base class and thus should be polymorphic we add virtual destructor. More...
 
void setFilename (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
std::string getFilename () const
 Get the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED void setFileName (const std::string filename)
 Set the name of the file that this data set stems from. More...
 
OW_API_DEPRECATED std::string getFileName () const
 Get the name of the file that this data set stems from. More...
 
virtual std::shared_ptr< WDataSetVectorisVectorDataSet ()
 Checks if this dataset is a vector dataset. More...
 
std::shared_ptr< WPropertiesgetProperties () const
 Return a pointer to the properties object of the dataset. More...
 
std::shared_ptr< WPropertiesgetInformationProperties () const
 Return a pointer to the information properties object of the dataset. More...
 
- Public Member Functions inherited from WTransferable
 WTransferable ()
 Default constructor. More...
 
virtual ~WTransferable ()
 Destructor. More...
 
- Public Member Functions inherited from WPrototyped
 WPrototyped ()
 Default constructor. More...
 
virtual ~WPrototyped ()
 Destructor. More...
 
template<typename T >
bool isA ()
 Checks whether the actual prototype has the specified runtime type. More...
 

Static Public Member Functions

static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Static Public Member Functions inherited from WDataSetSingle
static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 
- Static Public Member Functions inherited from WDataSet
static std::shared_ptr< WPrototypedgetPrototype ()
 Returns a prototype instantiated with the true type of the deriving class. More...
 

Static Protected Attributes

static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 
- Static Protected Attributes inherited from WDataSetSingle
static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 
- Static Protected Attributes inherited from WDataSet
static std::shared_ptr< WPrototypedm_prototype = std::shared_ptr< WPrototyped >()
 The prototype as singleton. More...
 

Static Private Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from WDataSetSingle
std::shared_ptr< WGridm_grid
 Stores the reference of the WGrid of this DataSetSingle instance. More...
 
std::shared_ptr< WValueSetBasem_valueSet
 Stores the reference of the WValueSet of this DataSetSingle instance. More...
 
- Protected Attributes inherited from WDataSet
std::shared_ptr< WPropertiesm_properties
 The property object for the dataset. More...
 
std::shared_ptr< WPropertiesm_infoProperties
 The property object for the dataset containing only props whose purpose is "PV_PURPOSE_INFORMNATION". More...
 

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

◆ matterType

Enumerator for the three different classification types.

Definition at line 172 of file WDataSetSegmentation.h.

Constructor & Destructor Documentation

◆ WDataSetSegmentation() [1/3]

WDataSetSegmentation::WDataSetSegmentation ( std::shared_ptr< WValueSetBase segmentation,
std::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() [2/3]

WDataSetSegmentation::WDataSetSegmentation ( std::shared_ptr< WDataSetScalar whiteMatter,
std::shared_ptr< WDataSetScalar grayMatter,
std::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.

◆ WDataSetSegmentation() [3/3]

WDataSetSegmentation::WDataSetSegmentation ( )

Construct an empty and unusable instance.

This is useful for prototypes.

Definition at line 50 of file WDataSetSegmentation.cpp.

Referenced by clone(), and getPrototype().

+ Here is the caller graph for this function:

◆ ~WDataSetSegmentation()

WDataSetSegmentation::~WDataSetSegmentation ( )
virtual

Destroys this DataSet instance.

Definition at line 56 of file WDataSetSegmentation.cpp.

Member Function Documentation

◆ clone() [1/4]

WDataSetSingle::SPtr WDataSetSegmentation::clone ( ) const
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.

Returns
the clone

Reimplemented from WDataSetSingle.

Definition at line 86 of file WDataSetSegmentation.cpp.

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

+ Here is the call graph for this function:

◆ clone() [2/4]

WDataSetSingle::SPtr WDataSetSegmentation::clone ( std::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 81 of file WDataSetSegmentation.cpp.

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

+ Here is the call graph for this function:

◆ clone() [3/4]

WDataSetSingle::SPtr WDataSetSegmentation::clone ( std::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 76 of file WDataSetSegmentation.cpp.

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

+ Here is the call graph for this function:

◆ clone() [4/4]

WDataSetSingle::SPtr WDataSetSegmentation::clone ( std::shared_ptr< WValueSetBase newValueSet,
std::shared_ptr< WGrid newGrid 
) 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.

Parameters
newValueSetthe new valueset.
newGridthe new grid.
Returns
the clone

Reimplemented from WDataSetSingle.

Definition at line 71 of file WDataSetSegmentation.cpp.

References WDataSetSegmentation().

+ Here is the call graph for this function:

◆ convert()

std::shared_ptr< WValueSetBase > WDataSetSegmentation::convert ( std::shared_ptr< WDataSetScalar whiteMatter,
std::shared_ptr< WDataSetScalar grayMatter,
std::shared_ptr< WDataSetScalar cerebrospinalFluid 
)
staticprivate

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 140 of file WDataSetSegmentation.cpp.

◆ copyDataSetsToArray()

template<typename T >
std::vector< T > WDataSetSegmentation::copyDataSetsToArray ( const std::vector< std::shared_ptr< WDataSetScalar > > &  dataSets)
staticprivate

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 214 of file WDataSetSegmentation.h.

References WDataSetSingle::getValueSet().

+ Here is the call graph for this function:

◆ getCSFProbability()

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 132 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getSingleRawValue(), and WDataSetSingle::m_grid.

+ Here is the call graph for this function:

◆ getDescription()

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.

◆ getGMProbability()

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 124 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getSingleRawValue(), and WDataSetSingle::m_grid.

+ Here is the call graph for this function:

◆ getName()

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.

◆ getPrototype()

std::shared_ptr< WPrototyped > WDataSetSegmentation::getPrototype ( )
static

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

Returns
the prototype.

Definition at line 91 of file WDataSetSegmentation.cpp.

References m_prototype, and WDataSetSegmentation().

+ Here is the call graph for this function:

◆ getWMProbability()

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 116 of file WDataSetSegmentation.cpp.

References WDataSetSingle::getSingleRawValue(), and WDataSetSingle::m_grid.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_prototype

std::shared_ptr< WPrototyped > WDataSetSegmentation::m_prototype = std::shared_ptr< WPrototyped >()
staticprotected

The prototype as singleton.

Definition at line 187 of file WDataSetSegmentation.h.

Referenced by getPrototype().


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