X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=cc7e23489af837a9b99ef30f9f42369abce3b090;hb=6098e67c0181cfe3a60f59fca5cecae9bfa43c97;hp=0b7eb8192f94690020e16dc0135c5f1e1c3b949c;hpb=60de4f91316c2c991d6310ada775c3b926f560e3;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index 0b7eb81..cc7e234 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.30 2001/01/02 07:18:07 kevin Exp $ +** $Id: imagefile.cpp,v 1.32 2001/01/02 10:23:46 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 @@ -89,7 +89,6 @@ ImageFile::filterResponse (const char* const domainName, double bw, const char* ImageFileArray v = getArray(); SignalFilter filter (filterName, domainName, bw, filt_param); -#if 1 int iXCenter, iYCenter; if (isEven (m_nx)) iXCenter = m_nx / 2; @@ -106,18 +105,6 @@ ImageFile::filterResponse (const char* const domainName, double bw, const char* double r = ::sqrt (static_cast(lD2)) * dInputScale; v[ix][iy] = filter.response (r) * dOutputScale; } -#else - int hx = (m_nx - 1) / 2; - int hy = (m_ny - 1) / 2; - - for (int i = -hx; i <= hx; i++) { - for (int j = -hy; j <= hy; j++) { - double r = ::sqrt (i * i + j * j); - - v[i+hx][j+hy] = filter.response (r); - } - } -#endif } int @@ -866,26 +853,16 @@ ImageFile::fourier (ImageFile& result) const complexOut[ix] = new CTSimComplex [m_ny]; // fourier each x column -#if 1 CTSimComplex* pY = new CTSimComplex [m_ny]; for (ix = 0; ix < m_nx; ix++) { for (iy = 0; iy < m_ny; iy++) { double dImag = 0; if (isComplex()) dImag = vLHSImag[ix][iy]; - pY[iy] = complex(vLHS[ix][iy], dImag); + pY[iy] = std::complex(vLHS[ix][iy], dImag); } ProcessSignal::finiteFourierTransform (pY, complexOut[ix], m_ny, ProcessSignal::FORWARD); } -#else - double* pY = new double [m_ny]; - for (ix = 0; ix < m_nx; ix++) { - for (iy = 0; iy < m_ny; iy++) { - pY[iy] = vLHS[ix][iy]; - } - ProcessSignal::finiteFourierTransform (pY, complexOut[ix], m_ny, ProcessSignal::FORWARD); - } -#endif delete [] pY; // fourier each y row @@ -1265,8 +1242,8 @@ ImageFile::writeImagePNG (const char* const outfile, int bitdepth, int nxcell, i rowp[p] = outval; else { int rowpos = p * 2; - rowp[rowpos] = (outval >> 8) & 0xFF; - rowp[rowpos+1] = (outval & 0xFF); + rowp[rowpos+1] = (outval >> 8) & 0xFF; + rowp[rowpos] = (outval & 0xFF); } } }