X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=51a8dea82e94f2924671f0a9998119b055963990;hb=8774e7b513e87e09ba599dfb120c525e2bae2498;hp=e0fa35f2ae1e5b166995b50b83e0cba29651bec8;hpb=1a050c98763fbbc0662731b0b76953acede6f5d7;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index e0fa35f..51a8dea 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -7,9 +7,7 @@ ** Date Started: June 2000 ** ** This is part of the CTSim program -** Copyright (c) 1983-2001 Kevin Rosenberg -** -** $Id$ +** Copyright (c) 1983-2009 Kevin Rosenberg ** ** 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 @@ -384,7 +382,7 @@ ImageFile::subtractImages (const ImageFile& rRHS, ImageFile& result) const return false; } - if (isComplex() || rRHS.isComplex() && ! result.isComplex()) + if (isComplex() || (rRHS.isComplex() && ! result.isComplex())) result.convertRealToComplex(); ImageFileArrayConst vLHS = getArray(); @@ -418,7 +416,7 @@ ImageFile::addImages (const ImageFile& rRHS, ImageFile& result) const return false; } - if (isComplex() || rRHS.isComplex() && ! result.isComplex()) + if (isComplex() || (rRHS.isComplex() && ! result.isComplex())) result.convertRealToComplex(); ImageFileArrayConst vLHS = getArray(); @@ -452,7 +450,7 @@ ImageFile::multiplyImages (const ImageFile& rRHS, ImageFile& result) const return false; } - if (isComplex() || rRHS.isComplex() && ! result.isComplex()) + if (isComplex() || (rRHS.isComplex() && ! result.isComplex())) result.convertRealToComplex(); ImageFileArrayConst vLHS = getArray(); @@ -493,7 +491,7 @@ ImageFile::divideImages (const ImageFile& rRHS, ImageFile& result) const return false; } - if (isComplex() || rRHS.isComplex() && ! result.isComplex()) + if (isComplex() || (rRHS.isComplex() && ! result.isComplex())) result.convertRealToComplex(); ImageFileArrayConst vLHS = getArray(); @@ -700,11 +698,13 @@ ImageFile::scaleImage (ImageFile& result) const double dXPos = ix / dXScale; double dYPos = iy / dYScale; vResult[ix][iy] = realInterp.interpolate (dXPos, dYPos); - if (result.isComplex()) - if (isComplex()) + if (result.isComplex()) { + if (isComplex()) { vResultImag[ix][iy] = imagInterp.interpolate (dXPos, dYPos); - else + } else { vResultImag[ix][iy] = 0; + } + } } }