r593: no message
[ctsim.git] / include / ctndicom.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **      Name:           ctndicomp.cpp
5 **  Purpose:      Interface to CTN Dicom header
6 **      Programmer:   Kevin Rosenberg
7 **      Date Started: March 2001
8 **
9 **  This is part of the CTSim program
10 **  Copyright (c) 1983-2001 Kevin Rosenberg
11 **
12 **  $Id: ctndicom.h,v 1.2 2001/03/02 02:08:14 kevin Exp $
13 **
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.
17 **
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.
22 **
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 ******************************************************************************/
27
28 #ifndef _CTNDICOM_H_
29 #define _CTNDICOM_H_
30 #if HAVE_CTN_DICOM
31
32 #include <string>
33
34 #include        "dicom.h"
35 #include        "condition.h"
36 #include        "lst.h"
37 #include        "dicom_objects.h"
38
39 class ImageFile;
40 class Projections;
41
42 class DicomImporter {
43 private:
44   std::string m_strFilename;
45   bool m_bFail;
46   std::string m_strFailMessage;
47   int m_iContents;
48   ImageFile* m_pImageFile;
49   Projections* m_pProjections;
50   DCM_OBJECT* m_pFile;
51
52   void loadImage(unsigned short iNRows, unsigned short iNCols, unsigned short iBitsAllocated, 
53             unsigned short iBitsStored, unsigned short iHighBit, unsigned short iPixRep);
54
55   void loadProjections();
56
57   enum {
58     TAG_GROUP_SOMATOM = 0x7fe1,
59     TAG_MEMBER_SOMATOM_DATA = 0x1000,
60   };
61
62 public:
63   enum {
64     DICOM_CONTENTS_INVALID = -1,
65     DICOM_CONTENTS_IMAGE,
66     DICOM_CONTENTS_PROJECTIONS,
67   };
68
69   DicomImporter (const char* const pszFile);
70   ~DicomImporter();
71
72   bool testImage() const {return m_iContents == DICOM_CONTENTS_IMAGE;}
73   bool testProjections() const {return m_iContents == DICOM_CONTENTS_PROJECTIONS;}
74   bool fail() const {return m_bFail;}
75   const std::string& failMessage() const {return m_strFailMessage;}
76
77   ImageFile* getImageFile() const {return m_pImageFile;}
78   Projections* getProjections() const {return m_pProjections;}
79 };
80
81 #endif // HAVE_CTN_DICOM
82 #endif // _CTNDICOM_H_