OpenWalnut  1.4.0
WDataSetDTI.h
00001 //---------------------------------------------------------------------------
00002 //
00003 // Project: OpenWalnut ( http://www.openwalnut.org )
00004 //
00005 // Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
00006 // For more information see http://www.openwalnut.org/copying
00007 //
00008 // This file is part of OpenWalnut.
00009 //
00010 // OpenWalnut is free software: you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as published by
00012 // the Free Software Foundation, either version 3 of the License, or
00013 // (at your option) any later version.
00014 //
00015 // OpenWalnut is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 // GNU Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public License
00021 // along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
00022 //
00023 //---------------------------------------------------------------------------
00024 
00025 #ifndef WDATASETDTI_H
00026 #define WDATASETDTI_H
00027 
00028 #include <boost/shared_ptr.hpp>
00029 
00030 #include "../common/math/WTensorSym.h"
00031 #include "WDataSetSingle.h"
00032 
00033 
00034 /**
00035  * Represents a Diffusion-Tensor-Image dataset. Diffusion tensors are symmetric matrices.
00036  */
00037 class WDataSetDTI : public WDataSetSingle
00038 {
00039 public:
00040     /**
00041      * Creates a new DTI dataset out of a value set and a grid.
00042      *
00043      * \param newValueSet Valueset having vectors of dimension 6.
00044      * \param newGrid
00045      */
00046     WDataSetDTI( boost::shared_ptr< WValueSetBase > newValueSet, boost::shared_ptr< WGrid > newGrid );
00047 
00048     /**
00049      * Destructs this dataset.
00050      */
00051     ~WDataSetDTI();
00052 
00053     /**
00054      * 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
00055      * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
00056      *
00057      * \param newValueSet the new valueset.
00058      *
00059      * \return the clone
00060      */
00061     virtual WDataSetSingle::SPtr clone( boost::shared_ptr< WValueSetBase > newValueSet ) const;
00062 
00063     /**
00064      * 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
00065      * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
00066      *
00067      * \param newGrid the new grid.
00068      *
00069      * \return the clone
00070      */
00071     virtual WDataSetSingle::SPtr clone( boost::shared_ptr< WGrid > newGrid ) const;
00072 
00073     /**
00074      * Creates a copy (clone) of this instance. Unlike copy construction, this is a very useful function if you
00075      * want to keep the dynamic type of your dataset even if you just have a WDataSetSingle.
00076      *
00077      * \return the clone
00078      */
00079     virtual WDataSetSingle::SPtr clone() const;
00080 
00081     /**
00082      * Retrieves the i'th tensor.
00083      *
00084      * \warning Here is dynamical allocation used inside, this may be a problem when used with multithreading.
00085      *
00086      * \param index The position of the tensor to retrieve
00087      *
00088      * \return The new constructed symmetrical matrix as tensor.
00089      */
00090     WTensorSym< 2, 3, float > getTensor( size_t index ) const;
00091 
00092 protected:
00093     /**
00094      * The prototype as singleton.
00095      */
00096     static boost::shared_ptr< WPrototyped > m_prototype;
00097 
00098 private:
00099 };
00100 
00101 #endif  // WDATASETDTI_H