Go to the documentation of this file.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
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __cmtkVolume_h_included_
00034 #define __cmtkVolume_h_included_
00035
00036 #include <cmtkconfig.h>
00037
00038 #include <Base/cmtkDataGrid.h>
00039
00040 #include <Base/cmtkMacros.h>
00041 #include <Base/cmtkMathUtil.h>
00042 #include <Base/cmtkFixedVector.h>
00043 #include <Base/cmtkVector3D.h>
00044 #include <Base/cmtkAffineXform.h>
00045 #include <Base/cmtkProbeInfo.h>
00046 #include <Base/cmtkLandmarkList.h>
00047 #include <Base/cmtkAnatomicalOrientation.h>
00048
00049 #include <System/cmtkSmartPtr.h>
00050 #include <System/cmtkThreads.h>
00051 #include <System/cmtkMemory.h>
00052
00053 #include <algorithm>
00054
00055 namespace
00056 cmtk
00057 {
00058
00061
00068 class Volume :
00070 public DataGrid
00071 {
00072 public:
00074 typedef Volume Self;
00075
00077 typedef DataGrid Superclass;
00078
00080 typedef SmartPointer<Self> SmartPtr;
00081
00083 typedef Region<3,Types::Coordinate> CoordinateRegionType;
00084
00086 typedef CoordinateRegionType::IndexType CoordinateVectorType;
00087
00091 CoordinateVectorType m_Offset;
00092
00094 void SetOffset( const Vector3D& o )
00095 {
00096 this->m_Offset = o;
00097 }
00098
00100 LandmarkList::SmartPtr m_LandmarkList;
00101
00108 FixedVector<3,Types::Coordinate> Size;
00109
00111 Volume() : m_Offset( CoordinateVectorType::Init( 0.0 ) ) {}
00112
00116 virtual ~Volume () {};
00117
00121 virtual Types::Coordinate MinSize () const
00122 {
00123 return std::min<Types::Coordinate>( Size[0], std::min<Types::Coordinate>( Size[1], Size[2] ) );
00124 }
00125
00129 virtual Types::Coordinate MaxSize () const
00130 {
00131 return std::max<Types::Coordinate>( Size[0], std::max<Types::Coordinate>( Size[1], Size[2] ) );
00132 }
00133
00137 virtual Types::Coordinate TotalVolume () const
00138 {
00139 return Size[0] * Size[1] * Size[2];
00140 }
00141
00143 virtual Types::Coordinate AverageVoxelVolume () const
00144 {
00145 return ( (Size[0]*Size[1]*Size[2]) / ((this->m_Dims[0]-1)*(this->m_Dims[1]-1)*(this->m_Dims[2]-1)) );
00146 }
00147
00151 Vector3D GetCenter () const;
00152
00153 protected:
00158 bool GetTrilinear ( ProbeInfo&, const int, const int, const int, const Vector3D&, const Types::Coordinate*, const Types::Coordinate* ) const;
00159 };
00160
00162
00163 }
00164
00165 #endif