** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.h,v 1.29 2001/03/10 23:56:58 kevin Exp $
+** $Id: projections.h,v 1.30 2001/03/11 06:34:37 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
public:
double m_dT; // Distance from center of origin
double m_dTheta; // perpendicular angle to origin
- int m_iViewNum; // View number for this raysum
- int m_iDetNum; // Detector number for this raysum
+ double m_dRaysum;
bool lessThanT (ParallelRaysumCoordinate& rCompare)
{return m_dT < rCompare.m_dT; }
bool lessThanTheta (ParallelRaysumCoordinate& rCompare)
{return m_dTheta < rCompare.m_dTheta; }
- static compareByTheta(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
- { return a->m_dTheta > b->m_dTheta; }
+ static bool compareByTheta (ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
+ { return a->m_dTheta == b->m_dTheta ? b->m_dT > a->m_dT : b->m_dTheta > a->m_dTheta; }
- static compareByT(ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
- { return a->m_dT > b->m_dT; }
+ // sort first by T, then Theta
+ static bool compareByT (ParallelRaysumCoordinate* a, ParallelRaysumCoordinate* b)
+ { return a->m_dT == b->m_dT ? b->m_dTheta > a->m_dTheta : b->m_dT > a->m_dT; }
};
void getLimits (double* dMinT, double* dMaxT, double* dMinTheta, double* dMaxTheta) const;
CoordinateContainer& getSortedByT();
CoordinateContainer& getSortedByTheta();
+ double interpolate (double* pdX, double* pdY, int n, double dXValue);
+ void getThetaAndRaysumsForT (int iT, double* pdTheta, double* pdRaysum);
+ void getDetPositions (double* pdDetPos);
private:
CoordinateContainer m_vecpCoordinates;
CoordinateContainer m_vecpSortedByT;
CoordinateContainer m_vecpSortedByTheta;
int m_iNumCoordinates;
+ int m_iNumView;
+ int m_iNumDet;
};
bool detarrayRead (fnetorderstream& fs, DetectorArray& darray, const int view_num);
bool detarrayWrite (fnetorderstream& fs, const DetectorArray& darray, const int view_num);
- bool interpolateToParallel();
+ Projections* interpolateToParallel();
bool convertPolar (ImageFile& rIF, int iInterpolation);
bool convertFFTPolar (ImageFile& rIF, int iInterpolation, int iZeropad);
** This is part of the CTSim program
** Copyright (C) 1983-2000 Kevin Rosenberg
**
-** $Id: scanner.h,v 1.20 2001/03/01 07:30:49 kevin Exp $
+** $Id: scanner.h,v 1.21 2001/03/11 06:34:37 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
double rotInc() const {return m_rotInc;}
double detInc() const {return m_detInc;}
double detLen() const {return m_detLen;}
+ double detStart() const {return m_detStart;}
double focalLength() const {return m_dFocalLength;}
double sourceDetectorLength() const {return m_dSourceDetectorLength;}
double centerDetectorLength() const {return m_dCenterDetectorLength;}
double m_rotLen; // Rotation angle length in radians (norm 2PI)
double m_detInc; // Increment between centers of detectors
double m_rotInc; // Increment in rotation angle between views
+ double m_detStart;
double m_dXCenter; // Center of Phantom
double m_dYCenter;
double m_dAngularDetIncrement;
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.56 2001/03/10 23:56:58 kevin Exp $
+** $Id: projections.cpp,v 1.57 2001/03/11 06:34:37 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
m_rotInc = scanner.rotInc();
m_detInc = scanner.detInc();
+ m_detStart = scanner.detStart();
m_geometry = scanner.geometry();
m_dFocalLength = scanner.focalLength();
m_dSourceDetectorLength = scanner.sourceDetectorLength();
m_dViewDiameter = scanner.viewDiameter();
m_rotStart = 0;
- m_detStart = -(scanner.detLen() / 2);
m_dFanBeamAngle = scanner.fanBeamAngle();
}
return true;
}
+Projections*
+Projections::interpolateToParallel ()
+{
+ if (m_geometry == Scanner::GEOMETRY_PARALLEL)
+ return this;
+
+ int nDet = m_nDet;
+ int nView = m_nView;
+ Projections* pProjNew = new Projections (nView, nDet);
+ pProjNew->m_geometry = Scanner::GEOMETRY_PARALLEL;
+ pProjNew->m_dFocalLength = m_dFocalLength;
+ pProjNew->m_dSourceDetectorLength = m_dSourceDetectorLength;
+ pProjNew->m_dViewDiameter = m_dViewDiameter;
+ pProjNew->m_dFanBeamAngle = m_dFanBeamAngle;
+ pProjNew->m_calcTime = 0;
+ pProjNew->m_remark = m_remark;
+ pProjNew->m_remark += "; Interpolate to Parallel";
+ pProjNew->m_label.setLabelType (Array2dFileLabel::L_HISTORY);
+ pProjNew->m_label.setLabelString (pProjNew->m_remark);
+ pProjNew->m_label.setCalcTime (pProjNew->m_calcTime);
+ pProjNew->m_label.setDateTime (pProjNew->m_year, pProjNew->m_month, pProjNew->m_day, pProjNew->m_hour, pProjNew->m_minute, pProjNew->m_second);
+
+ pProjNew->m_rotStart = 0;
+ pProjNew->m_rotInc = PI / nView;;
+ pProjNew->m_detStart = -m_dViewDiameter / 2;
+ pProjNew->m_detInc = m_dViewDiameter / nDet;
+ if (nDet % 2 == 0) // even
+ pProjNew->m_detInc = m_dViewDiameter / (nDet - 1);
+
+ ParallelRaysums parallel (this);
+
+ double* pdThetaValuesForT = new double [pProjNew->nView()];
+ double* pdRaysumsForT = new double [pProjNew->nView()];
+
+ // interpolate to evenly spaced theta (views)
+ double dDetPos = pProjNew->m_detStart;
+ for (int iD = 0; iD < pProjNew->nDet(); iD++, dDetPos += pProjNew->m_detInc) {
+ parallel.getThetaAndRaysumsForT (iD, pdThetaValuesForT, pdRaysumsForT);
+
+ double dViewAngle = m_rotStart;
+ for (int iV = 0; iV < pProjNew->nView(); iV++, dViewAngle += pProjNew->m_rotInc) {
+ DetectorValue* detValues = pProjNew->getDetectorArray (iV).detValues();
+
+ detValues[iD] = parallel.interpolate (pdThetaValuesForT, pdRaysumsForT, pProjNew->nView(), dViewAngle);
+ }
+ }
+ delete pdThetaValuesForT;
+ delete pdRaysumsForT;
+
+ // interpolate to evenly space t (detectors)
+ double* pdOriginalDetPositions = new double [pProjNew->nDet()];
+ parallel.getDetPositions (pdOriginalDetPositions);
+
+ double* pdDetValueCopy = new double [pProjNew->nDet()];
+ double dViewAngle = m_rotStart;
+ for (int iV = 0; iV < pProjNew->nView(); iV++, dViewAngle += pProjNew->m_rotInc) {
+ DetectorArray& detArray = pProjNew->getDetectorArray (iV);
+ DetectorValue* detValues = detArray.detValues();
+ detArray.setViewAngle (dViewAngle);
+
+ for (int i = 0; i < pProjNew->nDet(); i++)
+ pdDetValueCopy[i] = detValues[i];
+
+ double dDetPos = pProjNew->m_detStart;
+ for (int iD = 0; iD < pProjNew->nDet(); iD++, dDetPos += pProjNew->m_detInc) {
+ detValues[iD] = parallel.interpolate (pdOriginalDetPositions, pdDetValueCopy, pProjNew->nDet(), dDetPos);
+ }
+ }
+ delete pdDetValueCopy;
+ delete pdOriginalDetPositions;
+
+ return pProjNew;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Class ParallelRaysums
+//
+// Used for converting divergent beam raysums into Parallel raysums
+//
+///////////////////////////////////////////////////////////////////////////////
ParallelRaysums::ParallelRaysums (Projections* pProjections)
-: m_iNumCoordinates(0)
+: m_iNumCoordinates(0), m_iNumView(pProjections->nView()), m_iNumDet(pProjections->nDet())
{
- int nDet = pProjections->nDet();
- int nView = pProjections->nView();
int iGeometry = pProjections->geometry();
double dDetInc = pProjections->detInc();
double dDetStart = pProjections->detStart();
double dFocalLength = pProjections->focalLength();
- m_iNumCoordinates = nDet * nView;
+ m_iNumCoordinates = m_iNumView * m_iNumDet;
m_vecpCoordinates.reserve (m_iNumCoordinates);
for (int i = 0; i < m_iNumCoordinates; i++)
m_vecpCoordinates[i] = new ParallelRaysumCoordinate;
int iCoordinate = 0;
- for (int iV = 0; iV < nView; iV++) {
+ for (int iV = 0; iV < m_iNumView; iV++) {
double dViewAngle = pProjections->getDetectorArray(iV).viewAngle();
+ const DetectorValue* detValues = pProjections->getDetectorArray(iV).detValues();
double dDetPos = dDetStart;
- for (int iD = 0; iD < nDet; iD++) {
+ for (int iD = 0; iD < m_iNumDet; iD++) {
ParallelRaysumCoordinate* pC = m_vecpCoordinates[iCoordinate++];
if (iGeometry == Scanner::GEOMETRY_PARALLEL) {
pC->m_dTheta = normalizeAngle (dViewAngle);
pC->m_dT = dDetPos;
-
} else if (iGeometry == Scanner::GEOMETRY_EQUILINEAR) {
double dFanAngle = atan (dDetPos / pProjections->sourceDetectorLength());
pC->m_dTheta = normalizeAngle (dViewAngle + dFanAngle);
pC->m_dTheta = normalizeAngle (dViewAngle + dDetPos);
pC->m_dT = dFocalLength * sin (dDetPos);
}
+ if (pC->m_dTheta >= PI) { // convert T/Theta to 0-PI interval
+ pC->m_dTheta -= PI;
+ pC->m_dT = -pC->m_dT - pProjections->detInc();
+ }
+ pC->m_dRaysum = detValues[iD];
dDetPos += dDetInc;
}
}
ParallelRaysums::getSortedByTheta()
{
if (m_vecpSortedByTheta.size() == 0) {
- m_vecpSortedByTheta.reserve (m_iNumCoordinates);
+ m_vecpSortedByTheta.resize (m_iNumCoordinates);
for (int i = 0; i < m_iNumCoordinates; i++)
m_vecpSortedByTheta[i] = m_vecpCoordinates[i];
std::sort (m_vecpSortedByTheta.begin(), m_vecpSortedByTheta.end(), ParallelRaysumCoordinate::compareByTheta);
ParallelRaysums::getSortedByT()
{
if (m_vecpSortedByT.size() == 0) {
- m_vecpSortedByT.reserve (m_iNumCoordinates);
+ m_vecpSortedByT.resize (m_iNumCoordinates);
for (int i = 0; i < m_iNumCoordinates; i++)
m_vecpSortedByT[i] = m_vecpCoordinates[i];
std::sort (m_vecpSortedByT.begin(), m_vecpSortedByT.end(), ParallelRaysumCoordinate::compareByT);
*dMaxTheta = dTheta;
}
}
+
+void
+ParallelRaysums::getThetaAndRaysumsForT (int iTheta, double* pTheta, double* pRaysum)
+{
+ const CoordinateContainer& coordsT = getSortedByT();
+
+ int iBase = iTheta * m_iNumView;
+ for (int i = 0; i < m_iNumView; i++) {
+ int iPos = iBase + i;
+ pTheta[i] = coordsT[iPos]->m_dTheta;
+ pRaysum[i] = coordsT[iPos]->m_dRaysum;
+ }
+}
+
+void
+ParallelRaysums::getDetPositions (double* pdDetPos)
+{
+ const CoordinateContainer& coordsT = getSortedByT();
+
+ int iPos = 0;
+ for (int i = 0; i < m_iNumDet; i++) {
+ pdDetPos[i] = coordsT[iPos]->m_dT;
+ iPos += m_iNumView;
+ }
+}
+
+// locate by bisection, O(log2(n))
+double
+ParallelRaysums::interpolate (double* pdX, double* pdY, int n, double dX)
+{
+ int iLower = -1;
+ int iUpper = n;
+
+ while (iUpper - iLower > 1) {
+ int iMiddle = (iUpper + iLower) >> 1;
+ if (dX >= pdX[iMiddle])
+ iLower = iMiddle;
+ else
+ iUpper = iMiddle;
+ }
+ if (dX <= pdX[0])
+ return pdY[0];
+ else if (dX >= pdX[n-1])
+ return pdY[1];
+
+ if (iLower < 0 || iLower >= n) {
+ sys_error (ERR_SEVERE, "Coordinate out of range [locateThetaBase]");
+ return 0;
+ }
+
+ return pdY[iLower] + (pdY[iUpper] - pdY[iLower]) * ((dX - pdX[iLower]) / (pdX[iUpper] - pdX[iLower]));
+}
+
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: scanner.cpp,v 1.34 2001/03/10 23:14:16 kevin Exp $
+** $Id: scanner.cpp,v 1.35 2001/03/11 06:34:37 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
if (m_idGeometry == GEOMETRY_PARALLEL) {
m_dFanBeamAngle = 0;
m_detLen = m_dScanDiameter;
+ m_detStart = -m_detLen / 2;
m_detInc = m_detLen / m_nDet;
double dDetectorArrayEndOffset = 0;
// For even number of detectors, make detInc slightly larger so that center lies
m_initPos.xd2 = m_dXCenter + dHalfDetLen + dDetectorArrayEndOffset;
m_initPos.yd2 = m_dYCenter - m_dCenterDetectorLength;
m_initPos.angle = 0.0;
+ m_detLen += dDetectorArrayEndOffset;
} else if (m_idGeometry == GEOMETRY_EQUILINEAR) {
if (m_dScanDiameter / 2 >= m_dFocalLength) {
m_fail = true;
const double dHalfDetLen = m_dSourceDetectorLength * tan (dAngle);
m_detLen = dHalfDetLen * 2;
+ m_detStart = -dHalfDetLen;
m_detInc = m_detLen / m_nDet;
double dDetectorArrayEndOffset = 0;
if (m_nDet % 2 == 0) { // Adjust for Even number of detectors
m_detInc = m_detLen / (m_nDet - 1); // center detector = (nDet/2)
dDetectorArrayEndOffset = m_detInc;
+ m_detLen += dDetectorArrayEndOffset;
}
m_dFanBeamAngle = dAngle * 2;
const double dAngle = asin ((m_dScanDiameter / 2) / m_dFocalLength);
m_detLen = 2 * dAngle;
+ m_detStart = -dAngle;
m_detInc = m_detLen / m_nDet;
double dDetectorArrayEndOffset = 0;
if (m_nDet % 2 == 0) { // Adjust for Even number of detectors
m_initPos.ys1 = m_dYCenter + m_dFocalLength;;
m_initPos.xs2 = m_dXCenter;
m_initPos.ys2 = m_dYCenter + m_dFocalLength;
+ m_detLen += dDetectorArrayEndOffset;
}
// Calculate incrementatal rotation matrix
--------------------Configuration: libctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EE.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP377.tmp" with contents
[
/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /D VERSION=\"3.1.0\" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\ctsim\libctsim\projections.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EE.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EF.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP377.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP378.tmp" with contents
[
/nologo /out:"Debug\libctsim.lib"
.\Debug\array2dfile.obj
.\Debug\transformmatrix.obj
.\Debug\xform.obj
]
-Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1EF.tmp"
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP378.tmp"
<h3>Output Window</h3>
Compiling...
projections.cpp
--------------------Configuration: ctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1F0.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP379.tmp" with contents
[
winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug"
.\Debug\backgroundmgr.obj
\wx2.2.5\lib\zlibd.lib
\wx2.2.5\lib\tiffd.lib
]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1F0.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP379.tmp"
<h3>Output Window</h3>
Linking...
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: backgroundmgr.cpp,v 1.15 2001/03/09 21:31:51 kevin Exp $
+** $Id: backgroundmgr.cpp,v 1.16 2001/03/11 06:34:37 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
m_sizeCell.Set (m_sizeGauge.x + m_sizeLabel.x + m_sizeCellSpacing.x + m_sizeButton.x, 25);
+ theApp->getMainFrame()->SetFocus();
Show(false);
}
resizeWindow();
if (m_iNumTasks == 1) {
- SetFocus();
+ theApp->getMainFrame()->SetFocus();
Show(true);
- theApp->getMainFrame()->SetFocus(); // necessary to keep wxWindows from crashing
+ theApp->getMainFrame()->SetFocus();
}
}
}
pSupervisor->ackRemoveBackgroundManager();
resizeWindow();
- if (m_iNumTasks <= 0)
+ if (m_iNumTasks <= 0) {
+ theApp->getMainFrame()->SetFocus();
Show(false);
+ theApp->getMainFrame()->SetFocus();
+ }
}
void
** This is part of the CTSim program
** Copyright (C) 1983-2001 Kevin Rosenberg
**
-** $Id: backgroundsupr.cpp,v 1.18 2001/03/09 21:31:51 kevin Exp $
+** $Id: backgroundsupr.cpp,v 1.19 2001/03/11 06:34:37 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
m_iNumThreads = theApp->getNumberCPU();
// ++m_iNumThreads;
- m_vecpThreads.reserve (m_iNumThreads);
+ m_vecpThreads.resize (m_iNumThreads);
for (int iThread = 0; iThread < m_iNumThreads; iThread++)
m_vecpThreads[iThread] = NULL;
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ctsim.h,v 1.56 2001/03/10 23:14:16 kevin Exp $
+** $Id: ctsim.h,v 1.57 2001/03/11 06:34:37 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
PJMENU_RECONSTRUCT_FOURIER,
PJMENU_CONVERT_POLAR,
PJMENU_CONVERT_FFT_POLAR,
+ PJMENU_CONVERT_PARALLEL,
PJMENU_PLOT_TTHETA_SAMPLING,
+ PJMENU_ARTIFACT_REDUCTION,
IFMENU_FILE_EXPORT,
IFMENU_FILE_PROPERTIES,
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.cpp,v 1.131 2001/03/10 23:56:58 kevin Exp $
+** $Id: views.cpp,v 1.132 2001/03/11 06:34:37 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
EVT_MENU(PJMENU_RECONSTRUCT_FOURIER, ProjectionFileView::OnReconstructFourier)
EVT_MENU(PJMENU_CONVERT_POLAR, ProjectionFileView::OnConvertPolar)
EVT_MENU(PJMENU_CONVERT_FFT_POLAR, ProjectionFileView::OnConvertFFTPolar)
+EVT_MENU(PJMENU_CONVERT_PARALLEL, ProjectionFileView::OnConvertParallel)
EVT_MENU(PJMENU_PLOT_TTHETA_SAMPLING, ProjectionFileView::OnPlotTThetaSampling)
+EVT_MENU(PJMENU_ARTIFACT_REDUCTION, ProjectionFileView::OnArtifactReduction)
END_EVENT_TABLE()
+
ProjectionFileView::ProjectionFileView()
: wxView(), m_pFrame(0), m_pCanvas(0), m_pFileMenu(0)
{
ImageFile* pIF = new ImageFile (m_iDefaultPolarNX, m_iDefaultPolarNY);
m_iDefaultPolarInterpolation = Projections::convertInterpNameToID (strInterpolation.c_str());
- if (! rProj.convertPolar (*pIF, m_iDefaultPolarInterpolation)) {
+ if (! rProj.convertPolar (*pIF, m_iDefaultPolarInterpolation)) {
delete pIF;
*theApp->getLog() << "Error converting to Polar\n";
return;
}
-
pPolarDoc = theApp->newImageDoc ();
if (! pPolarDoc) {
sys_error (ERR_SEVERE, "Unable to create image file");
return;
}
+void
+ProjectionFileView::OnConvertParallel (wxCommandEvent& event)
+{
+ Projections& rProj = GetDocument()->getProjections();
+ if (rProj.geometry() == Scanner::GEOMETRY_PARALLEL) {
+ wxMessageBox ("Projections are already parallel", "Error");
+ return;
+ }
+ Projections* pProjNew = rProj.interpolateToParallel();
+ ProjectionFileDocument* pProjDocNew = theApp->newProjectionDoc();
+ pProjDocNew->setProjections (pProjNew);
+
+ if (ProjectionFileView* projView = pProjDocNew->getView()) {
+ projView->OnUpdate (projView, NULL);
+ if (projView->getCanvas())
+ projView->getCanvas()->SetClientSize (pProjNew->nDet(), pProjNew->nView());
+ if (wxFrame* pFrame = projView->getFrame()) {
+ pFrame->Show(true);
+ pFrame->SetFocus();
+ pFrame->Raise();
+ }
+ GetDocumentManager()->ActivateView (projView, true, false);
+ }
+ if (theApp->getAskDeleteNewDocs())
+ pProjDocNew-> Modify(true);
+ pProjDocNew->UpdateAllViews (this);
+}
+
void
ProjectionFileView::OnReconstructFourier (wxCommandEvent& event)
{
}
+void
+ProjectionFileView::OnArtifactReduction (wxCommandEvent& event)
+{
+}
+
+
ProjectionFileCanvas*
ProjectionFileView::CreateCanvas (wxFrame *parent)
{
wxMenu *convert_menu = new wxMenu;
convert_menu->Append (PJMENU_CONVERT_POLAR, "&Polar Image...\tCtrl-L");
convert_menu->Append (PJMENU_CONVERT_FFT_POLAR, "&FFT->Polar Image...\tCtrl-M");
+ convert_menu->AppendSeparator();
+ convert_menu->Append (PJMENU_CONVERT_PARALLEL, "&Interpolate to Parallel");
+
+ wxMenu* filter_menu = new wxMenu;
+ filter_menu->Append (PJMENU_ARTIFACT_REDUCTION, "&Artifact Reduction");
wxMenu* analyze_menu = new wxMenu;
analyze_menu->Append (PJMENU_PLOT_TTHETA_SAMPLING, "&Plot T-Theta Sampling\tCtrl-T");
menu_bar->Append (m_pFileMenu, "&File");
menu_bar->Append (convert_menu, "&Convert");
+ menu_bar->Append (filter_menu, "Fi<er");
menu_bar->Append (analyze_menu, "&Analyze");
menu_bar->Append (reconstruct_menu, "&Reconstruct");
menu_bar->Append (help_menu, "&Help");
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: views.h,v 1.48 2001/03/10 23:14:16 kevin Exp $
+** $Id: views.h,v 1.49 2001/03/11 06:34:37 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
void OnConvertPolar (wxCommandEvent& event);
void OnConvertFFTPolar (wxCommandEvent& event);
void OnPlotTThetaSampling (wxCommandEvent& event);
-
+ void OnConvertParallel (wxCommandEvent& event);
+ void OnArtifactReduction (wxCommandEvent& event);
+
#if CTSIM_MDI
wxDocMDIChildFrame* getFrame() { return m_pFrame; }
#else