1 /*****************************************************************************
5 ** Purpose: Interface to CTN Dicom header
6 ** Programmer: Kevin Rosenberg
7 ** Date Started: March 2001
9 ** This is part of the CTSim program
10 ** Copyright (c) 1983-2001 Kevin Rosenberg
14 ** This program is free software; you can redistribute it and/or modify
15 ** it under the terms of the GNU General Public License (version 2) as
16 ** published by the Free Software Foundation.
18 ** This program is distributed in the hope that it will be useful,
19 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ** GNU General Public License for more details.
23 ** You should have received a copy of the GNU General Public License
24 ** along with this program; if not, write to the Free Software
25 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 ******************************************************************************/
36 #include <sys/types.h>
39 #include "ctsupport.h"
57 #elif SIZEOF_SHORT == 4
62 #include "ctnthread.h"
64 #include "condition.h"
65 #include "dicom_objects.h"
73 std::string m_strFilename;
75 std::string m_strFailMessage;
77 ImageFile* m_pImageFile;
78 Projections* m_pProjections;
81 void loadImage(unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated,
82 unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep);
84 void loadProjections();
87 TAG_GROUP_SOMATOM = 0x7fe1,
88 TAG_MEMBER_SOMATOM_DATA = 0x1000,
93 DICOM_CONTENTS_INVALID = -1,
95 DICOM_CONTENTS_PROJECTIONS,
98 DicomImporter (const char* const pszFile);
101 bool testImage() const {return m_iContents == DICOM_CONTENTS_IMAGE;}
102 bool testProjections() const {return m_iContents == DICOM_CONTENTS_PROJECTIONS;}
103 bool fail() const {return m_bFail;}
104 const std::string& failMessage() const {return m_strFailMessage;}
106 ImageFile* getImageFile() const {return m_pImageFile;}
107 Projections* getProjections() const {return m_pProjections;}
111 class DicomExporter {
113 const ImageFile* m_pImageFile;
114 std::string m_strFilename;
116 std::string m_strFailMessage;
117 DCM_OBJECT* m_pObject;
119 bool createDicomObject();
123 DicomExporter (ImageFile* pImageFile);
126 bool writeFile (const char* const pszFilename);
127 bool fail() const {return m_bFail;}
128 const std::string& failMessage() const {return m_strFailMessage;}
131 #endif // HAVE_CTN_DICOM
132 #endif // _CTNDICOM_H_