X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=d0474045c9055744faa7dcde3a9cf468e213582e;hb=52f2fdc3424cd6b5b77ad1497243e1e06739ffe6;hp=134a0c59f2ed525762ec893f118402c39511b452;hpb=c358b8c8b5649f14e2b8203b999ba8549a244727;p=ctsim.git diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index 134a0c5..d047404 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: imagefile.cpp,v 1.38 2001/03/01 20:02:18 kevin Exp $ +** $Id: imagefile.cpp,v 1.39 2001/03/02 02:08:14 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 @@ -644,7 +644,7 @@ bool ImageFile::log (ImageFile& result) const { if (m_nx != result.nx() || m_ny != result.ny()) { - sys_error (ERR_WARNING, "Difference sizes of images [ImageFile::invertPixelValues]"); + sys_error (ERR_WARNING, "Difference sizes of images [ImageFile::log]"); return false; } @@ -666,8 +666,12 @@ ImageFile::log (ImageFile& result) const std::complex cResult = std::log (cLHS); vResult[ix][iy] = cResult.real(); vResultImag[ix][iy] = cResult.imag(); - } else - vResult[ix][iy] = ::log (vLHS[ix][iy]); + } else { + if (vLHS[ix][iy] > 0) + vResult[ix][iy] = ::log (vLHS[ix][iy]); + else + vResult[ix][iy] = 0; + } } } @@ -1310,21 +1314,11 @@ ImageFile::importImage (const char* const pszFormat, const char* const pszFilena else if (iFormatID == IMPORT_FORMAT_PNG) return readImagePNG (pszFilename); #endif -#ifdef HAVE_CTN_DICOM - else if (iFormatID == IMPORT_FORMAT_DICOM) - return readImageDicom (pszFilename); -#endif sys_error (ERR_SEVERE, "Invalid format %s [ImageFile::importImage]", pszFormat); return false; } -bool -ImageFile::readImageDicom (const char* const pszFile) -{ - return false; -} - void ImageFile::skipSpacePPM (FILE* fp) {