on SMP systems.
* ctsim: Added PPM/PGM and PNG file import to imagefile.
+
+ * ctsim: Added import of DICOM grayscale files.
* ctsim: Added background and SMP processing for reconstructions.
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ct.h,v 1.57 2001/02/11 04:56:37 kevin Exp $
+** $Id: ct.h,v 1.58 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
#include "reconstruct.h"
#include "plotfile.h"
#include "trace.h"
+#ifdef HAVE_CTN_DICOM
+#include "ctndicom.h"
+#endif
#include "ctglobals.h"
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ctndicom.h,v 1.1 2001/03/01 07:30:49 kevin Exp $
+** $Id: ctndicom.h,v 1.2 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
#define _CTNDICOM_H_
#if HAVE_CTN_DICOM
+#include <string>
+
+#include "dicom.h"
+#include "condition.h"
+#include "lst.h"
+#include "dicom_objects.h"
+
+class ImageFile;
+class Projections;
+
+class DicomImporter {
+private:
+ std::string m_strFilename;
+ bool m_bFail;
+ std::string m_strFailMessage;
+ int m_iContents;
+ ImageFile* m_pImageFile;
+ Projections* m_pProjections;
+ DCM_OBJECT* m_pFile;
+
+ void loadImage(unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated,
+ unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep);
+
+ void loadProjections();
+
+ enum {
+ TAG_GROUP_SOMATOM = 0x7fe1,
+ TAG_MEMBER_SOMATOM_DATA = 0x1000,
+ };
+
+public:
+ enum {
+ DICOM_CONTENTS_INVALID = -1,
+ DICOM_CONTENTS_IMAGE,
+ DICOM_CONTENTS_PROJECTIONS,
+ };
+
+ DicomImporter (const char* const pszFile);
+ ~DicomImporter();
+
+ bool testImage() const {return m_iContents == DICOM_CONTENTS_IMAGE;}
+ bool testProjections() const {return m_iContents == DICOM_CONTENTS_PROJECTIONS;}
+ bool fail() const {return m_bFail;}
+ const std::string& failMessage() const {return m_strFailMessage;}
+
+ ImageFile* getImageFile() const {return m_pImageFile;}
+ Projections* getProjections() const {return m_pProjections;}
+};
#endif // HAVE_CTN_DICOM
#endif // _CTNDICOM_H_
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: imagefile.h,v 1.32 2001/03/01 20:02:18 kevin Exp $
+** $Id: imagefile.h,v 1.33 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
bool writeImagePGM (const char* const outfile, int nxcell, int nycell, double densmin, double densmax);
bool writeImagePGMASCII (const char* const outfile, int nxcell, int nycell, double densmin, double densmax);
bool readImagePPM (const char* const pszFile);
-#if HAVE_CTN_DICOM
- bool readImageDicom (const char* const pszFile);
-#endif
static double redGrayscaleFactor() {return s_dRedGrayscaleFactor;}
static double greenGrayscaleFactor() {return s_dGreenGrayscaleFactor;}
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.h,v 1.26 2001/03/01 07:30:49 kevin Exp $
+** $Id: projections.h,v 1.27 2001/03/02 02:08:14 kevin Exp $
**
**
** This program is free software; you can redistribute it and/or modify
static const char* convertInterpIDToTitle (const int interpID);
void initFromScanner (const Scanner& scanner);
+ bool initFromSomatomAR_STAR (int iNViews, int iNDets, unsigned char* pData, unsigned long lDataLength);
void printProjectionData (int startView, int endView);
void printProjectionData ();
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ctndicom.cpp,v 1.2 2001/03/01 20:02:18 kevin Exp $
+** $Id: ctndicom.cpp,v 1.3 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
#endif
#ifdef HAVE_CTN_DICOM
-#include "ctndicom.h"
+#include "ctndicom.h"
+
+#include "imagefile.h"
+#include "projections.h"
+
+
+DicomImporter::DicomImporter (const char* const pszFile)
+ : m_strFilename(pszFile), m_bFail(false), m_iContents(DICOM_CONTENTS_INVALID),
+ m_pImageFile(NULL), m_pProjections(NULL)
+{
+ unsigned long lOptions = DCM_ORDERLITTLEENDIAN;
+ DCM_Debug (FALSE);
+ if (DCM_OpenFile (pszFile, lOptions, &m_pFile) != DCM_NORMAL) {
+ m_bFail = true;;
+ m_strFailMessage = "Can't open file ";
+ m_strFailMessage += m_strFilename;
+ return;
+ }
+
+ unsigned short iNRows, iNCols, iBitsAllocated, iBitsStored, iHighBit, iPixRep;
+ DCM_ELEMENT aElemRequired[] = {
+ {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNRows), reinterpret_cast<char*>(&iNRows)},
+ {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNCols), reinterpret_cast<char*>(&iNCols)},
+ {DCM_IMGBITSALLOCATED, DCM_US, "", 1, sizeof(iBitsAllocated), reinterpret_cast<char*>(&iBitsAllocated)},
+ {DCM_IMGBITSSTORED, DCM_US, "", 1, sizeof(iBitsStored), reinterpret_cast<char*>(&iBitsStored)},
+ {DCM_IMGHIGHBIT, DCM_US, "", 1, sizeof(iHighBit), reinterpret_cast<char*>(&iHighBit)},
+ {DCM_IMGPIXELREPRESENTATION, DCM_US, "", 1, sizeof(iPixRep), reinterpret_cast<char*>(&iPixRep)},
+ };
+ int nElemRequired = sizeof (aElemRequired) / sizeof(DCM_ELEMENT);
+
+ if (DCM_ParseObject (&m_pFile, aElemRequired, nElemRequired, NULL, 0, NULL) == DCM_NORMAL) {
+ loadImage (iNRows, iNCols, iBitsAllocated, iBitsStored, iHighBit, iPixRep);
+ return;
+ }
+ unsigned long lRtnLength;
+ DCM_TAG somatomTag = DCM_MAKETAG(TAG_GROUP_SOMATOM, TAG_MEMBER_SOMATOM_DATA);
+ if (DCM_GetElementSize (&m_pFile, somatomTag, &lRtnLength) == DCM_NORMAL)
+ loadProjections();
+}
+
+void
+DicomImporter::loadImage(unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated,
+ unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep)
+{
+ unsigned long lRtnLength;
+ unsigned short iSamplesPerPixel, iPlanarConfig;
+
+ DCM_ELEMENT elemPlanarConfig = {DCM_IMGPLANARCONFIGURATION, DCM_US, "", 1, sizeof(iPlanarConfig),
+ reinterpret_cast<char*>(&iPlanarConfig)};
+ DCM_ELEMENT elemSamplesPerPixel = {DCM_IMGSAMPLESPERPIXEL, DCM_US, "", 1,
+ sizeof(iSamplesPerPixel), reinterpret_cast<char*>(&iSamplesPerPixel)};
+
+ if (DCM_ParseObject (&m_pFile, &elemSamplesPerPixel, 1, NULL, 0, NULL) != DCM_NORMAL)
+ iSamplesPerPixel = 1; // default value
+
+ if (iSamplesPerPixel > 1) {
+ void* ctx = NULL;
+ if (DCM_GetElementValue (&m_pFile, &elemPlanarConfig, &lRtnLength, &ctx) != DCM_NORMAL) {
+ m_bFail = true;
+ m_strFailMessage = "Planar Configuration not specified when iSamplesPerPixel > 1";
+ }
+ }
+
+ DCM_ELEMENT elemPixelData = {DCM_PXLPIXELDATA, DCM_OT, "", 1, 0, NULL};
+
+ // Get the actual pixel data (the only other required element)
+ if (DCM_GetElementSize (&m_pFile, elemPixelData.tag, &lRtnLength) != DCM_NORMAL) {
+ m_bFail = true;
+ m_strFailMessage = "Can't get pixel data size";
+ return;
+ }
+
+ // Check the size of the pixel data to make sure we have the correct amount...
+ unsigned long lRealLength = lRtnLength;
+ unsigned long lCheckLengthInBytes = iNRows * iNCols * iSamplesPerPixel;
+ if (iBitsAllocated == 16)
+ lCheckLengthInBytes *= 2;
+ if (lCheckLengthInBytes > lRealLength) {
+ m_bFail = true;
+ m_strFailMessage = "Too little pixel data supplied";
+ return;
+ }
+ // Now allocate the memory to hold the pixel data and get it from the DICOM file...
+
+ unsigned char* pRawPixels = new unsigned char [lCheckLengthInBytes];
+ elemPixelData.length = lCheckLengthInBytes;
+ elemPixelData.d.ot = pRawPixels;
+
+ void* ctx = NULL;
+ CONDITION cond = DCM_GetElementValue (&m_pFile, &elemPixelData, &lRtnLength, &ctx);
+ if ((cond != DCM_NORMAL) && (cond != DCM_GETINCOMPLETE)) {
+ m_bFail = true;
+ m_strFailMessage = "Can't read pixel data";
+ delete pRawPixels;
+ return;
+ }
+ if ((lCheckLengthInBytes < lRealLength) && (cond != DCM_GETINCOMPLETE)) {
+ m_bFail;
+ m_strFailMessage = "Should have gooten incomplete message reading pixel data";
+ delete pRawPixels;
+ return;
+ }
+
+ m_pImageFile = new ImageFile (iNCols, iNRows);
+ ImageFileArray v = m_pImageFile->getArray();
+ double dScale = 1 << iBitsStored;
+ unsigned int iMaskLength = iBitsStored;
+ if (iMaskLength > 8)
+ iMaskLength -= 8;
+ unsigned int iMask = (1 << iMaskLength) - 1;
+ for (int iy = iNRows - 1; iy >= 0; iy--) {
+ for (int ix = 0; ix < iNCols; ix++) {
+ if (iBitsAllocated == 8) {
+ unsigned char cV = pRawPixels[iy * iNRows + ix];
+ v[ix][iy] = (cV & iMask) / dScale;
+ } else if (iBitsAllocated == 16) {
+ unsigned long lBase = (iy * iNRows + ix) * 2;
+ unsigned char cV1 = pRawPixels[lBase];
+ unsigned char cV2 = pRawPixels[lBase+1] & iMask;
+ int iV = cV1 + (cV2 << 8);
+ v[ix][iy] = iV / dScale;
+ }
+ }
+ }
+ m_iContents = DICOM_CONTENTS_IMAGE;
+}
+
+void
+DicomImporter::loadProjections()
+{
+ unsigned long lRtnLength;
+ void* ctx = NULL;
+
+ unsigned short iNViews, iNDets;
+ DCM_ELEMENT aElemRequired[] = {
+ {DCM_IMGROWS, DCM_US, "", 1, sizeof(iNViews), reinterpret_cast<char*>(&iNViews)},
+ {DCM_IMGCOLUMNS, DCM_US, "", 1, sizeof(iNDets), reinterpret_cast<char*>(&iNDets)},
+ };
+ int nElemRequired = sizeof (aElemRequired) / sizeof(DCM_ELEMENT);
+
+ if (DCM_ParseObject (&m_pFile, aElemRequired, nElemRequired, NULL, 0, NULL) != DCM_NORMAL) {
+ m_bFail = true;
+ m_strFailMessage = "Unable to read header for projections";
+ return;
+ }
+
+ DCM_TAG somatomTag = DCM_MAKETAG(TAG_GROUP_SOMATOM, TAG_MEMBER_SOMATOM_DATA);
+ DCM_ELEMENT elemProjections = {somatomTag, DCM_OT, "", 1, 0, NULL};
+ if (DCM_GetElementSize (&m_pFile, elemProjections.tag, &lRtnLength) != DCM_NORMAL) {
+ m_bFail = true;
+ m_strFailMessage = "Can't find projection data";
+ return;
+ }
+
+ unsigned char* pRawProjections = new unsigned char [lRtnLength];
+ elemProjections.length = lRtnLength;
+ elemProjections.d.ot = pRawProjections;
+
+ ctx = NULL;
+ CONDITION cond = DCM_GetElementValue (&m_pFile, &elemProjections, &lRtnLength, &ctx);
+ if ((cond != DCM_NORMAL) && (cond != DCM_GETINCOMPLETE)) {
+ m_bFail = true;
+ m_strFailMessage = "Can't read projections data";
+ delete pRawProjections;
+ return;
+ }
+ m_iContents = DICOM_CONTENTS_PROJECTIONS;
+ m_pProjections = new Projections;
+ m_pProjections->initFromSomatomAR_STAR (iNViews, iNDets, pRawProjections, lRtnLength);
+ delete pRawProjections;
+}
+
+
+DicomImporter::~DicomImporter()
+{
+ DCM_CloseObject (&m_pFile);
+}
#endif // HAVE_CTN_DICOM
** 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
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;
}
std::complex<double> 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;
+ }
}
}
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)
{
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: projections.cpp,v 1.50 2001/03/01 07:30:49 kevin Exp $
+** $Id: projections.cpp,v 1.51 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
}
+bool
+Projections::initFromSomatomAR_STAR (int iNViews, int iNDets, unsigned char* pData, unsigned long lDataLength)
+{
+ init (iNViews, iNDets);
+
+ if (iNDets != 1024)
+ return false;
+ if (iNViews == 750 &&
+}
+
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\include" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D "NDEBUG" /D "__WXWIN__" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.4\" /FR /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D "NDEBUG" /D "__WXWIN__" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 wsock32.lib tiff.lib jpeg.lib png.lib zlib.lib xpm.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /libpath:"\wx2.2.5\lib"
+# ADD LINK32 wsock32.lib tiff.lib jpeg.lib png.lib zlib.lib xpm.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /machine:I386 /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Release"
!ELSEIF "$(CFG)" == "ctsim - Win32 Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.4\" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib"
+# ADD LINK32 winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug"
# SUBTRACT LINK32 /nodefaultlib
!ENDIF
<pre>
<h1>Build Log</h1>
<h3>
+--------------------Configuration: libctsim - Win32 Debug--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BC.tmp" with contents
+[
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/libctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"C:\ctsim\libctsim\backprojectors.cpp"
+"C:\ctsim\libctsim\ctndicom.cpp"
+"C:\ctsim\libctgraphics\dlgezplot.cpp"
+"C:\ctsim\libctsim\filter.cpp"
+"C:\ctsim\libctsim\fourier.cpp"
+"C:\ctsim\libctsim\globalvars.cpp"
+"C:\ctsim\libctsupport\hashtable.cpp"
+"C:\ctsim\libctsim\imagefile.cpp"
+"C:\ctsim\libctsim\phantom.cpp"
+"C:\ctsim\libctsupport\plotfile.cpp"
+"C:\ctsim\libctgraphics\pol.cpp"
+"C:\ctsim\libctsim\procsignal.cpp"
+"C:\ctsim\libctsim\projections.cpp"
+"C:\ctsim\libctsim\reconstruct.cpp"
+"C:\ctsim\libctsim\scanner.cpp"
+"C:\ctsim\libctsupport\syserror.cpp"
+"C:\ctsim\libctsim\trace.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BC.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BD.tmp" with contents
+[
+/nologo /out:"Debug\libctsim.lib"
+.\Debug\array2dfile.obj
+.\Debug\backprojectors.obj
+.\Debug\clip.obj
+.\Debug\consoleio.obj
+.\Debug\ctndicom.obj
+.\Debug\dlgezplot.obj
+.\Debug\ezplot.obj
+.\Debug\ezset.obj
+.\Debug\ezsupport.obj
+.\Debug\filter.obj
+.\Debug\fnetorderstream.obj
+.\Debug\fourier.obj
+.\Debug\getopt.obj
+.\Debug\getopt1.obj
+.\Debug\globalvars.obj
+.\Debug\hashtable.obj
+.\Debug\imagefile.obj
+.\Debug\interpolator.obj
+.\Debug\mathfuncs.obj
+.\Debug\phantom.obj
+.\Debug\plotfile.obj
+.\Debug\pol.obj
+.\Debug\procsignal.obj
+.\Debug\projections.obj
+.\Debug\reconstruct.obj
+.\Debug\scanner.obj
+.\Debug\sgp.obj
+.\Debug\strfuncs.obj
+.\Debug\syserror.obj
+.\Debug\trace.obj
+.\Debug\transformmatrix.obj
+.\Debug\xform.obj
+]
+Creating command line "link.exe -lib @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BD.tmp"
+<h3>Output Window</h3>
+Compiling...
+ctndicom.cpp
+projections.cpp
+Skipping... (no relevant changes detected)
+backprojectors.cpp
+dlgezplot.cpp
+filter.cpp
+fourier.cpp
+globalvars.cpp
+hashtable.cpp
+imagefile.cpp
+phantom.cpp
+plotfile.cpp
+pol.cpp
+procsignal.cpp
+reconstruct.cpp
+scanner.cpp
+syserror.cpp
+trace.cpp
+Creating library...
+<h3>
--------------------Configuration: ctsim - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP65.tmp" with contents
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BE.tmp" with contents
[
-/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.0.4\" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"C:\ctsim\src\backgroundmgr.cpp"
+"C:\ctsim\src\backgroundsupr.cpp"
+"C:\ctsim\src\graph3dview.cpp"
+"C:\ctsim\src\threadproj.cpp"
+"C:\ctsim\src\threadraster.cpp"
+"C:\ctsim\src\threadrecon.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BE.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BF.tmp" with contents
+[
+/nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "\wx2.2.5\include" /I "..\..\..\fftw-2.1.3\fftw" /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\include" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\rfftw" /I "\dicom\ctn\include" /D VERSION=\"3.0.0beta1\" /D "_DEBUG" /D "__WXMSW__" /D "HAVE_SGP" /D "HAVE_PNG" /D "HAVE_WXWINDOWS" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "HAVE_STRING_H" /D "HAVE_FFTW" /D "HAVE_RFFTW" /D "HAVE_GETOPT_H" /D "MSVC" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D CTSIMVERSION=\"3.1.0\" /D "HAVE_CTN_DICOM" /D CTSIMVERSION=\"3.0.0alpha5\" /FR"Debug/" /Fp"Debug/ctsim.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\ctsim\src\ctsim.cpp"
+"C:\ctsim\src\dialogs.cpp"
+"C:\ctsim\src\dlgprojections.cpp"
+"C:\ctsim\src\dlgreconstruct.cpp"
+"C:\ctsim\src\docs.cpp"
+"C:\ctsim\src\views.cpp"
]
-Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP65.tmp"
-Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP66.tmp" with contents
+Creating command line "cl.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1BF.tmp"
+Creating temporary file "C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C0.tmp" with contents
[
-winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib"
+winmm.lib rpcrt4.lib ws2_32.lib ../libctsim/Debug/libctsim.lib libcmtd.lib ..\..\..\fftw-2.1.3\Win32\FFTW2st\Debug\FFTW2st.lib ..\..\..\fftw-2.1.3\Win32\RFFTW2st\Debug\RFFTW2st.lib wxd.lib xpmd.lib tiffd.lib zlibd.lib pngd.lib comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib opengl32.lib glu32.lib htmlhelp.lib ctn_lib.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/ctsim.pdb" /debug /machine:I386 /out:"Debug/ctsim.exe" /pdbtype:sept /libpath:"\wx2.2.5\lib" /libpath:"\dicom\ctn\winctn\ctn_lib\Debug"
.\Debug\backgroundmgr.obj
.\Debug\backgroundsupr.obj
.\Debug\ctsim.obj
\wx2.2.5\lib\zlibd.lib
\wx2.2.5\lib\tiffd.lib
]
-Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP66.tmp"
+Creating command line "link.exe @C:\DOCUME~1\kevin\LOCALS~1\Temp\RSP1C0.tmp"
<h3>Output Window</h3>
Compiling...
+backgroundmgr.cpp
+Skipping... (no relevant changes detected)
+backgroundsupr.cpp
+graph3dview.cpp
+threadproj.cpp
+threadraster.cpp
+threadrecon.cpp
+Compiling...
ctsim.cpp
+Skipping... (no relevant changes detected)
+dialogs.cpp
+dlgprojections.cpp
+dlgreconstruct.cpp
+docs.cpp
+views.cpp
Linking...
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D "NDEBUG" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /GR /GX /O2 /I "\wx2.2.5\src\png" /I "\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "NDEBUG" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /YX /FD /c
# SUBTRACT CPP /X
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /FR /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Gm /Gi /GR /GX /Zi /Od /Gy /I "..\..\..\wx2.2.5\src\png" /I "..\..\..\wx2.2.5\src\zlib" /I "..\..\INCLUDE" /I "..\..\getopt" /I "..\..\..\fftw-2.1.3\fftw" /I "..\..\..\fftw-2.1.3\rfftw" /I "..\..\..\wx2.2.5\include" /I "\dicom\ctn\include" /D "_DEBUG" /D "HAVE_WXWIN" /D "HAVE_STRING_H" /D "HAVE_GETOPT_H" /D "WIN32" /D "_MBCS" /D "_LIB" /D "MSVC" /D "HAVE_FFTW" /D "HAVE_PNG" /D "HAVE_SGP" /D "HAVE_WXWINDOWS" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "HAVE_CTN_DICOM" /FR /YX /FD /GZ /c
# SUBTRACT CPP /X
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
** This is part of the CTSim program
** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ctsim.cpp,v 1.90 2001/03/01 20:02:18 kevin Exp $
+** $Id: ctsim.cpp,v 1.91 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
#endif
#endif
-static const char* rcsindent = "$Id: ctsim.cpp,v 1.90 2001/03/01 20:02:18 kevin Exp $";
+static const char* rcsindent = "$Id: ctsim.cpp,v 1.91 2001/03/02 02:08:14 kevin Exp $";
struct option CTSimApp::ctsimOptions[] =
{
wxString strWildcard;
if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PPM) {
strExt = ".ppm";
- strWildcard = "PPM Files (*.ppm)|*.pgm|PGM Files (*.pgm)|*.pgm";
+ strWildcard = "PPM Files (*.ppm)|*.ppm|PGM Files (*.pgm)|*.pgm";
}
#ifdef HAVE_PNG
else if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PNG) {
strExt = ".png";
strWildcard = "PNG Files (*.png)|*.png";
}
+#endif
+#ifdef HAVE_CTN_DICOM
+ else if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_DICOM) {
+ strExt = "*.*";
+ strWildcard = "Dicom Files (*.*)|*.*";
+ }
#endif
else {
return;
wxString strFilename = wxFileSelector (wxString("Import Filename"), wxString(""),
wxString(""), strExt, strWildcard, wxHIDE_READONLY | wxOPEN);
if (! strFilename.IsEmpty()) {
- ImageFile* pIF = new ImageFile;
- if (pIF->importImage (strFormatName.c_str(), strFilename.c_str())) {
- ImageFileDocument* pIFDoc = theApp->newImageDoc();
- pIFDoc->setImageFile(pIF);
- pIFDoc->getView()->getFrame()->Show(true);
- std::ostringstream os;
- os << "Import file " << strFilename.c_str() << " (type " << strFormatName.c_str() << ")";
- pIF->labelAdd (os.str().c_str());
- if (theApp->getAskDeleteNewDocs())
- pIFDoc->Modify (true);
- pIFDoc->UpdateAllViews();
- pIFDoc->GetFirstView()->OnUpdate (NULL, NULL);
- pIFDoc->getView()->getFrame()->Show(true);
- } else
- delete pIF;
+ if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PPM || m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_PNG) {
+ ImageFile* pIF = new ImageFile;
+ if (pIF->importImage (strFormatName.c_str(), strFilename.c_str())) {
+ ImageFileDocument* pIFDoc = theApp->newImageDoc();
+ pIFDoc->setImageFile(pIF);
+ pIFDoc->getView()->getFrame()->Show(true);
+ std::ostringstream os;
+ os << "Import file " << strFilename.c_str() << " (type " << strFormatName.c_str() << ")";
+ pIF->labelAdd (os.str().c_str());
+ if (theApp->getAskDeleteNewDocs())
+ pIFDoc->Modify (true);
+ pIFDoc->UpdateAllViews();
+ pIFDoc->GetFirstView()->OnUpdate (NULL, NULL);
+ pIFDoc->getView()->getFrame()->Show(true);
+ } else
+ delete pIF;
+ }
+#ifdef HAVE_CTN_DICOM
+ else if (m_iDefaultImportFormat == ImageFile::IMPORT_FORMAT_DICOM) {
+ DicomImporter dicomImport (strFilename.c_str());
+ if (dicomImport.fail()) {
+ ::wxMessageBox (dicomImport.failMessage().c_str(), "Import Error");
+ } else if (dicomImport.testImage()) {
+ ImageFileDocument* pIFDoc = theApp->newImageDoc();
+ ImageFile* pIF = dicomImport.getImageFile();
+ pIFDoc->setImageFile (pIF);
+ pIFDoc->getView()->getFrame()->Show(true);
+ std::ostringstream os;
+ os << "Import file " << strFilename.c_str() << " (type " << strFormatName.c_str() << ")";
+ pIF->labelAdd (os.str().c_str());
+ if (theApp->getAskDeleteNewDocs())
+ pIFDoc->Modify (true);
+ pIFDoc->UpdateAllViews();
+ pIFDoc->GetFirstView()->OnUpdate (NULL, NULL);
+ pIFDoc->getView()->getFrame()->Show(true);
+ } else if (dicomImport.testProjections()) {
+ ProjectionFileDocument* pProjDoc = theApp->newProjectionDoc();
+ Projections* pProj = dicomImport.getProjections();
+ pProjDoc->setProjections (pProj);
+ pProjDoc->getView()->getFrame()->Show(true);
+ std::ostringstream os;
+ os << "Import projection file " << strFilename.c_str() << " (type " << strFormatName.c_str() << ")";
+ pProj->setRemark (os.str().c_str());
+ if (theApp->getAskDeleteNewDocs())
+ pProjDoc->Modify (true);
+ pProjDoc->UpdateAllViews();
+ pProjDoc->GetFirstView()->OnUpdate (NULL, NULL);
+ pProjDoc->getView()->getFrame()->Show(true);
+ } else
+ ::wxMessageBox ("Unrecognized DICOM file contents", "Import Error");
+ }
+#endif
+ else
+ sys_error (ERR_WARNING, "Unknown import format type");
}
}