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-2009 Kevin Rosenberg
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License (version 2) as
14 ** published by the Free Software Foundation.
16 ** This program is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ** GNU General Public License for more details.
21 ** You should have received a copy of the GNU General Public License
22 ** along with this program; if not, write to the Free Software
23 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 ******************************************************************************/
34 #include <sys/types.h>
37 #include "ctsupport.h"
55 #elif SIZEOF_SHORT == 4
60 #include "ctnthread.h"
62 #include "condition.h"
63 #include "dicom_objects.h"
71 std::string m_strFilename;
73 std::string m_strFailMessage;
75 ImageFile* m_pImageFile;
76 Projections* m_pProjections;
79 void loadImage(unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated,
80 unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep);
82 void loadProjections();
85 TAG_GROUP_SOMATOM = 0x7fe1,
86 TAG_MEMBER_SOMATOM_DATA = 0x1000,
91 DICOM_CONTENTS_INVALID = -1,
93 DICOM_CONTENTS_PROJECTIONS,
96 DicomImporter (const char* const pszFile);
99 bool testImage() const {return m_iContents == DICOM_CONTENTS_IMAGE;}
100 bool testProjections() const {return m_iContents == DICOM_CONTENTS_PROJECTIONS;}
101 bool fail() const {return m_bFail;}
102 const std::string& failMessage() const {return m_strFailMessage;}
104 ImageFile* getImageFile() const {return m_pImageFile;}
105 Projections* getProjections() const {return m_pProjections;}
109 class DicomExporter {
111 const ImageFile* m_pImageFile;
112 std::string m_strFilename;
114 std::string m_strFailMessage;
115 DCM_OBJECT* m_pObject;
117 bool createDicomObject();
121 DicomExporter (ImageFile* pImageFile);
124 bool writeFile (const char* const pszFilename);
125 bool fail() const {return m_bFail;}
126 const std::string& failMessage() const {return m_strFailMessage;}
129 #endif // HAVE_CTN_DICOM
130 #endif // _CTNDICOM_H_