Interim work on creating projections from an imagefile
[ctsim.git] / include / phantom.h
index 9fb91041aa3a280ba7d96824c42ae22d3c66c4b7..b1cb50fe9c7132584299c34bd896d1e802940946 100644 (file)
@@ -7,9 +7,7 @@
 **   Date Started:  July 1, 1984
 **
 **  This is part of the CTSim program
-**  Copyright (c) 1983-2001 Kevin Rosenberg
-**
-**  $Id$
+**  Copyright (c) 1983-2009 Kevin Rosenberg
 **
 **  This program is free software; you can redistribute it and/or modify
 **  it under the terms of the GNU General Public License (version 2) as
@@ -105,11 +103,8 @@ class PhantomElement
     static const char* const convertTypeToName (PhmElemType iType);
 
     void makeTransformMatrices ();
-
     void makeVectorOutline ();
-
     void calcArcPoints (double x[], double y[], const int pts, const double xcent, const double ycent, const double r, const double start, const double stop);
-
     void calcEllipsePoints (double x[], double y[], const int pts, const double u, const double v);
 
     static int numCirclePoints (double theta);
@@ -152,15 +147,12 @@ class Phantom
         { return m_composition; }
 
     bool createFromPhantom (const char* const phmName);
-
     bool createFromPhantom (const int phmid);
-
-    bool createFromFile (const char* const fname);
-
+    bool createFromPhmFile (const char* const fname);
+    bool createFromImageFile (const char* const fname);
     bool fileWrite (const char* const fname);
 
     void addPElem (const PhantomElement& pelem);
-
     void addPElem (const char* const composition, const double cx, const double cy, const double u, const double v, const double rot, const double atten);
 
     void convertToImagefile (ImageFile& im, double dViewRatio, const int in_nsample, const int trace) const;
@@ -202,6 +194,8 @@ class Phantom
           std::list<PhantomElement*>& listPElem() {return m_listPElem;}
     const std::list<PhantomElement*>& listPElem() const {return m_listPElem;}
     const int nPElem() const {return m_nPElem;}
+    const bool isImagefile(void) const { return m_im != NULL; }
+    const ImageFile* getImagefile() const { return m_im; }
 
     static const int getPhantomCount() {return s_iPhantomCount;}
     static const char** getPhantomNameArray() {return s_aszPhantomName;}
@@ -222,6 +216,7 @@ class Phantom
     static const char* s_aszPhantomName[];
     static const char* s_aszPhantomTitle[];
     static const int s_iPhantomCount;
+    ImageFile* m_im;                  // If defining a phantom from an ImageFile
 
     void init();