X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=946e4db75e17ee766a924939f2237b02a13ee1c7;hb=23f5654dacb1952c15bda92c2606fae3a55e48ad;hp=df0e51ec073981d312bdf265891a909d7125cc3a;hpb=c00c639073653fac7463a88f2b000f263236550d;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index df0e51e..946e4db 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.33 2001/01/02 16:02:13 kevin Exp $ +** $Id: imagefile.cpp,v 1.34 2001/01/04 21:28:41 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 @@ -84,21 +84,29 @@ F64Image::F64Image (void) } void -ImageFile::filterResponse (const char* const domainName, double bw, const char* const filterName, double filt_param, double dInputScale, double dOutputScale) +ImageFile::getCenterCoordinates (unsigned int& iXCenter, unsigned int& iYCenter) { - ImageFileArray v = getArray(); - SignalFilter filter (filterName, domainName, bw, filt_param); - - int iXCenter, iYCenter; if (isEven (m_nx)) iXCenter = m_nx / 2; else iXCenter = (m_nx - 1) / 2; + if (isEven (m_ny)) iYCenter = m_ny / 2; else iYCenter = (m_ny - 1) / 2; +} + + +void +ImageFile::filterResponse (const char* const domainName, double bw, const char* const filterName, double filt_param, double dInputScale, double dOutputScale) +{ + ImageFileArray v = getArray(); + SignalFilter filter (filterName, domainName, bw, filt_param); + unsigned int iXCenter, iYCenter; + getCenterCoordinates (iXCenter, iYCenter); + for (unsigned int ix = 0; ix < m_nx; ix++) for (unsigned int iy = 0; iy < m_ny; iy++) { long lD2 = ((ix - iXCenter) * (ix - iXCenter)) + ((iy - iYCenter) * (iy - iYCenter));