X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fctndicom.h;h=011df7c867c81ee7619993ab64ff8d84a7ca3876;hb=134461a6b28beafafdececf7b1f90f4211b56f6b;hp=020ac3a0c1e2daef531d950aad758ced5c50dad2;hpb=c953cbb6ffc2fd50e736230f4e6976a025983cff;p=ctsim.git diff --git a/include/ctndicom.h b/include/ctndicom.h index 020ac3a..011df7c 100644 --- a/include/ctndicom.h +++ b/include/ctndicom.h @@ -9,7 +9,7 @@ ** 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.4 2001/03/05 21:59:55 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 @@ -29,6 +29,105 @@ #define _CTNDICOM_H_ #if HAVE_CTN_DICOM +#include +#include +#include +#ifdef GCCSUNOS +#include +#endif + +#include "ctsupport.h" + +#if SIZEOF_LONG == 4 +#define LONGSIZE 32 +#elif SIZEOF_LONG ==8 +#define LONGSIZE 64 +#endif + +#if SIZEOF_INT == 2 +#define INTSIZE 16 +#elif SIZEOF_INT == 4 +#define INTSIZE 32 +#elif SIZEOF_INT == 8 +#define INTSIZE 64 +#endif + +#if SIZEOF_SHORT == 2 +#define SHORTSIZE 16 +#elif SIZEOF_SHORT == 4 +#define SHORTSIZE 32 +#endif + +#include "dicom.h" +#include "ctnthread.h" +#include "lst.h" +#include "condition.h" +#include "dicom_objects.h" + +#include +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;} +}; + + +class DicomExporter { +private: + std::string m_strFilename; + bool m_bFail; + std::string m_strFailMessage; + const ImageFile* m_pImageFile; + DCM_OBJECT* m_pFile; + + void saveImage (unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated, + unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep); + + +public: + + DicomExporter (const char* const pszFile, const ImageFile* pImageFile); + ~DicomExporter(); + + bool fail() const {return m_bFail;} + const std::string& failMessage() const {return m_strFailMessage;} +}; #endif // HAVE_CTN_DICOM #endif // _CTNDICOM_H_