1 /*****************************************************************************
5 ** Purpose: Header file for Projections class
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: July 1, 1984
9 ** This is part of the CTSim program
10 ** Copyright (C) 1983-2000 Kevin Rosenberg
12 ** $Id: projections.h,v 1.5 2000/06/25 17:32:24 kevin Exp $
15 ** This program is free software; you can redistribute it and/or modify
16 ** it under the terms of the GNU General Public License (version 2) as
17 ** published by the Free Software Foundation.
19 ** This program is distributed in the hope that it will be useful,
20 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ** GNU General Public License for more details.
24 ** You should have received a copy of the GNU General Public License
25 ** along with this program; if not, write to the Free Software
26 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 ******************************************************************************/
39 Projections (const int nView, const int nDet);
40 Projections (const Scanner& scanner);
44 void initFromScanner (const Scanner& scanner);
46 void printProjectionData (void);
47 void printScanInfo (void) const;
49 bool read (const char* fname);
50 bool write (const char* fname);
51 bool detarrayRead (fnetorderstream& fs, DetectorArray& darray, const int view_num);
52 bool detarrayWrite (fnetorderstream& fs, const DetectorArray& darray, const int view_num);
54 bool reconstruct (ImageFile& im, const char* const filterName, double filt_param, const char* const interpName, int interp_param, const char* const backprojName, const int trace);
56 void setNView (int nView); // used in MPI to restrict # of views
57 void setRotInc (double rotInc) { m_rotInc = rotInc;}
58 void setDetInc (double detInc) { m_detInc = detInc;}
59 void setPhmLen (double phmLen) { m_phmLen = phmLen;}
60 void setCalcTime (double calcTime) {m_calcTime = calcTime;}
61 void setRemark (const char* remark) {m_remark = remark;}
62 void setRemark (const string remark) {m_remark = remark;}
64 const double detStart(void) const {return m_detStart;}
65 const double rotStart(void) const {return m_rotStart;}
66 const double calcTime(void) const {return m_calcTime;}
67 const double phmLen(void) const {return m_phmLen;}
68 const char* remark(void) const {return m_remark.c_str();}
69 const double detInc(void) const {return m_detInc;}
70 const double rotInc(void) const {return m_rotInc;}
71 const int nDet(void) const {return m_nDet;}
72 const int nView(void) const {return m_nView;}
73 DetectorArray& getDetectorArray (const int iview)
74 { return (*m_projData[iview]); }
77 int m_headerSize; // Size of disk file header
78 int m_geometry; // Geometry of scanner
79 struct DetectorArray **m_projData; // Pointer to array of detarray_st pointers
80 string m_remark; // description of raysum data
81 int m_nDet; // number of detectors in array
82 int m_nView; // number of rotated views
83 double m_calcTime; // time required to calculate raysums
84 double m_rotStart; // starting view rotation
85 double m_rotInc; // angle between rotations
86 double m_detStart; // distance of beginning detector to center phantom
87 double m_detInc; // increment between detectors
88 double m_phmLen; // Length of phantom edge (phm is square)
90 bool headerRead (void);
91 bool headerWrite (void);
92 bool headerRead (fnetorderstream& fs);
93 bool headerWrite (fnetorderstream& fs);
94 void newProjData (void);
95 void deleteProjData (void);
97 void init (const int nView, const int nDet);
99 // prevent default methods
100 Projections& operator= (const Projections& rhs); // assignment
101 Projections(const Projections& rhs); // copy