]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marDicom.h
creaMaracasVisu Library
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marDicom.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: marDicom.h,v $
5   Language:  C++
6   Date:      $Date: 2008/10/31 16:32:55 $
7   Version:   $Revision: 1.1 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17 #ifndef __MAR__KERNEL__DICOM__HXX__
18 #define __MAR__KERNEL__DICOM__HXX__
19
20 #include <kgfo/volume.h>
21 #include <wx/list.h>
22 #include "marObject.h"
23
24 class MAR_KERNEL_EXPORT marDicom : public marObject
25 {
26     public:
27
28     enum DicomTags
29         {
30             ID_File_Name = 0                   ,
31             ID_SOP_Class_UID                   ,
32             ID_SOP_Instance_UID                ,
33             ID_Study_Date                      ,
34             ID_Series_Date                     ,
35             ID_Acquisition_Date                ,
36             ID_Image_Date                      ,
37             ID_Study_Time                      ,
38             ID_Series_Time                     ,
39             ID_Acquisition_Time                ,
40             ID_Image_Time                      ,
41             ID_Modality                        ,
42             ID_Manufacturer                    ,
43             ID_Institution_Name                ,
44             ID_Study_Description               ,
45             ID_Series_Description              ,
46             ID_Admitting_Diagnoses_Description ,
47             ID_Patient_Name                    ,
48             ID_Patient_ID                      ,
49             ID_Body_Part_Examined              ,
50             ID_Scanning_Sequence               ,
51             ID_Sequence_Variant                ,
52             ID_Scan_Options                    ,
53             ID_MR_Acquisition_Type             ,
54             ID_Sequence_Name                   ,
55             ID_Slice_Thickness                 ,
56             ID_Repetition_Time                 ,
57             ID_Echo_Time                       ,
58             ID_Inversion_Time                  ,
59             ID_Number_of_Averages              ,
60             ID_Imaging_Frequency               ,
61             ID_Imaged_Nucleus                  ,
62             ID_Echo_Number                     ,
63             ID_Magnetic_Field_Strength         ,
64             ID_Spacing_Between_Slices          ,
65             ID_Echo_Train_Length               ,
66             ID_Percent_Sampling                ,
67             ID_Percent_Phase_Field_of_View     ,
68             ID_Receiving_Coil                  ,
69             ID_Patient_Position                ,
70             ID_Study_Instance_UID              ,
71             ID_Series_Instance_UID             ,
72             ID_Study_ID                        ,
73             ID_Series_Number                   ,
74             ID_Acquisition_Number              ,
75             ID_Image_Number                    ,
76             ID_Patient_Orientation             ,
77             ID_Image_Position                  ,
78             ID_Image_Position_Patient          ,
79             ID_Image_Orientation               ,
80             ID_Image_Orientation_Patient       ,
81             ID_Location                        ,
82             ID_Frame_of_Reference_UID          ,
83             ID_Slice_Location                  ,
84             ID_Image_Comments                  ,
85             ID_Pixel_Spacing                   ,
86             ID_Window_Center                   ,
87             ID_Window_Width                    ,
88             ID_dicom_tags_count
89         };
90
91     public:
92
93     marDicom( marParameters* p = NULL );
94
95     ~marDicom( )
96         {
97             reset( );
98         }
99
100     wxString& getActualStudy( )
101         {
102             return( _actualStudy );
103         }
104
105     wxString& getActualSerie( )
106         {
107             return( _actualSerie );
108         }
109
110     wxArrayString getStudies( );
111     wxArrayString getSeries( );
112     wxArrayString getStudyData( );
113     wxArrayString getSerieData( );
114
115     void loadActualSerie( );
116
117     wxArrayString& getImageFileNames( )
118         {
119             return( _imageFileNames );
120         }
121
122     wxArrayString& getImageNumbers( )
123         {
124             return( _imageNumbers );
125         }
126
127     void loadVolume( bool force = false );
128     void freeVolume( );
129     bool volumeLoaded( )
130         {
131             return( _volume != NULL );
132         }
133
134     kVolume* getVolume( )
135         {
136             return( _volume );
137         }
138
139     wxString getImageNumber( int i )
140         {
141             return( _imageNumbers[ i ] );
142         }
143
144     wxString getImageFileName( int i )
145         {
146             return( _imageFileNames[ i ] );
147         }
148
149     bool setActualStudy( wxString& s );
150     bool setActualSerie( wxString& s );
151
152     /** General methods
153      */
154     void reset( )
155         {
156             freeVolume( );
157             _imageFileNames.Clear( );
158             _imageNumbers.Clear( );
159         }
160
161     void copyFrom( const marObject& from );
162
163     /** Persistence methods
164      */
165     bool save( std::ofstream& os );
166     bool load( std::ifstream& is );
167
168     wxArrayString getRelationalArrayStudyData( );
169     wxArrayString getRelationalArraySerieData( );
170
171     private:
172
173     wxString _actualStudy;
174     wxString _actualSerie;
175     wxArrayString _imageFileNames;
176     wxArrayString _imageNumbers;
177     kVolume* _volume;
178
179 };
180
181 #endif // __MAR__KERNEL__DICOM__HXX__