** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: backprojectors.cpp,v 1.26 2001/02/11 04:56:37 kevin Exp $
+** $Id: backprojectors.cpp,v 1.29 2001/03/01 07:30:49 kevin Exp $
**
** 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
const int Backprojector::BPROJ_DIFF = 2;
const int Backprojector::BPROJ_IDIFF = 3;
-const char* Backprojector::s_aszBackprojectName[] =
+const char* const Backprojector::s_aszBackprojectName[] =
{
{"trig"},
{"table"},
{"idiff"},
};
-const char* Backprojector::s_aszBackprojectTitle[] =
+const char* const Backprojector::s_aszBackprojectTitle[] =
{
{"Direct Trigometric"},
{"Trigometric Table"},
const int Backprojector::INTERP_3BSPLINE = 7;
#endif
-const char* Backprojector::s_aszInterpName[] =
+const char* const Backprojector::s_aszInterpName[] =
{
{"nearest"},
{"linear"},
#endif
};
-const char* Backprojector::s_aszInterpTitle[] =
+const char* const Backprojector::s_aszInterpTitle[] =
{
{"Nearest"},
{"Linear"},
m_pBackprojectImplem->BackprojectView (viewData, viewAngle);
}
+void
+Backprojector::PostProcessing()
+{
+ if (m_pBackprojectImplem != NULL)
+ m_pBackprojectImplem->PostProcessing();
+}
+
Backprojector::~Backprojector ()
{
delete m_pBackprojectImplem;
// Pure virtual base class for all backprojectors.
Backproject::Backproject (const Projections& proj, ImageFile& im, int interpType, const int interpFactor)
-: proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor)
+: proj(proj), im(im), interpType(interpType), m_interpFactor(interpFactor), m_bPostProcessingDone(false)
{
detInc = proj.detInc();
nDet = proj.nDet();
yInc = (yMax - yMin) / ny;
m_dFocalLength = proj.focalLength();
+ m_dSourceDetectorLength = proj.sourceDetectorLength();
}
Backproject::~Backproject ()
{}
+void
+Backproject::PostProcessing()
+{
+ m_bPostProcessingDone = true;
+}
+
void
Backproject::ScaleImageByRotIncrement ()
{
BackprojectTable::~BackprojectTable ()
{
- ScaleImageByRotIncrement();
+}
+
+void
+BackprojectTable::PostProcessing()
+{
+ if (! m_bPostProcessingDone) {
+ ScaleImageByRotIncrement();
+ m_bPostProcessingDone = true;
+ }
}
void
im.arrayDataClear();
}
-BackprojectDiff::~BackprojectDiff()
+BackprojectDiff::~BackprojectDiff ()
{
- ScaleImageByRotIncrement();
}
+void
+BackprojectDiff::PostProcessing()
+{
+ if (! m_bPostProcessingDone) {
+ ScaleImageByRotIncrement();
+ m_bPostProcessingDone = true;
+ }
+}
void
BackprojectDiff::BackprojectView (const double* const filteredProj, const double view_angle)
double dU = (m_dFocalLength + rsin_t) / m_dFocalLength;
double dDetPos = rcos_t / dU;
- // double to scale for imaginary detector that passes through origin
- // of phantom, see Kak-Slaney Figure 3.22. This assumes that the detector is also
- // located focal-length away from the origin.
- dDetPos *= 2;
+ // Scale for imaginary detector that passes through origin of phantom, see Kak-Slaney Figure 3.22.
+ dDetPos *= m_dSourceDetectorLength / m_dFocalLength;
double dPos = dDetPos / detInc; // position along detector array
if (interpType == Backprojector::INTERP_NEAREST) {