1 #ifndef BRUKER2DICOM2_H
2 #define BRUKER2DICOM2_H
4 #include <gdcmReader.h>
5 #include "gdcmDirectory.h"
6 #include <vtkGDCMImageReader.h>
7 #include <gdcmScanner.h>
9 #include "gdcmByteSwap.h"
10 #include "gdcmSwapCode.h"
11 #include "gdcmFilename.h"
12 #include "gdcmDataSet.h"
14 #include "gdcmImageWriter.h"
15 #include "gdcmImage.h"
16 #include "gdcmWriter.h"
17 #include "gdcmReader.h"
18 #include "gdcmUIDGenerator.h"
20 //#include "gdcmFile.h"
21 //#include "gdcmFileHelper.h"
22 //#include "gdcmCommon.h"
23 //#include "gdcmDebug.h"
24 //#include "gdcmUtil.h"
25 //#include "gdcmDirList.h"
27 //#include "gdcmArgMgr.h"
28 #include "brukerSystem.h"
29 #include "brukerdataset.h"
30 #include "brukerkspaceobject.h"
31 #include "brukerimage.h"
38 #define VALID_FILE_SEPARATOR "\\"
39 #define INVALID_FILE_SEPARATOR "/"
41 #define INVALID_FILE_SEPARATOR "\\"
42 #define VALID_FILE_SEPARATOR "/"
45 class __declspec( dllexport ) Bruker2Dicom {
48 /*! \brief Constructor
50 Bruker2Dicom () /* : verbose(0), mhd(0), dicom(0), day(O)*/ {};
55 void SetInputDirectory (const std::string &i) { InputDirName = i;}
56 void SetOutputDirectory(const std::string &o) { OutputDirName = o;}
57 void SetConvertModeToDicom() { dicom = 1; mhd = 0;}
58 void SetConvertModeToMhd() { dicom = 0; mhd = 1;}
62 // For debugging pupose only.
63 //Don't need accessors : Attributes are 'public'
65 void SetVerbose(int v) { verbose = v;}
66 void SetMhd(int m) { mhd = m; }
67 void SetDicom(int d) { dicom = d; }
72 void MakeDicomImage(unsigned char *tabPixels,
77 double spacingX, double spacingY, double sliceDistance,
78 std::string dcmImageName,
79 const std::string &patientName,
81 std::string &studyUID,
82 std::string &serieUID,
83 std::string &studyDescr,
84 std::string &serieDescr,
85 std::string &strStudyTimeDate,
86 int imgNum, int imagecontenttype//gdcm2 dont have such things, I think, as ImageContentTYpe
89 std::vector<BrukerImage> CreateImageSet ( );
91 void getImhDataType(BrukerFieldData &bDPT,
92 std::string &mhdDataPixelType,
95 void cleanString(std::string &s);
97 bool CreateDirectory(const std::string &dirNameout);
99 int CheckUserDirectory(std::string &userDirName);
100 void DealWithMultiStudyDirectory(gdcm::Directory::FilenamesType &fileNames,const std::string ¤tOutputDirName);
101 void DealWithSingleStudyDirectory (const std::string &dirname,const std::string ¤tOutputDirName) ;
103 void DealWithNiveau1(std::string &level1Directory, std::string ¤tOutputDirName);
104 void DealWithNiveau2(std::string &level2Directory, std::string ¤tOutputDirName);
105 void DealWithNiveau3(std::string &level3Directory, std::string ¤tOutputDirName);
107 void dealWithCarto(gdcm::Directory::FilenamesType &fileNames, int NX, int NY, int nbSlices,
108 double fovX, double fovY, double sliceDistance,
109 char *copyFile, std::string ¤tOutputDirName,
110 char *outputMhdFileName, char *output2dseqCartoName);
112 const std::string createDirectory(const std::string &i_name,const std::string &i_dir);
113 std::string findFile(const std::string &i_dir, const std::string i_name);
116 // these ones are for debugging only
117 // don't bbfy the accessors.
123 std::string InputDirName;
124 std::string OutputDirName;
129 std::string subject_entry;
130 std::string subject_position;
131 std::string subject_date;
132 std::string subject_study_name;
138 BrukerDataSet br_subject;
139 BrukerDataSet br_acqp;
140 BrukerDataSet br_method;
141 BrukerDataSet br_d3proc;
142 BrukerDataSet br_isa;
143 BrukerDataSet br_reco;
145 std::vector<BrukerImage> imageSet;
149 std::string strStudyUID;
150 std::string strSerieUID;
151 std::string strStudyDescr;
152 std::string strSerieDescr;
153 std::string strStudyTimeDate;
154 std::string strPatientName;
155 std::string subject_name; // cleaned strPatientName