25 #ifndef WDATASETSEGMENTATION_H
26 #define WDATASETSEGMENTATION_H
34 #include "WDataSetScalar.h"
35 #include "WDataSetSingle.h"
54 WDataSetSegmentation( std::shared_ptr< WValueSetBase > segmentation, std::shared_ptr< WGrid > grid );
64 std::shared_ptr< WDataSetScalar > grayMatter,
65 std::shared_ptr< WDataSetScalar > cerebrospinalFluid );
114 virtual const std::string
getName()
const;
132 virtual WDataSetSingle::SPtr clone( std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid )
const;
199 static std::shared_ptr< WValueSetBase >
convert( std::shared_ptr< WDataSetScalar > whiteMatter,
200 std::shared_ptr< WDataSetScalar > grayMatter,
201 std::shared_ptr< WDataSetScalar > cerebrospinalFluid );
210 template<
typename T >
static std::vector< T >
copyDataSetsToArray(
const std::vector< std::shared_ptr< WDataSetScalar > > &dataSets );
213 template<
typename T > std::vector< T >
216 const size_t voxelDim = dataSets.size();
217 size_t countVoxels = 0;
218 if( !dataSets.empty() ) countVoxels = ( *dataSets.begin() )->
getValueSet()->size();
220 std::vector< T > data( countVoxels * voxelDim );
224 for( std::vector< std::shared_ptr< WDataSetScalar > >::const_iterator it = dataSets.begin(); it != dataSets.end(); it++ )
226 for(
size_t voxelNumber = 0; voxelNumber < countVoxels; voxelNumber++ )
228 data[ voxelNumber * voxelDim + dimIndex ] = ( std::static_pointer_cast< WDataSetSingle > ( *it ) )->getSingleRawValue< T >( voxelNumber );
A dataset that stores the segmentation of the brain into CSF, white and gray matter.
WDataSetSegmentation()
Construct an empty and unusable instance.
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 getDescription() const
Gets the description for this prototype.
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
float getWMProbability(int x, int y, int z) const
Returns the white matter probability for the given cell.
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.
virtual const std::string getName() const
Gets the name of this prototype.
static std::shared_ptr< WValueSetBase > convert(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 WValue...
matterType
Enumerator for the three different classification types.
static std::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
virtual ~WDataSetSegmentation()
Destroys this DataSet instance.
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.
A data set consisting of a set of values based on a grid.
std::shared_ptr< WValueSetBase > getValueSet() const
std::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a std::shared_ptr.