fw4spl
DicomReaderTest.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwTest/DicomReaderTest.hpp"
8 
9 #include <fwData/Image.hpp>
10 
11 #include <fwMedData/Equipment.hpp>
12 #include <fwMedData/ImageSeries.hpp>
13 #include <fwMedData/Patient.hpp>
14 #include <fwMedData/Series.hpp>
15 #include <fwMedData/SeriesDB.hpp>
16 #include <fwMedData/Study.hpp>
17 
18 #include <fwTools/dateAndTime.hpp>
19 #include <fwTools/Type.hpp>
20 
21 namespace fwTest
22 {
23 
24 //------------------------------------------------------------------------------
25 #define CHECK_VALUE(check, message, val1, val2) \
26  { \
27  check &= (val1 == val2); \
28  OSLM_ERROR_IF(message << " <"<< val1 << "> != <" << val2 << ">", val1 != val2 ); \
29  } \
30 
31 //------------------------------------------------------------------------------
32 
33 #define CHECK_VALUE_WITH_TOLERANCE(check, message, val1, val2, tol) \
34  { \
35  check &= ( val1 - tol <= val2 && val2 <= val1 + tol ); \
36  OSLM_ERROR_IF(message << val1 << " != " << val2, val1 - tol > val2 || val2 > val1 + tol ); \
37  }
38 
39 //------------------------------------------------------------------------------
40 
41 bool DicomReaderTest::checkSeriesACHGenou( const ::fwMedData::ImageSeries::sptr& series )
42 {
43  bool ok = true;
44  bool notReallyChecked = true;
45 
46  ::fwMedData::Patient::sptr patient = series->getPatient();
47  ::fwMedData::Study::sptr study = series->getStudy();
48  ::fwMedData::Equipment::sptr equipment = series->getEquipment();
49 
50  // Study, Acquisition
51  ::fwData::Image::sptr img = series->getImage();
52 
53  //# Dicom-File-Format
54  //
55  //# Dicom-Meta-Information-Header
56  //# Used TransferSyntax:
57  //(0002,0000) UL 224 # 4,1 File Meta Information Group Length
58  //(0002,0001) OB 00\01 # 2,1 File Meta Information Version
59  //(0002,0002) UI [1.2.840.10008.5.1.4.1.1.2] # 26,1 Media Storage SOP Class UID
60  //(0002,0003) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184712.380696] # 58,1 Media Storage SOP
61  // Instance UID
62  //(0002,0010) UI [1.2.840.10008.1.2.1] # 20,1 Transfer Syntax UID
63  //(0002,0012) UI [1.2.250.1.119.1.1.1.1.1.1.33.3.8.13.7] # 38,1 Implementation Class UID
64  //(0002,0013) SH [scanplus_33 ] # 12,1 Implementation Version Name
65  //(0002,0016) AE [scanplus] # 8,1 Source Application Entity Title
66  //
67  //# Dicom-Data-Set
68  //# Used TransferSyntax: 1.2.840.10008.1.2.1
69  //(0008,0000) UL 426 # 4,1 Generic Group Length
70  //(0008,0008) CS [ORIGINAL\PRIMARY\AXIAL] # 22,2-n Image Type
71  //(0008,0016) UI [1.2.840.10008.5.1.4.1.1.2] # 26,1 SOP Class UID
72  //(0008,0018) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184712.380696] # 58,1 SOP Instance UID
73  //(0008,0020) DA [20081028] # 8,1 Study Date
74  CHECK_VALUE(ok, "Study Date doesn't match : ", "20081028", study->getDate());
75  //(0008,0021) DA [20081028] # 8,1 Series Date
76  CHECK_VALUE(ok, "Series Modality doesn't match : ", "20081028", series->getDate() );
77  //(0008,0022) DA [20081028] # 8,1 Acquisition Date
78  //(0008,0023) DA [20081028] # 8,1 Content Date
79  //(0008,0030) TM [174327.000] # 10,1 Study Time
80  CHECK_VALUE(ok, "Study Time doesn't match : ", "174327.000", study->getTime() );
81  //(0008,0031) TM [180156.734] # 10,1 Series Time
82  CHECK_VALUE(ok, "Series Modality doesn't match : ", "180156.734", series->getTime() );
83  //(0008,0032) TM [174446.850] # 10,1 Acquisition Time
84  //(0008,0033) TM [174502.095] # 10,1 Content Time
85  //(0008,0050) SH [12514 ] # 6,1 Accession Number
86  //(0008,0060) CS [CT] # 2,1 Modality
87  CHECK_VALUE(ok, "Series Modality doesn't match : ", "CT", series->getModality() );
88  //(0008,0070) LO [TOSHIBA ] # 8,1 Manufacturer
89  //(0008,0080) LO [SCANNER DE LA MODER ] # 20,1 Institution Name
90  CHECK_VALUE(ok, "Equipment's Institution Name doesn't match : ", "SCANNER DE LA MODER ",
91  equipment->getInstitutionName() );
92  //(0008,0090) PN [DR MOREL] # 8,1 Referring Physician's Name
93  CHECK_VALUE(ok, "Study Referring Physician's Name doesn't match : ", "DR MOREL",
94  study->getReferringPhysicianName() );
95  //(0008,1010) SH [00000000001 ] # 12,1 Station Name
96  //(0008,103e) LO [ OS 0.5 ] # 10,1 Series Description
97  CHECK_VALUE(ok, "Study Description doesn't match : ", " OS 0.5 ", series->getDescription() );
98  CHECK_VALUE(ok, "Study Description doesn't match : ", "", study->getDescription() ); // 0008,1030
99  //(0008,1040) LO [ID_DEPARTMENT ] # 14,1 Institutional Department Name
100  {
101  fwMedData::DicomValuesType physiciansName;
102  ok &= (physiciansName == series->getPerformingPhysiciansName());
103  OSLM_ERROR_IF("Name of the physician(s) administering the Series doesn't match : ",
104  (physiciansName == series->getPerformingPhysiciansName()));
105  }
106  //(0008,1090) LO [Aquilion] # 8,1 Manufacturer's Model Name
107  //(0010,0000) UL 104 # 4,1 Generic Group Length
108  //(0010,0010) PN [CHARNOZ ARNAUD] # 14,1 Patient's Name
109  CHECK_VALUE(ok, "Patient's Name doesn't match : ", "CHARNOZ ARNAUD", patient->getName() );
110  //(0010,0020) LO [12592 ARTHRO GENOU G ] # 22,1 Patient ID
111  CHECK_VALUE(ok, "Patient ID doesn't match : ", "12592 ARTHRO GENOU G ", patient->getPatientId() );
112  //(0010,0030) DA [19790618] # 8,1 Patient's Birth Date
113  CHECK_VALUE(ok, "Patient's Birth Date doesn't match : ", "19790618", patient->getBirthdate() );
114  //(0010,0040) CS [M ] # 2,1 Patient's Sex
115  CHECK_VALUE(ok, "Patient's Sex doesn't match :", "M ", patient->getSex() );
116  //(0010,1010) AS [029Y] # 4,1 Patient's Age
117  CHECK_VALUE(ok, "Study Patient's Age doesn't match :", "029Y", study->getPatientAge() );
118  //(0010,4000) LT [ARTHRO] # 6,1 Patient Comments
119  //(0018,0000) UL 284 # 4,1 Generic Group Length
120  //(0018,0015) CS [DR MOREL] # 8,1 Body Part Examined
121  //(0018,0022) CS [HELICAL_CT] # 10,1-n Scan Options
122  //(0018,0050) DS [0.5 ] # 4,1 Slice Thickness
123  //(0018,0060) DS [120 ] # 4,1 KVP
124  //(0018,0090) DS [400.00] # 6,1 Data Collection Diameter
125  //(0018,1000) LO [C4522344] # 8,1 Device Serial Number
126  //(0018,1020) LO [V3.20ER005] # 10,1-n Software Version(s)
127  //(0018,1030) LO [ARTHRO GENOU] # 12,1 Protocol Name
128  //(0018,1100) DS [196.875 ] # 8,1 Reconstruction Diameter
129  //(0018,1120) DS [+0.0] # 4,1 Gantry/Detector Tilt
130  //(0018,1130) DS [+90.00] # 6,1 Table Height
131  //(0018,1140) CS [CW] # 2,1 Rotation Direction
132  //(0018,1150) IS [500 ] # 4,1 Exposure Time
133  //(0018,1151) IS [200 ] # 4,1 X-Ray Tube Current
134  //(0018,1152) IS [100 ] # 4,1 Exposure
135  //(0018,1170) IS [24] # 2,1 Generator Power
136  //(0018,1190) DS [0.9\0.8 ] # 8,1-n Focal Spot(s)
137  //(0018,1210) SH [FC30] # 4,1-n Convolution Kernel
138  //(0018,5100) CS [FFS ] # 4,1 Patient Position
139  //(0018,9345) UN (FD) 23.1 # 8,1 CTDIvol
140  //(0020,0000) UL 370 # 4,1 Generic Group Length
141  //(0020,000d) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225183167.375775] # 58,1 Study Instance UID
142  CHECK_VALUE(ok, "Study Instance UID doesn't match :", "1.2.392.200036.9116.2.6.1.48.1211418863.1225183167.375775",
143  study->getInstanceUID() );
144  //(0020,000e) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.765855] # 58,1 Series Instance UID
145  CHECK_VALUE(ok, "Series Instance UID doesn't match :", "1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.765855",
146  series->getInstanceUID() );
147  //(0020,0010) SH [12514 ] # 6,1 Study ID
148  //(0020,0011) IS [3 ] # 2,1 Series Number
149  //(0020,0012) IS [3 ] # 2,1 Acquisition Number
150  //(0020,0013) IS [404 ] # 4,1 Instance Number
151  //(0020,0020) CS [L\P ] # 4,2 Patient Orientation
152  //(0020,0032) DS [-36.71875\-88.28125\1350.300] # 28,3 Image Position (Patient)
153 
154  if(!img)
155  {
156  OSLM_ERROR( "Missing image." );
157  return false;
158  }
159 
160  CHECK_VALUE_WITH_TOLERANCE(ok, "Image x origin doesn't match :", -36.71875, img->getOrigin()[0], 0.01);
161  CHECK_VALUE_WITH_TOLERANCE(ok, "Image y origin doesn't match :", -88.28125, img->getOrigin()[1], 0.01);
162  CHECK_VALUE_WITH_TOLERANCE(ok, "Image z origin doesn't match :", 1350.300, img->getOrigin()[2], 0.01);
163  //(0020,0037) DS [1.00000\0.00000\0.00000\0.00000\1.00000\0.00000 ] # 48,6 Image Orientation (Patient)
164  //(0020,0052) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225183409.15274] # 56,1 Frame of Reference UID
165  //(0020,1040) LO (no value) # 0,1 Position Reference Indicator
166  //(0020,1041) DS [+161.20 ] # 8,1 Slice Location
167  //(0028,0000) UL 158 # 4,1 Generic Group Length
168  //(0028,0002) US 1 # 2,1 Samples per Pixel
169  //(0028,0004) CS [MONOCHROME2 ] # 12,1 Photometric Interpretation
170  //(0028,0010) US 512 # 2,1 Rows
171  //(0028,0011) US 512 # 2,1 Columns
172  CHECK_VALUE(ok, "Image x size doesn't match :", 512, img->getSize()[0] );
173  CHECK_VALUE(ok, "Image y size doesn't match :", 512, img->getSize()[1] );
174  CHECK_VALUE(ok, "Image z size doesn't match :", 404, img->getSize()[2] );
175  //(0028,0030) DS [0.384\0.384 ] # 12,2 Pixel Spacing
176  CHECK_VALUE_WITH_TOLERANCE(ok, "Image x spacing doesn't match :", 0.384, img->getSpacing()[0], 0.001);
177  CHECK_VALUE_WITH_TOLERANCE(ok, "Image y spacing doesn't match :", 0.384, img->getSpacing()[1], 0.001);
178  CHECK_VALUE_WITH_TOLERANCE(ok, "Image z spacing doesn't match :", 0.399, img->getSpacing()[2], 0.001);
179  //(0028,0100) US 16 # 2,1 Bits Allocated
180  //(0028,0101) US 16 # 2,1 Bits Stored
181  CHECK_VALUE(notReallyChecked, "Image Bits Allocated correspond :", 16, img->getType().sizeOf() * 8 );
182  //(0028,0102) US 15 # 2,1 High Bit
183  //(0028,0103) US 1 # 2,1 Pixel Representation
184  CHECK_VALUE(notReallyChecked, "Image Bits Allocated correspond :", false, img->getType().isSigned() );
185  //(0028,1050) DS [500 ] # 4,1-n Window Center
186  CHECK_VALUE(ok, "Image Window Center correspond :", 500, img->getWindowCenter() );
187  //(0028,1051) DS [2500] # 4,1-n Window Width
188  CHECK_VALUE(ok, "Image Window Width correspond :", 2500, img->getWindowWidth() );
189  //(0028,1052) DS [-1024 ] # 6,1 Rescale Intercept
190  //(0028,1053) DS [1 ] # 2,1 Rescale Slope
191  //(0040,0000) UL 116 # 4,1 Generic Group Length
192  //(0040,0002) DA [20081028] # 8,1 Scheduled Procedure Step Start Date
193  //(0040,0003) TM [174327.000] # 10,1 Scheduled Procedure Step Start Time
194  //(0040,0004) DA [20081028] # 8,1 Scheduled Procedure Step End Date
195  //(0040,0005) TM [181327.000] # 10,1 Scheduled Procedure Step End Time
196  //(0040,0244) DA [20081028] # 8,1 Performed Procedure Step Start Date
197  //(0040,0245) TM [174327.000] # 10,1 Performed Procedure Step Start Time
198  //(0040,0253) SH [12325 ] # 6,1 Performed Procedure Step ID
199  //(7005,0000) UL 546 # 4,1 Generic Group Length
200  //(7005,0010) LO [TOSHIBA_MEC_CT3 ] # 16,1 Private Creator
201  //(7005,1007) UN (DS) [335\269 ] # 8,2 Reconstruction Center
202  //(7005,1008) UN (DS) [0.5 ] # 4,1 Detector Slice Thickness in mm
203  //(7005,1009) UN (LO) [1111111111111111] # 16,1 Number of Detector rows to Reconstruct
204  //(7005,100a) UN (DS) [+5.50 ] # 6,1 Table Speed in mm/rot
205  //(7005,100b) UN (SH) [ORG ] # 4,1 Filter
206  //(7005,100d) UN (CS) [DR MOREL] # 8,1 Organ
207  //(7005,100e) UN (SH) [IMG ] # 4,1 File Type Remarks
208  //(7005,100f) UN (SH) [FF] # 2,1 Direction
209  //(7005,1011) UN (LT) [Vol.] # 4,1 Series Comment
210  //(7005,1012) UN (SH) [SU] # 2,1 Position
211  //(7005,1013) UN (US) 1 # 2,1 Expert Plan No.
212  //(7005,1016) UN (UI) [1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.747732] # 58,1 Volume UID
213  //(7005,1017) UN (US) 404 # 2,1 Total Frame Count in the Volume
214  //(7005,1018) UN (US) 404 # 2,1 Frame No.
215  //(7005,1019) UN (UL) 1642763 # 4,1 Frame Sort Key
216  //(7005,101a) UN (US) 1 # 2,1 Frame Sort Order
217  //(7005,101b) UN (SH) [FC30] # 4,1 Convolution Kernel
218  //(7005,101d) UN (UL) 9 # 4,1 Reconstruction Number
219  //(7005,101e) UN (UL) 13 # 4,1 Raw Data Number
220  //(7005,101f) UN (LO) [20081028180156768480] # 20,1 Volume Number
221  //(7005,1020) UN (UL) 3 # 4,1 Local Series Number
222  //(7005,1021) UN (LO) [BOOST ] # 6,1 Decrease in Artifact Filter
223  //(7005,1022) UN (DS) [0.40] # 4,1 Reconstruction Interval
224  //(7005,1023) UN (DS) [0.688 ] # 6,1 Pitch Factor
225  //(7005,1024) UN (DA) [20081024] # 8,1 The Acquisition Date of NRA
226  //(7005,1030) UN (CS) [CT] # 2,1 Main Modality in Study
227  //(7005,1040) UN (FD) 402.4 # 8,1 DLP Dose Length Product
228 
229  return ok;
230 
231 }
232 
233 //------------------------------------------------------------------------------
234 
235 bool DicomReaderTest::checkSeriesACHGenouTrimmed( const ::fwMedData::ImageSeries::sptr& series )
236 {
237  bool ok = true;
238  bool notReallyChecked = true;
239 
240  ::fwMedData::Patient::sptr patient = series->getPatient();
241  ::fwMedData::Study::sptr study = series->getStudy();
242  ::fwMedData::Equipment::sptr equipment = series->getEquipment();
243 
244  // Study, Acquisition
245  ::fwData::Image::sptr img = series->getImage();
246 
247  //# Dicom-File-Format
248  //
249  //# Dicom-Meta-Information-Header
250  //# Used TransferSyntax:
251  //(0002,0000) UL 224 # 4,1 File Meta Information Group Length
252  //(0002,0001) OB 00\01 # 2,1 File Meta Information Version
253  //(0002,0002) UI [1.2.840.10008.5.1.4.1.1.2] # 26,1 Media Storage SOP Class UID
254  //(0002,0003) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184712.380696] # 58,1 Media Storage SOP
255  // Instance UID
256  //(0002,0010) UI [1.2.840.10008.1.2.1] # 20,1 Transfer Syntax UID
257  //(0002,0012) UI [1.2.250.1.119.1.1.1.1.1.1.33.3.8.13.7] # 38,1 Implementation Class UID
258  //(0002,0013) SH [scanplus_33 ] # 12,1 Implementation Version Name
259  //(0002,0016) AE [scanplus] # 8,1 Source Application Entity Title
260  //
261  //# Dicom-Data-Set
262  //# Used TransferSyntax: 1.2.840.10008.1.2.1
263  //(0008,0000) UL 426 # 4,1 Generic Group Length
264  //(0008,0008) CS [ORIGINAL\PRIMARY\AXIAL] # 22,2-n Image Type
265  //(0008,0016) UI [1.2.840.10008.5.1.4.1.1.2] # 26,1 SOP Class UID
266  //(0008,0018) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184712.380696] # 58,1 SOP Instance UID
267  //(0008,0020) DA [20081028] # 8,1 Study Date
268  CHECK_VALUE(ok, "Study Date doesn't match : ", "20081028", study->getDate());
269  //(0008,0021) DA [20081028] # 8,1 Series Date
270  CHECK_VALUE(ok, "Series Modality doesn't match : ", "20081028", series->getDate() );
271  //(0008,0022) DA [20081028] # 8,1 Acquisition Date
272  //(0008,0023) DA [20081028] # 8,1 Content Date
273  //(0008,0030) TM [174327.000] # 10,1 Study Time
274  CHECK_VALUE(ok, "Study Time doesn't match : ", "174327.000", study->getTime() );
275  //(0008,0031) TM [180156.734] # 10,1 Series Time
276  CHECK_VALUE(ok, "Series Modality doesn't match : ", "180156.734", series->getTime() );
277  //(0008,0032) TM [174446.850] # 10,1 Acquisition Time
278  //(0008,0033) TM [174502.095] # 10,1 Content Time
279  //(0008,0050) SH [12514 ] # 6,1 Accession Number
280  //(0008,0060) CS [CT] # 2,1 Modality
281  CHECK_VALUE(ok, "Series Modality doesn't match : ", "CT", series->getModality() );
282  //(0008,0070) LO [TOSHIBA ] # 8,1 Manufacturer
283  //(0008,0080) LO [SCANNER DE LA MODER ] # 20,1 Institution Name
284  CHECK_VALUE(ok, "Equipment's Institution Name doesn't match : ", "SCANNER DE LA MODER",
285  equipment->getInstitutionName() );
286  //(0008,0090) PN [DR MOREL] # 8,1 Referring Physician's Name
287  CHECK_VALUE(ok, "Study Referring Physician's Name doesn't match : ", "DR MOREL",
288  study->getReferringPhysicianName() );
289  //(0008,1010) SH [00000000001 ] # 12,1 Station Name
290  //(0008,103e) LO [ OS 0.5 ] # 10,1 Series Description
291  CHECK_VALUE(ok, "Study Description doesn't match : ", "OS 0.5", series->getDescription() );
292  CHECK_VALUE(ok, "Study Description doesn't match : ", "", study->getDescription() ); // 0008,1030
293  //(0008,1040) LO [ID_DEPARTMENT ] # 14,1 Institutional Department Name
294  {
295  fwMedData::DicomValuesType physiciansName;
296  ok &= (physiciansName == series->getPerformingPhysiciansName());
297  OSLM_ERROR_IF("Name of the physician(s) administering the Series doesn't match : ",
298  (physiciansName == series->getPerformingPhysiciansName()));
299  }
300  //(0008,1090) LO [Aquilion] # 8,1 Manufacturer's Model Name
301  //(0010,0000) UL 104 # 4,1 Generic Group Length
302  //(0010,0010) PN [CHARNOZ ARNAUD] # 14,1 Patient's Name
303  CHECK_VALUE(ok, "Patient's Name doesn't match : ", "CHARNOZ ARNAUD", patient->getName() );
304  //(0010,0020) LO [12592 ARTHRO GENOU G ] # 22,1 Patient ID
305  CHECK_VALUE(ok, "Patient ID doesn't match : ", "12592 ARTHRO GENOU G", patient->getPatientId() );
306  //(0010,0030) DA [19790618] # 8,1 Patient's Birth Date
307  CHECK_VALUE(ok, "Patient's Birth Date doesn't match : ", "19790618", patient->getBirthdate() );
308  //(0010,0040) CS [M ] # 2,1 Patient's Sex
309  CHECK_VALUE(ok, "Patient's Sex doesn't match :", "M", patient->getSex() );
310  //(0010,1010) AS [029Y] # 4,1 Patient's Age
311  CHECK_VALUE(ok, "Study Patient's Age doesn't match :", "029Y", study->getPatientAge() );
312  //(0010,4000) LT [ARTHRO] # 6,1 Patient Comments
313  //(0018,0000) UL 284 # 4,1 Generic Group Length
314  //(0018,0015) CS [DR MOREL] # 8,1 Body Part Examined
315  //(0018,0022) CS [HELICAL_CT] # 10,1-n Scan Options
316  //(0018,0050) DS [0.5 ] # 4,1 Slice Thickness
317  //(0018,0060) DS [120 ] # 4,1 KVP
318  //(0018,0090) DS [400.00] # 6,1 Data Collection Diameter
319  //(0018,1000) LO [C4522344] # 8,1 Device Serial Number
320  //(0018,1020) LO [V3.20ER005] # 10,1-n Software Version(s)
321  //(0018,1030) LO [ARTHRO GENOU] # 12,1 Protocol Name
322  //(0018,1100) DS [196.875 ] # 8,1 Reconstruction Diameter
323  //(0018,1120) DS [+0.0] # 4,1 Gantry/Detector Tilt
324  //(0018,1130) DS [+90.00] # 6,1 Table Height
325  //(0018,1140) CS [CW] # 2,1 Rotation Direction
326  //(0018,1150) IS [500 ] # 4,1 Exposure Time
327  //(0018,1151) IS [200 ] # 4,1 X-Ray Tube Current
328  //(0018,1152) IS [100 ] # 4,1 Exposure
329  //(0018,1170) IS [24] # 2,1 Generator Power
330  //(0018,1190) DS [0.9\0.8 ] # 8,1-n Focal Spot(s)
331  //(0018,1210) SH [FC30] # 4,1-n Convolution Kernel
332  //(0018,5100) CS [FFS ] # 4,1 Patient Position
333  //(0018,9345) UN (FD) 23.1 # 8,1 CTDIvol
334  //(0020,0000) UL 370 # 4,1 Generic Group Length
335  //(0020,000d) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225183167.375775] # 58,1 Study Instance UID
336  CHECK_VALUE(ok, "Study Instance UID doesn't match :", "1.2.392.200036.9116.2.6.1.48.1211418863.1225183167.375775",
337  study->getInstanceUID() );
338  //(0020,000e) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.765855] # 58,1 Series Instance UID
339  CHECK_VALUE(ok, "Series Instance UID doesn't match :", "1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.765855",
340  series->getInstanceUID() );
341  //(0020,0010) SH [12514 ] # 6,1 Study ID
342  //(0020,0011) IS [3 ] # 2,1 Series Number
343  //(0020,0012) IS [3 ] # 2,1 Acquisition Number
344  //(0020,0013) IS [404 ] # 4,1 Instance Number
345  //(0020,0020) CS [L\P ] # 4,2 Patient Orientation
346  //(0020,0032) DS [-36.71875\-88.28125\1350.300] # 28,3 Image Position (Patient)
347 
348  if(!img)
349  {
350  OSLM_ERROR( "Missing image." );
351  return false;
352  }
353 
354  CHECK_VALUE_WITH_TOLERANCE(ok, "Image x origin doesn't match :", -36.71875, img->getOrigin()[0], 0.01);
355  CHECK_VALUE_WITH_TOLERANCE(ok, "Image y origin doesn't match :", -88.28125, img->getOrigin()[1], 0.01);
356  CHECK_VALUE_WITH_TOLERANCE(ok, "Image z origin doesn't match :", 1350.300, img->getOrigin()[2], 0.01);
357  //(0020,0037) DS [1.00000\0.00000\0.00000\0.00000\1.00000\0.00000 ] # 48,6 Image Orientation (Patient)
358  //(0020,0052) UI [1.2.392.200036.9116.2.6.1.48.1211418863.1225183409.15274] # 56,1 Frame of Reference UID
359  //(0020,1040) LO (no value) # 0,1 Position Reference Indicator
360  //(0020,1041) DS [+161.20 ] # 8,1 Slice Location
361  //(0028,0000) UL 158 # 4,1 Generic Group Length
362  //(0028,0002) US 1 # 2,1 Samples per Pixel
363  //(0028,0004) CS [MONOCHROME2 ] # 12,1 Photometric Interpretation
364  //(0028,0010) US 512 # 2,1 Rows
365  //(0028,0011) US 512 # 2,1 Columns
366  CHECK_VALUE(ok, "Image x size doesn't match :", 512, img->getSize()[0] );
367  CHECK_VALUE(ok, "Image y size doesn't match :", 512, img->getSize()[1] );
368  CHECK_VALUE(ok, "Image z size doesn't match :", 404, img->getSize()[2] );
369  //(0028,0030) DS [0.384\0.384 ] # 12,2 Pixel Spacing
370  CHECK_VALUE_WITH_TOLERANCE(ok, "Image x spacing doesn't match :", 0.384, img->getSpacing()[0], 0.001);
371  CHECK_VALUE_WITH_TOLERANCE(ok, "Image y spacing doesn't match :", 0.384, img->getSpacing()[1], 0.001);
372  CHECK_VALUE_WITH_TOLERANCE(ok, "Image z spacing doesn't match :", 0.399, img->getSpacing()[2], 0.001);
373  //(0028,0100) US 16 # 2,1 Bits Allocated
374  //(0028,0101) US 16 # 2,1 Bits Stored
375  CHECK_VALUE(notReallyChecked, "Image Bits Allocated correspond :", 16, img->getType().sizeOf() * 8 );
376  //(0028,0102) US 15 # 2,1 High Bit
377  //(0028,0103) US 1 # 2,1 Pixel Representation
378  CHECK_VALUE(notReallyChecked, "Image Bits Allocated correspond :", false, img->getType().isSigned() );
379  //(0028,1050) DS [500 ] # 4,1-n Window Center
380  CHECK_VALUE(ok, "Image Window Center correspond :", 500, img->getWindowCenter() );
381  //(0028,1051) DS [2500] # 4,1-n Window Width
382  CHECK_VALUE(ok, "Image Window Width correspond :", 2500, img->getWindowWidth() );
383  //(0028,1052) DS [-1024 ] # 6,1 Rescale Intercept
384  //(0028,1053) DS [1 ] # 2,1 Rescale Slope
385  //(0040,0000) UL 116 # 4,1 Generic Group Length
386  //(0040,0002) DA [20081028] # 8,1 Scheduled Procedure Step Start Date
387  //(0040,0003) TM [174327.000] # 10,1 Scheduled Procedure Step Start Time
388  //(0040,0004) DA [20081028] # 8,1 Scheduled Procedure Step End Date
389  //(0040,0005) TM [181327.000] # 10,1 Scheduled Procedure Step End Time
390  //(0040,0244) DA [20081028] # 8,1 Performed Procedure Step Start Date
391  //(0040,0245) TM [174327.000] # 10,1 Performed Procedure Step Start Time
392  //(0040,0253) SH [12325 ] # 6,1 Performed Procedure Step ID
393  //(7005,0000) UL 546 # 4,1 Generic Group Length
394  //(7005,0010) LO [TOSHIBA_MEC_CT3 ] # 16,1 Private Creator
395  //(7005,1007) UN (DS) [335\269 ] # 8,2 Reconstruction Center
396  //(7005,1008) UN (DS) [0.5 ] # 4,1 Detector Slice Thickness in mm
397  //(7005,1009) UN (LO) [1111111111111111] # 16,1 Number of Detector rows to Reconstruct
398  //(7005,100a) UN (DS) [+5.50 ] # 6,1 Table Speed in mm/rot
399  //(7005,100b) UN (SH) [ORG ] # 4,1 Filter
400  //(7005,100d) UN (CS) [DR MOREL] # 8,1 Organ
401  //(7005,100e) UN (SH) [IMG ] # 4,1 File Type Remarks
402  //(7005,100f) UN (SH) [FF] # 2,1 Direction
403  //(7005,1011) UN (LT) [Vol.] # 4,1 Series Comment
404  //(7005,1012) UN (SH) [SU] # 2,1 Position
405  //(7005,1013) UN (US) 1 # 2,1 Expert Plan No.
406  //(7005,1016) UN (UI) [1.2.392.200036.9116.2.6.1.48.1211418863.1225184516.747732] # 58,1 Volume UID
407  //(7005,1017) UN (US) 404 # 2,1 Total Frame Count in the Volume
408  //(7005,1018) UN (US) 404 # 2,1 Frame No.
409  //(7005,1019) UN (UL) 1642763 # 4,1 Frame Sort Key
410  //(7005,101a) UN (US) 1 # 2,1 Frame Sort Order
411  //(7005,101b) UN (SH) [FC30] # 4,1 Convolution Kernel
412  //(7005,101d) UN (UL) 9 # 4,1 Reconstruction Number
413  //(7005,101e) UN (UL) 13 # 4,1 Raw Data Number
414  //(7005,101f) UN (LO) [20081028180156768480] # 20,1 Volume Number
415  //(7005,1020) UN (UL) 3 # 4,1 Local Series Number
416  //(7005,1021) UN (LO) [BOOST ] # 6,1 Decrease in Artifact Filter
417  //(7005,1022) UN (DS) [0.40] # 4,1 Reconstruction Interval
418  //(7005,1023) UN (DS) [0.688 ] # 6,1 Pitch Factor
419  //(7005,1024) UN (DA) [20081024] # 8,1 The Acquisition Date of NRA
420  //(7005,1030) UN (CS) [CT] # 2,1 Main Modality in Study
421  //(7005,1040) UN (FD) 402.4 # 8,1 DLP Dose Length Product
422 
423  return ok;
424 
425 }
426 
427 } // namespace fwTest
static FWTEST_API bool checkSeriesACHGenouTrimmed(const std::shared_ptr< ::fwMedData::ImageSeries > &series)
This method is the same as checkSeriesACHGenou but it checks trimmed strings instead of even sized st...
#define OSLM_ERROR(message)
Definition: spyLog.hpp:274
Definition: Data.hpp:15
static FWTEST_API bool checkSeriesACHGenou(const std::shared_ptr< ::fwMedData::ImageSeries > &series)
Method used to verify if a specific dicom file (stored on the test database) is well read...
#define OSLM_ERROR_IF(message, cond)
Definition: spyLog.hpp:278