]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marGdcmDicom.h
Remove useless files
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marGdcmDicom.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: marGdcmDicom.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
18 #ifndef __MAR__KERNEL__MARGDCMDICOM__HXX__
19 #define __MAR__KERNEL__MARGDCMDICOM__HXX__
20
21 #include <vector>
22 #include <string>
23
24 #include <wx/string.h>
25 #include <wx/gauge.h>
26
27
28
29 #include "gdcmDicomDir.h"
30 #include "gdcmSerieHelper.h" 
31 #include "gdcmDicomDirPatient.h"
32 #include "gdcmDicomDirStudy.h"
33 #include "gdcmDicomDirSerie.h"
34 #include "gdcmDicomDirImage.h"
35 #include "marDicomBase.h"
36
37
38
39
40
41 typedef std::vector<wxArrayString> SerieInfo;  //DICOM info for each serie
42 /**
43  * Shouldn't we break the dependencies to wx ???
44  * 
45  * We use vector instead of list for efficiency: for access time
46  * futhermore the number of patient is not changing a lot, so we 
47  * might add the number of patient to params.dat, to allocate the right 
48  * number of vector
49  *
50  */
51
52 // EED
53 // class MAR_KERNEL_EXPORT marGdcmDicom : public marObject
54
55
56 class marGdcmDicom : public marFilesBase
57 {
58   public:
59
60     marGdcmDicom( marParameters* p = NULL );
61
62     ~marGdcmDicom( ){
63             reset( );
64     }
65
66     void loadActualSerie(wxGauge* gauge );
67     void loadVolume( bool force = false, wxGauge* gauge = NULL);
68         void PrepareLoadVolumeDispers();
69         virtual bool loadImage(int i);
70         bool loadFileDicom(void* p_vol,int *dim,char *namefile);
71
72
73     /** 
74      * General methods
75      */
76     void reset( );
77         void Cleaning_gdcmFileList();
78
79     void copyFrom( const marObject& from );
80     /**
81      * Persistence methods
82      */
83     bool save( std::ofstream& os );
84     bool load( std::ifstream& is );
85
86         void CreateDicomFile( );
87     void FillDicomInfo(bool parseDir);
88     
89     wxString GetPatientName();
90         
91         GDCM_NAME_SPACE::DicomDir* getGdcmDicomDir();
92
93         GDCM_NAME_SPACE::DicomDirStudy* getActualStudy();
94
95         void setActualPatient(GDCM_NAME_SPACE::DicomDirPatient *patient);
96         void setActualStudy(GDCM_NAME_SPACE::DicomDirStudy *study);
97         void setActualSerie(GDCM_NAME_SPACE::DicomDirSerie *serie);
98
99         void setIniSlice(int iniSlice);
100         void setEndSlice(int endSlice);
101
102         GDCM_NAME_SPACE::DicomDirSerie *getActualSerie();
103
104
105   private:
106
107
108     std::vector< SerieInfo > m_DicomInfo;
109         GDCM_NAME_SPACE::DicomDir                       *_dicomDir;
110         GDCM_NAME_SPACE::DicomDirPatient        *_actualPatient;
111         GDCM_NAME_SPACE::DicomDirStudy          *_actualStudy;
112         GDCM_NAME_SPACE::DicomDirSerie          *_actualSerie;
113         GDCM_NAME_SPACE::DicomDirImage          *_actualImage;
114
115         int _iniSlice;
116         int _endSlice;
117
118         virtual void CreateSerieHelper();
119         void CreateEmptyVoxel();
120         void ExtactSpacing();
121         void ExtactInterceptSlope();
122
123         bool SerieVerification(  GDCM_NAME_SPACE::FileList *gdcmFileList  );
124         bool SerieVerificationEqImageSize(  GDCM_NAME_SPACE::FileList *gdcmFileList  );
125 //      bool SerieVerificationEqImageOrientation(  GDCM_NAME_SPACE::GdcmFileList *gdcmFileList  );
126
127
128
129   protected:
130         GDCM_NAME_SPACE::FileList               _gdcmFileList; 
131
132 };
133
134
135 //-------------------------------------------------------------------
136
137 class marGdcmDicomILPD : public marGdcmDicom
138 {
139 public:
140         marGdcmDicomILPD( marParameters* p = NULL );
141 private:
142         virtual void CreateSerieHelper();
143 protected:
144 };
145
146 //-------------------------------------------------------------------
147
148 #endif // __MAR__KERNEL__MARGDCMDICOM__HXX__