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