r354: Added Projection Polar conversions
[ctsim.git] / libctsim / imagefile.cpp
index df0e51ec073981d312bdf265891a909d7125cc3a..946e4db75e17ee766a924939f2237b02a13ee1c7 100644 (file)
@@ -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));