00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __mitkCoherentVolume_h
00011 #define __mitkCoherentVolume_h
00012
00013 #include "mitkDataObject.h"
00014 #include "mitkVisualization2Includes.h"
00015
00016 class mitkICVolume;
00017
00018
00029 class MITK_VISUALIZATION2_API mitkCoherentVolume : public mitkDataObject
00030 {
00031 public:
00032 class BlockArray;
00033
00034 MITK_TYPE(mitkCoherentVolume,mitkDataObject)
00035 mitkCoherentVolume();
00036
00040 virtual void Initialize();
00041
00046 virtual int GetDataObjectType() const {return MITK_COHERENT_VOLUME;}
00047
00052 virtual unsigned long long GetActualMemorySize() const;
00053
00054 virtual void ShallowCopy(mitkDataObject *src){}
00055 virtual void DeepCopy(mitkDataObject *src){}
00056
00063 void SetBlockSize(const int bs[3])
00064 {
00065 m_BlockSize[0]=bs[0];
00066 m_BlockSize[1]=bs[1];
00067 m_BlockSize[2]=bs[2];
00068 }
00075 void GetBlcokSize(int bs[3])
00076 {
00077 bs[0]=m_BlockSize[0];
00078 bs[1]=m_BlockSize[1];
00079 bs[2]=m_BlockSize[2];
00080 }
00081
00088 void SetDimensions(const int dims[3])
00089 {
00090 m_Dimensions[0] = dims[0];
00091 m_Dimensions[1] = dims[1];
00092 m_Dimensions[2] = dims[2];
00093 m_BlockNum[0]= (m_Dimensions[0]-1)/m_BlockSize[0]+1;
00094 m_BlockNum[1]= (m_Dimensions[1]-1)/m_BlockSize[1]+1;
00095 m_BlockNum[2]= (m_Dimensions[2]-1)/m_BlockSize[2]+1;
00096 }
00097
00104 void GetDimensions(int dims[3]) const
00105 {
00106 dims[0] = m_Dimensions[0];
00107 dims[1] = m_Dimensions[1];
00108 dims[2] = m_Dimensions[2];
00109 }
00116 void SetSpacings(const float s[3])
00117 {
00118 m_Spacings[0] = s[0];
00119 m_Spacings[1] = s[1];
00120 m_Spacings[2] = s[2];
00121 }
00122
00129 void GetSpacings(float s[3]) const
00130 {
00131 s[0] = m_Spacings[0];
00132 s[1] = m_Spacings[1];
00133 s[2] = m_Spacings[2];
00134 }
00135
00142 void GetBlockNum(int bn[3])
00143 {
00144 bn[0]=m_BlockNum[0];
00145 bn[1]=m_BlockNum[1];
00146 bn[2]=m_BlockNum[2];
00147 }
00148
00153 int GetDataTypeSize() const { return m_DataTypeSize; }
00154
00169 void SetDataType(int data_type);
00170
00185 int GetDataType() const { return m_DataType; }
00186
00190 void AllocateBlocks();
00191
00198 void SetBlockSlice(void *sliceData,int sliceID,int dimz=-1);
00199
00204 void SetData(void *data);
00205
00210 void SetICVolume(mitkICVolume *icv);
00211
00219 float GetValue(int x,int y,int z);
00220
00226 void GetMinMaxValue(double &minValue,double &maxValue);
00227
00228 protected:
00229 virtual ~mitkCoherentVolume();
00230
00231 private:
00232 mitkCoherentVolume(const mitkCoherentVolume&);
00233 void operator = (const mitkCoherentVolume&);
00234
00235 BlockArray *m_BlockArray;
00236
00237 int m_BlockSize[3];
00238 int m_Dimensions[3];
00239 float m_Spacings[3];
00240 int m_BlockNum[3];
00241 int m_DataType;
00242
00243 int m_DataTypeSize;
00244 double m_DataTypeMin;
00245 double m_DataTypeMax;
00246 };
00247
00248 #endif