projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r10623: changes for etch
[ctsim.git]
/
src
/
views.cpp
diff --git
a/src/views.cpp
b/src/views.cpp
index cb7663780813ec236fda07c4c46d4a647c7e58c4..1fe4bbfbbc2c71facb551f464b64bc7dec8a4b36 100644
(file)
--- a/
src/views.cpp
+++ b/
src/views.cpp
@@
-9,7
+9,7
@@
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id
: views.cpp,v 1.171 2003/03/15 10:27:30 kevin Exp
$
+** $Id$
**
** 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
**
** 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
@@
-1560,19
+1560,19
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
int ny = rIF.ny();
if (v != NULL && yCursor < ny) {
int ny = rIF.ny();
if (v != NULL && yCursor < ny) {
- fftw_complex* pcIn =
new fftw_complex [nx]
;
+ fftw_complex* pcIn =
static_cast<fftw_complex*>(fftw_malloc (sizeof(fftw_complex) * nx))
;
int i;
for (i = 0; i < nx; i++) {
int i;
for (i = 0; i < nx; i++) {
- pcIn[i]
.re
= v[i][yCursor];
+ pcIn[i]
[0]
= v[i][yCursor];
if (rIF.isComplex())
if (rIF.isComplex())
- pcIn[i]
.im
= vImag[i][yCursor];
+ pcIn[i]
[1]
= vImag[i][yCursor];
else
else
- pcIn[i]
.im
= 0;
+ pcIn[i]
[1]
= 0;
}
}
- fftw_plan plan = fftw_
create_plan (nx, FFTW_FORWARD, FFTW_IN_PLACE | FFTW_ESTIMATE | FFTW_USE_WISDOM
);
- fftw_
one (plan, pcIn, NULL
);
+ fftw_plan plan = fftw_
plan_dft_1d (nx, pcIn, pcIn, FFTW_FORWARD, FFTW_ESTIMATE
);
+ fftw_
execute (plan
);
fftw_destroy_plan (plan);
double* pX = new double [nx];
fftw_destroy_plan (plan);
double* pX = new double [nx];
@@
-1581,9
+1581,9
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
double* pYMag = new double [nx];
for (i = 0; i < nx; i++) {
pX[i] = i;
double* pYMag = new double [nx];
for (i = 0; i < nx; i++) {
pX[i] = i;
- pYReal[i] = pcIn[i]
.re
/ nx;
- pYImag[i] = pcIn[i]
.im
/ nx;
- pYMag[i] = ::sqrt (pcIn[i]
.re * pcIn[i].re + pcIn[i].im * pcIn[i].im
);
+ pYReal[i] = pcIn[i]
[0]
/ nx;
+ pYImag[i] = pcIn[i]
[1]
/ nx;
+ pYMag[i] = ::sqrt (pcIn[i]
[0] * pcIn[i][0] + pcIn[i][1] * pcIn[i][1]
);
}
Fourier::shuffleFourierToNaturalOrder (pYReal, nx);
Fourier::shuffleFourierToNaturalOrder (pYImag, nx);
}
Fourier::shuffleFourierToNaturalOrder (pYReal, nx);
Fourier::shuffleFourierToNaturalOrder (pYImag, nx);
@@
-1628,7
+1628,7
@@
ImageFileView::OnPlotFFTRow (wxCommandEvent& event)
delete pYReal;
delete pYImag;
delete pYMag;
delete pYReal;
delete pYImag;
delete pYMag;
-
delete [] pcIn
;
+
fftw_free(pcIn)
;
if (theApp->getAskDeleteNewDocs())
pPlotDoc->Modify (true);
if (theApp->getAskDeleteNewDocs())
pPlotDoc->Modify (true);
@@
-1662,7
+1662,7
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
pdTemp[i] = v[xCursor][i];
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
pdTemp[i] = v[xCursor][i];
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
- pcIn[i]
.re
= pdTemp[i];
+ pcIn[i]
[0]
= pdTemp[i];
for (i = 0; i < ny; i++) {
if (rIF.isComplex())
for (i = 0; i < ny; i++) {
if (rIF.isComplex())
@@
-1672,10
+1672,10
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
}
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
}
Fourier::shuffleNaturalToFourierOrder (pdTemp, ny);
for (i = 0; i < ny; i++)
- pcIn[i]
.im
= pdTemp[i];
+ pcIn[i]
[1]
= pdTemp[i];
- fftw_plan plan = fftw_
create_plan (ny, FFTW_BACKWARD, FFTW_IN_PLACE | FFTW_ESTIMATE | FFTW_USE_WISDOM
);
- fftw_
one (plan, pcIn, NULL
);
+ fftw_plan plan = fftw_
plan_dft_1d (ny, pcIn, pcIn, FFTW_BACKWARD, FFTW_ESTIMATE
);
+ fftw_
execute (plan
);
fftw_destroy_plan (plan);
double* pX = new double [ny];
fftw_destroy_plan (plan);
double* pX = new double [ny];
@@
-1684,9
+1684,9
@@
ImageFileView::OnPlotFFTCol (wxCommandEvent& event)
double* pYMag = new double [ny];
for (i = 0; i < ny; i++) {
pX[i] = i;
double* pYMag = new double [ny];
for (i = 0; i < ny; i++) {
pX[i] = i;
- pYReal[i] = pcIn[i]
.re
/ ny;
- pYImag[i] = pcIn[i]
.im
/ ny;
- pYMag[i] = ::sqrt (pcIn[i]
.re * pcIn[i].re + pcIn[i].im * pcIn[i].im
);
+ pYReal[i] = pcIn[i]
[0]
/ ny;
+ pYImag[i] = pcIn[i]
[1]
/ ny;
+ pYMag[i] = ::sqrt (pcIn[i]
[0] * pcIn[i][0] + pcIn[i][1] * pcIn[i][1]
);
}
PlotFileDocument* pPlotDoc = theApp->newPlotDoc();
}
PlotFileDocument* pPlotDoc = theApp->newPlotDoc();
@@
-2597,7
+2597,6
@@
ProjectionFileView::OnConvertPolar (wxCommandEvent& event)
wxString strInterpolation (dialogPolar.getInterpolationName());
m_iDefaultPolarNX = dialogPolar.getXSize();
m_iDefaultPolarNY = dialogPolar.getYSize();
wxString strInterpolation (dialogPolar.getInterpolationName());
m_iDefaultPolarNX = dialogPolar.getXSize();
m_iDefaultPolarNY = dialogPolar.getYSize();
- ImageFileDocument* pPolarDoc = theApp->newImageDoc();
ImageFile* pIF = new ImageFile (m_iDefaultPolarNX, m_iDefaultPolarNY);
m_iDefaultPolarInterpolation = Projections::convertInterpNameToID (strInterpolation.c_str());
ImageFile* pIF = new ImageFile (m_iDefaultPolarNX, m_iDefaultPolarNY);
m_iDefaultPolarInterpolation = Projections::convertInterpNameToID (strInterpolation.c_str());
@@
-2607,7
+2606,7
@@
ProjectionFileView::OnConvertPolar (wxCommandEvent& event)
return;
}
return;
}
-
pPolarDoc = theApp->newImageDoc
();
+
ImageFileDocument* pPolarDoc = theApp->newImageDoc
();
if (! pPolarDoc) {
sys_error (ERR_SEVERE, "Unable to create image file");
return;
if (! pPolarDoc) {
sys_error (ERR_SEVERE, "Unable to create image file");
return;