00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "WDataSetDTI.h"
00026
00027
00028 boost::shared_ptr< WPrototyped > WDataSetDTI::m_prototype = boost::shared_ptr< WPrototyped >();
00029
00030
00031 WDataSetDTI::WDataSetDTI( boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid )
00032 : WDataSetSingle( newValueSet, newGrid )
00033 {
00034 WAssert( newValueSet, "No value set given." );
00035 WAssert( newGrid, "No grid given." );
00036 WAssert( newValueSet->size() == newGrid->size(), "Number of values unequal number of positions in grid." );
00037 WAssert( newValueSet->order() == 1, "The value set does not contain vectors." );
00038 WAssert( newValueSet->dimension() == 6, "The size of the vetors does not match symmetric matrices: must be equal to 6." );
00039 }
00040
00041 WDataSetDTI::~WDataSetDTI()
00042 {
00043 }
00044
00045 WDataSetSingle::SPtr WDataSetDTI::clone( boost::shared_ptr< WValueSetBase > newValueSet ) const
00046 {
00047 return WDataSetSingle::SPtr( new WDataSetDTI( newValueSet, getGrid() ) );
00048 }
00049
00050 WDataSetSingle::SPtr WDataSetDTI::clone( boost::shared_ptr< WGrid > newGrid ) const
00051 {
00052 return WDataSetSingle::SPtr( new WDataSetDTI( getValueSet(), newGrid ) );
00053 }
00054
00055 WDataSetSingle::SPtr WDataSetDTI::clone() const
00056 {
00057 return WDataSetSingle::SPtr( new WDataSetDTI( getValueSet(), getGrid() ) );
00058 }
00059
00060 WTensorSym< 2, 3, float > WDataSetDTI::getTensor( size_t index ) const
00061 {
00062 boost::shared_ptr< WValueSet< float > > values = boost::shared_dynamic_cast< WValueSet< float > >( m_valueSet );
00063 WAssert( values, "The value set of a WDataSetDTI must be a WValueSet< float >, nothing else!" );
00064 return WTensorSym< 2, 3, float >( values->getWValue( index ) );
00065 }
00066