Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

mitkPhantom.h

00001 /*=========================================================================
00002 
00003   Program:   3DMed
00004   Date:      $Date: 2014-02-25 18:30:00 +0800 $
00005   Version:   $Version: 4.6.0 $
00006   Copyright: MIPG, Institute of Automation, Chinese Academy of Sciences
00007 
00008 =========================================================================*/
00009 
00010 
00011 #ifndef __mitkPhantom_h
00012 #define __mitkPhantom_h
00013 
00014 #include "mitkObject.h"
00015 #include <list>
00016 #include "mitkReconstructionIncludes.h"
00017 
00018 typedef enum {
00019         PELEM_INVALID,
00020         PELEM_ELLIPSOID,
00021         PELEM_CUBOID
00022 } PhmElemType;
00023 
00024 typedef double (* pMat2D)[3];
00025 
00026 class mitkPhantomElement : public mitkObject
00027 {
00028 public:
00029     
00030     MITK_TYPE(mitkPhantomElement, mitkObject)
00031     virtual void PrintSelf(ostream &os);
00032     
00033     mitkPhantomElement(const char* type, const double cx, const double cy, const double cz, 
00034         const double a, const double b, const double c, const double rotx, const double roty, 
00035         const double rotz, const double atten); 
00036     ~mitkPhantomElement();
00037 
00038     double GetAtten() const {return m_atten; }
00039     void SetAtten(double atten) { m_atten = atten;}
00040 
00041     double GetCentX() const {return m_centX;}
00042     double GetCentY() const {return m_centY;}
00043     double GetCentZ() const {return m_centZ;}
00044 
00045     void SetCentX(double centX) { m_centX = centX;}
00046     void SetCentY(double centY) { m_centY = centY;}
00047     void SetCentZ(double centZ) { m_centZ = centZ;}
00048 
00049     double GetSemiAxisLengthX() const {return m_semiAxisLengthX;}
00050     double GetSemiAxisLengthY() const {return m_semiAxisLengthY;}
00051     double GetSemiAxisLengthZ() const {return m_semiAxisLengthZ;}
00052 
00053     void SetSemiAxisLengthX(double x) { m_semiAxisLengthX = x;}
00054     void SetSemiAxisLengthY(double y) { m_semiAxisLengthY = y;}
00055     void SetSemiAxisLengthZ(double z) { m_semiAxisLengthZ = z;}
00056 
00057     double GetRotX() const {return m_rotX;}
00058     double GetRotY() const {return m_rotY;}
00059     double GetRotZ() const {return m_rotZ;}
00060 
00061     void SetRotX(double rotX) { m_rotX = rotX; }
00062     void SetRotY(double rotY) { m_rotY = rotY; }
00063     void SetRotZ(double rotZ) { m_rotZ = rotZ; }
00064 
00065     pMat2D GetRotMat() {return m_rotMat;}
00066     static PhmElemType convertNameToType(const char* const typeName);
00067 
00068 protected:
00069     PhmElemType m_type;     // phantom element type (ellipsoid, cuboid)
00070     double m_atten;         // x-ray attenuation coefficient
00071     double m_centX, m_centY, m_centZ;   // center of phantom element
00072     double m_semiAxisLengthX, m_semiAxisLengthY, m_semiAxisLengthZ; 
00073     double m_rotX, m_rotY, m_rotZ;      // rotation angle (in rad)
00074     double m_rotMat[3][3];  // rotation matrix
00075 
00076     static const char* const convertTypeToName(PhmElemType iType);
00077     void makeRotateMatrix();
00078 
00079 private:
00080     mitkPhantomElement (const mitkPhantomElement& rhs);        // copy constructor
00081     mitkPhantomElement& operator= (const mitkPhantomElement&); // assignment operator
00082 
00083 };
00084 
00085 typedef enum {
00086         PHM_INVALID,
00087         PHM_SHEPP_LOGAN,
00088         PHM_MODIFIED_SHEPP_LOGAN,
00089 } PhmType;
00090 
00091 class MITK_RECONSTRUCTION_API mitkPhantom : public mitkObject
00092 {
00093 public:
00094     MITK_TYPE(mitkPhantom, mitkObject)
00095     virtual void PrintSelf(ostream &os);
00096 
00097     mitkPhantom();
00098     mitkPhantom(const char* const phmName);
00099     
00100     ~mitkPhantom();
00101     bool createFromPhantom (const char* const phmName);
00102     bool createFromPhantom (PhmType phmtype);   
00103     bool createFromFile (const char* const fname);
00104     bool fileWrite (const char* const fname);
00105     
00106     void addPElem (const mitkPhantomElement& pelem);
00107     void addPElem (const char* type, const double cx, const double cy, const double cz, 
00108         const double a, const double b, const double c, const double rotx, const double roty, const double rotz, const double atten);
00109 
00110     PhmType convertPhmNameToType(const char* const phmName);
00111 
00112     std::list<mitkPhantomElement*> GetPElemList() {return m_listPElem;}
00113     int GetPElemNum() {return m_nPElem;}
00114 
00115 protected:
00116 //    PhmType m_type;                           // shepp-logan or user defined
00117 //    std::string m_name;
00118 
00119     int m_nPElem;                           // number of pelems in phantom
00120     mutable std::list<mitkPhantomElement*> m_listPElem;      // pelem lists 
00121 
00122     void init();
00123     void addSheppLogan();
00124     void addModifiedSheppLogan();
00125     
00126     static const char* const convertPhmTypeToName(PhmType phmType);
00127 
00128 private:
00129     mitkPhantom (const mitkPhantom& rhs);        // copy constructor
00130     mitkPhantom& operator= (const mitkPhantom&); // assignment operator
00131 };
00132 
00133 typedef std::list<mitkPhantomElement*>::iterator mitkPElemIterator;
00134 typedef std::list<mitkPhantomElement*>::const_iterator mitkPElemConstIterator;
00135 
00136 
00137 
00138 //#define DEFINED_mitkPhantom
00139 
00140 
00141 
00142 #endif
00143 

Generated on Tue Feb 25 15:00:37 2014 for MITK (Medical Imaging ToolKit) by  doxygen 1.4.3