29 #include "../common/WAssert.h"
30 #include "WDataSetRawHARDI.h"
31 #include "WDataSetSingle.h"
37 std::shared_ptr< WGrid > newGrid,
38 std::shared_ptr< std::vector< WVector3d > > newGradients )
40 WAssert( newValueSet,
"No value set given." );
41 WAssert( newGrid,
"No grid given." );
42 WAssert( newGradients,
"No gradients given." );
43 WAssert( newValueSet->size() == newGrid->size(),
"Number of voxel entries unequal number of positions in grid." );
44 WAssert( newValueSet->order() != newGradients->size(),
"Number of gradients unequal number of entries in value set." );
49 std::shared_ptr< WGrid > newGrid,
50 std::shared_ptr< std::vector< WVector3d > > newGradients,
51 double diffusionBValue )
52 :
WDataSetSingle( newValueSet, newGrid ), m_gradients( newGradients ), m_diffusionBValues( new std::vector< float >( 1, diffusionBValue ) )
54 init( newValueSet, newGrid, newGradients );
58 std::shared_ptr< WGrid > newGrid,
59 std::shared_ptr< std::vector< WVector3d > > newGradients,
60 std::shared_ptr< std::vector< float > > diffusionBValues )
61 :
WDataSetSingle( newValueSet, newGrid ), m_gradients( newGradients ), m_diffusionBValues( diffusionBValues )
63 WAssert( diffusionBValues,
"No b-values given." );
64 init( newValueSet, newGrid, newGradients );
69 std::vector< size_t > validIndices;
72 const WVector3d& grad = ( *m_gradients )[ i ];
73 if( ( grad[ 0 ] != 0.0 ) || ( grad[ 1 ] != 0.0 ) || ( grad[ 2 ] != 0.0 ) )
139 WAssert( ( *m_diffusionBValues ).size() == 1,
"There is more then one diffusion b-value!" );
155 return "WDataSetRawHARDI";
160 return "Contains HARDI measurements.";
virtual const std::string getDescription() const
Gets the description for this prototype.
virtual const std::string getName() const
Gets the name of this prototype.
std::shared_ptr< std::vector< WVector3d > > m_gradients
Gradients of measurements.
std::vector< size_t > m_zeroGradientIndexes
The indexes for the which gradient is zero.
virtual ~WDataSetRawHARDI()
Destroys this DataSet instance.
virtual WDataSetSingle::SPtr clone() const
Creates a copy (clone) of this instance.
std::shared_ptr< std::vector< float > > m_diffusionBValues
Strength (b-value) of the so-called magnetic diffusion gradient.
const WVector3d & getGradient(size_t index) const
Returns the gradient for the index.
void buildGradientIndexes()
Build indexes for the zero and non-zero gradients.
static std::shared_ptr< WPrototyped > m_prototype
The prototype as singleton.
std::vector< size_t > m_nonZeroGradientIndexes
The indexes for the which gradient is non-zero.
double getDiffusionBValue() const
Returns the b-value of the diffusion.
WDataSetRawHARDI()
Construct an empty and unusable instance.
std::shared_ptr< std::vector< float > > getDiffusionBValues() const
Returns the b-values of the diffusion if there are different values.
static std::shared_ptr< WPrototyped > getPrototype()
Returns a prototype instantiated with the true type of the deriving class.
std::shared_ptr< std::vector< WVector3d > > getOrientations() const
Get the orientations.
std::size_t getNumberOfMeasurements() const
Returns the count of measurements per voxel, which is equal to the count of the used gradients.
void init(std::shared_ptr< WValueSetBase > newValueSet, std::shared_ptr< WGrid > newGrid, std::shared_ptr< std::vector< WVector3d > > newGradients)
Makes only such initialization which is common to all contructors.
A data set consisting of a set of values based on a grid.
std::shared_ptr< WValueSetBase > getValueSet() const
std::shared_ptr< WGrid > getGrid() const
std::shared_ptr< WDataSetSingle > SPtr
Convenience typedef for a std::shared_ptr.