X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=libctsim%2Fimagefile.cpp;h=7c9e91e267b42159474d8b3bbd67abceb330df9c;hp=d0474045c9055744faa7dcde3a9cf468e213582e;hb=4cdd078f0f198a00e8037e6edec0eb30a6861bae;hpb=134461a6b28beafafdececf7b1f90f4211b56f6b diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index d047404..7c9e91e 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.39 2001/03/02 02:08:14 kevin Exp $ +** $Id: imagefile.cpp,v 1.40 2001/03/07 16:34:47 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 @@ -26,6 +26,9 @@ ******************************************************************************/ #include "ct.h" +#ifdef HAVE_CTN_DICOM +#include "ctndicom.h" +#endif const double ImageFile::s_dRedGrayscaleFactor = 0.299; const double ImageFile::s_dGreenGrayscaleFactor = 0.587; @@ -1565,7 +1568,16 @@ ImageFile::exportImage (const char* const pszFormat, const char* const pszFilena return writeImagePNG (pszFilename, 8, nxcell, nycell, densmin, densmax); else if (iFormatID == EXPORT_FORMAT_PNG16) return writeImagePNG (pszFilename, 16, nxcell, nycell, densmin, densmax); - +#ifdef HAVE_CTN_DICOM + else if (iFormatID == EXPORT_FORMAT_DICOM) { + DicomExporter dicomExport (this); + bool bSuccess = dicomExport.writeFile (pszFilename); + if (! bSuccess) + sys_error (ERR_SEVERE, dicomExport.failMessage().c_str()); + return bSuccess; + } +#endif + sys_error (ERR_SEVERE, "Invalid format %s [ImageFile::exportImage]", pszFormat); return false; }