]> Creatis software - gdcmData.git/blob - checkWriteImplicit.sh
These scripts use now gdcmTests
[gdcmData.git] / checkWriteImplicit.sh
1 # Check READ
2 #-----------
3 #
4 # We just write DCM Files and AFFIM them
5 # to be sure the writting was OK
6 #
7 # Sebastien Barre's files have no interest here, since the header is
8 # a *very clean* ACR-NEMA
9 # Our pb come from DICOM V3, with SQ, shadow groups, etc.
10
11
12 #No Swap Info
13 #------------
14 testWrite mr176621.dcm d;
15 #gdcmParser::CheckSwap: ACR/NEMA unfound swap info (time to raise bets)
16 PrintHeader mr176621.dcm.DCM 2;  . 
17 v mr176621.dcm.DCM; #OK
18 xmedcon mr176621.dcm.DCM; #OK
19
20 # No Transfert Syntax
21 #--------------------
22
23 #Big Endian
24 testWrite cr172241.dcm r;                                  # Big Soucy !!
25 affim filein=cr172241.dcm.RAW nbit=16  DIMX=1792 DIMY=2392;  #OK
26 PrintHeader cr172241.dcm 2;  #OK
27 v cr172241.dcm;   # breaks (white image)   WHITE IMAGE ?!? 
28 xmedcon cr172241.dcm;  # OK
29 #--
30 testWrite cr172241.dcm d;
31 PrintHeader cr172241.dcm.DCM 2; #OK
32 v cr172241.dcm.DCM;       # breaks ?!?
33 xmedcon cr172241.dcm.DCM;  # OK
34
35 testWrite cr_45031.dcm d;                                   
36 v cr_45031.dcm.DCM; #OK
37 xmedcon  cr_45031.dcm.DCM;   #OK
38  
39 testWrite CR-MONO1-10-chest.dcm d;
40 PrintHeader CR-MONO1-10-chest.dcm.DCM 2; #OK
41 xmedcon CR-MONO1-10-chest.dcm.DCM; #OK
42
43 testWrite CT-MONO2-12-lomb-an2.acr2 d;
44 PrintHeader CT-MONO2-12-lomb-an2.acr2.DCM 2; # OK
45 v CT-MONO2-12-lomb-an2.acr2.DCM; #OK
46 xmedcon CT-MONO2-12-lomb-an2.acr2.DCM; #OK
47
48 PrintHeader gdcm-MR-SIEMENS-16.acr1; #OK
49 testWrite gdcm-MR-SIEMENS-16.acr1 d;
50 PrintHeader gdcm-MR-SIEMENS-16.acr1.DCM 2 ; 
51 v  gdcm-MR-SIEMENS-16.acr1.DCM; 
52 xmedcon gdcm-MR-SIEMENS-16.acr1.DCM; #breaks error: No images found
53 xmedcon gdcm-MR-SIEMENS-16.acr1; # OK
54  
55 testWrite gdcm-MR-SIEMENS-16.acr2 d;
56 PrintHeader  gdcm-MR-SIEMENS-16.acr2.DCM 2;
57 v gdcm-MR-SIEMENS-16.acr2.DCM; #OK
58 xmedcon gdcm-MR-SIEMENS-16.acr2.DCM; #breaks
59 #Feb 03 18:50:24 log[4419]: warning: No transfer syntax found
60 #Feb 03 18:50:24 log[4419]: warning: Tag with uneven length
61 #Feb 03 18:50:24 log[4419]: error: No images found
62  
63 testWrite MR-MONO2-12-an2.acr2 d;
64 PrintHeader newACR1000.nema.DCM 2;
65 xmedcon MR-MONO2-12-an2.acr2.DCM; # NOT CHECKED
66
67 testWrite newACR1000.nema d;          # == gdcmMR-SIEMENS-16.acr2
68 PrintHeader newACR1000.nema.DCM; #OK
69 v newACR1000.nema.DCM; #OK
70 xmedcon newACR1000.nema.DCM; # breaks : no image found
71
72 testWrite oldACR00001.ima d;          # == gdcm-MR-SIEMENS.16.acr1
73 PrintHeader oldACR00001.ima.DCM; # OK
74 v oldACR00001.ima.DCM; #OK
75 xmedcon oldACR00001.ima.DCM; # breaks : no image found
76  
77 testWrite OT-MONO2-8-a7.dcm d;
78 xmedcon OT-MONO2-8-a7.dcm.DCM 2; #ok
79  
80 #No Samples Per Pixel
81 #--------------------
82 testWrite gdcm-CR-DCMTK-16-NonSamplePerPix.dcm d;
83 affim filein=gdcm-CR-DCMTK-16-NonSamplePerPix.dcm;
84 PrintHeader  gdcm-CR-DCMTK-16-NonSamplePerPix.dcm.DCM 2; # OK
85
86 #Unnormalized Rectangular LibIDO format image
87 #--------------------------------------------
88 testWrite gdcm-ACR-LibIDO.acr d;
89 v gdcm-ACR-LibIDO.acr.DCM;
90 xmedcon gdcm-ACR-LibIDO.acr.DCM;
91
92 #Bits Allocated =12, Bits Stored=12
93 #----------------------------------
94 #MR Philips (once upon a time in Lyon-Sud)
95 testWrite MR-MONO2-12-angio-an1.acr1 d;
96 v MR-MONO2-12-angio-an1.acr1.DCM;                               # shitty image
97 xmedcon R-MONO2-12-angio-an1.acr1.DCM;#pas mieux : warning: Incorrect PixelData length
98
99 #RGB
100 #---
101 testWrite US.3405.1.dcm d;                    
102 echo "expected  pixelType=8U SamplesPerPixel=1 PlanarConfiguration=0";
103 echo "          PhotometricInterpretation=RGB";
104 xmedcon US.3405.1.dcm.DCM; #OK
105
106 testWrite OT-PAL-8-face.dcm d;
107 echo "expected  pixelType=8U SamplesPerPixel=3 PlanarConfiguration=1";
108 echo "          PhotometricInterpretation=PALETTE COLOR";
109 xmedcon OT-PAL-8-face.dcm.DCM; #OK
110
111 testWrite 8BitsUncompressedColor.dcm d;
112 xmedcon 8BitsUncompressedColor.dcm.DCM ; #OK
113
114 # Implicit VR - Little Endian
115 #-----------------------------
116
117 testWrite CT-MONO2-16-ankle.dcm d;
118  xmedcon CT-MONO2-16-ankle.dcm.DCM; #ok
119  PrintHeader  CT-MONO2-16-ankle.dcm 2; #ok
120
121 testWrite CT-MONO2-16-ort.dcm d;
122 xmedcon CT-MONO2-16-ort.dcm.DCM;  #OK
123 PrintHeader CT-MONO2-16-ort.dcm.DCM 2; #ok
124
125 testWrite CT-MONO2-8-abdo.dcm d;
126 xmedcon CT-MONO2-8-abdo.dcm.DCM; #OK
127
128 testWrite gdcm-MR-PHILIPS-16.dcm d;
129 PrintHeader gdcm-MR-PHILIPS-16.dcm.DCM 2; #OK
130 v gdcm-MR-PHILIPS-16.dcm.DCM; # OK
131 xmedcom gdcm-MR-PHILIPS-16.dcm.DCM; # error: No images found
132 xmedcom gdcm-MR-PHILIPS-16.dcm; # OK with original image
133
134 testWrite MR-MONO2-16-head.dcm d;
135 xmedcon MR-MONO2-16-head.dcm.DCM;  #OK
136
137 testWrite multiframe1Integris.dcm d;
138 PrintHeader CT-MONO2-8-abdo.dcm.DCM 2; #OK
139 v multiframe1Integris.dcm.DCM; #OK
140 xmedcon multiframe1Integris.dcm.DCM; #breaks No images found
141  
142 testWrite multiframe2GE.dcm d;
143 v multiframe2GE.dcm.DCM; #OK
144 #breaks xmedcon
145 xmedcon multiframe2GE.dcm.DCM; #breaks No images found
146
147 v irmPhlipsNew1.dcm;
148 testWrite irmPhlipsNew1.dcm d; # == gdcm-MR-PHILIPS-16.dcm
149 v irmPhlipsNew1.dcm.DCM;                                        # black image
150 xmedcon irmPhlipsNew1.dcm.DCM; #breaks
151
152 #avec imagette (icone)
153
154 testWrite icone.dcm d;
155 PrintHeader icone.dcm.DCM 2;
156 #PrintHeader OK; v OK; breaks xmedcom  
157 v icone.dcm.DCM;
158 xmedcon icone.dcm.DCM; #breaks
159
160 #Palette
161
162 # ???
163 # 8 Bits  ?
164 # 16 Bits ?
165
166 #Explicit VR - Little Endian
167 #----------------------------
168 testWrite CT-MONO2-16-brain.dcm d;
169 xmedcon CT-MONO2-16-brain.dcm.DCM; #OK
170
171 PrintHeader gdcm-MR-PHILIPS-16-Multi-Seq.dcm 2;
172 xmedcon gdcm-MR-PHILIPS-16-Multi-Seq.dcm #OK :Skip PHILIPS premature item bug
173 v gdcm-MR-PHILIPS-16-Multi-Seq.dcm; #OK
174 testWrite gdcm-MR-PHILIPS-16-Multi-Seq.dcm d;
175 PrintHeader gdcm-MR-PHILIPS-16-Multi-Seq.dcm.DCM 2;   #pixel group missing ?!?
176 v gdcm-MR-PHILIPS-16-Multi-Seq.dcm.DCM;                #NOT CHECKED
177 xmedcon gdcm-MR-PHILIPS-16-Multi-Seq.dcm.DCM; #breaks
178
179 testWrite gdcm-MR-PHILIPS-16-NonRectPix.dcm d;
180 v gdcm-MR-PHILIPS-16-NonRectPix.dcm.DCM; #OK
181 xmedcon gdcm-MR-PHILIPS-16-NonRectPix.dcm.DCM; #OK
182
183 testWrite MR-MONO2-8-16x-heart.dcm d; #multiframe
184 v MR-MONO2-8-16x-heart.dcm.DCM; #OK
185 xmedcon MR-MONO2-8-16x-heart.dcm.DCM; #OK
186
187 testWrite NM-MONO2-16-13x-heart.dcm d;  #multiframe
188 xmedcon NM-MONO2-16-13x-heart.dcm.DCM; #OK
189
190 testWrite sonataMonaco.dcm d;
191 xmedcon sonataMonaco.dcm.DCM; #OK
192
193 #MultiFrame
194 testWrite US-MONO2-8-8x-execho.dcm d;
195 PrintHeader US-MONO2-8-8x-execho.dcm.DCM;  
196 xmedcon US-MONO2-8-8x-execho.dcm.DCM; #OK
197
198 #RGB
199
200 testWrite US-RGB-8-epicard.dcm d;
201 echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=1";
202 echo "         PhotometricInterpretation=RGB";
203  xmedcon US-RGB-8-epicard.dcm.DCM; #OK
204
205 testWrite US-RGB-8-esopecho.dcm d;
206 echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=0";
207 echo "         PhotometricInterpretation=RGB",
208 xmedcon US-RGB-8-esopecho.dcm.DCM; #OK
209
210 # Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])
211 #--------------------------------------------------------------------------
212 # (JPEG Lossless)
213
214 testWrite CT-MONO2-16-chest.dcm d;
215 xmedcon CT-MONO2-16-chest.dcm.DCM; #OK
216
217 testWrite 012345.002.050.dcm d;
218 xmedcon 012345.002.050.dcm.DCM; #OK
219
220 testWrite gdcm-JPEG-LossLess3a.dcm d;
221 PrintHeader gdcm-JPEG-LossLess3a.dcm.DCM 2;
222 xmedcon gdcm-JPEG-LossLess3a.dcm.DCM;  #OK
223
224 testWrite XA-MONO2-8-12x-catheter.dcm d;
225 PrintHeader XA-MONO2-8-12x-catheter.dcm.DCM 2;
226 xmedcon XA-MONO2-8-12x-catheter.dcm.DCM; #OK
227
228 testWrite xa_integris.dcm d;
229 echo "a lot of fragments expected here";
230 xmedcon xa_integris.dcm.DCM #OK
231
232 testWrite 16BitsJpegLosslessGrayScale.dcm d;
233 xmedcon 16BitsJpegLosslessGrayScale.dcm.DCM #OK
234
235 #comming from GE dlx via VTServer
236 v I9000001.dcm;
237 testWrite I9000001.dcm d;
238 PrintHeader I9000001.dcm.DCM 2;
239 #black image 
240 v I9000001.dcm.DCM; 
241 #no image found
242 xmedcon I9000001.dcm.DCM;
243
244 #JPEG Extended (Process 2 & 4) // 16 bits
245 #-----------------------------
246 testWrite gdcm-JPEG-Extended.dcm d;
247 xmedcon gdcm-JPEG-Extended.dcm.DCM; #OK
248
249 testWrite jpeglossy1.dcm d;
250 xmedcon jpeglossy1.dcm.DCM #OK
251
252 #JPEG Baseline (Process 14)
253 #--------------------------
254 testWrite MR-MONO2-12-shoulder.dcm d;  
255 xmedcon MR-MONO2-12-shoulder.dcm.DCM; #OK
256
257
258 #fichier format ecat.
259 #testWrite imageEcat.ecat r
260
261 #JPEG Lossy 8 bits 
262 #=================
263 #JPEG Baseline (Process 1)
264 #-------------------------
265 # Bracco Files
266 testWrite US.1.2.dcm d;
267 echo "expected : A lot of Fragments (40), nb Frames = 40 ;-)";
268 echo "expected  pixelType=8U SamplesPerPixel=3 PlanarConfiguration=0";
269 echo "          PhotometricInterpretation=YBR_FULL_422";
270 xmedcon US.1.2.dcm.DCM;  #OK
271
272 #Sequoia Acusson U11
273 testWrite CLIP0001-Sequoia-U11.dcm d;
274 xmedcon CLIP0001-Sequoia-U11.dcm.DCM; #OK
275
276 #RLE Lossless
277 #-------------
278 testWrite canadaAloka.dcm d;
279 echo "expected pixelType=8U SamplesPerPixel=1";
280 echo "         PlanarConfiguration=0 PhotometricInterpretation=MONOCHROME2";
281 echo "         nb Frames (DIMZ) : 1";
282 xmedcon canadaAloka.dcm.DCM;
283
284 testWrite jpeglossy1.dcm d;
285  xmecon jpeglossy1.dcm.DCM; #OK
286
287 testWrite FMAG0001.dcm d; 
288 echo "expected pixelType=8U SamplesPerPixel=3";
289 echo "         PlanarConfiguration=1 PhotometricInterpretation=YBR_FULL";
290 echo "         nb Frames (DIMZ) : 1";
291 xmedcon FMAG0001.dcm.DCM; #OK
292
293 v QMAG0001.dcm; #OK
294 xmedcon QMAG0001.dcm; #original breaks xmedcon
295 testWrite QMAG0001.dcm d; 
296 echo "expected pixelType=8U SamplesPerPixel=3";
297 echo "         PlanarConfiguration=1 PhotometricInterpretation=YBR_FULL";
298 v QMAG0001.dcm.DCM; #OK
299 xmedcon QMAG0001.dcm.DCM; #OK
300
301 testWrite US-PAL-8-10x-echo.dcm d;
302 echo "expected pixelType=8U SamplesPerPixel=1 PlanarConfiguration=0";
303 echo "         PhotometricInterpretation=PALETTE COLOR";
304 echo "         nb Frames (DIMZ): 10";
305 echo "expected : Parsing 10 'single fragment' Segments";
306 echo "           Reading 10 'single fragment' Segments (ouf!)";
307 xmedcon US-PAL-8-10x-echo.dcm.DCM; #OK
308
309 testWrite 8BitsRunLengthGrayScale.dcm d;
310 echo "expected : correct Gray image";
311 xmedcon 8BitsRunLengthGrayScale.dcm.DCM; #OK
312
313 testWrite 8BitsRunLengthColor.dcm d;
314 echo "expected pixelType=8U SamplesPerPixel=1 PlanarConfiguration=2";
315 echo "         PhotometricInterpretation=PALETTE COLOR";
316 echo "expected correct color image";
317 xmedcon 8BitsRunLengthColor.dcm.DCM;  #OK
318
319 #RLE 16 bits --> Try to find some more images
320
321 testWrite 16BitsRunLengthGrayScale.dcm d;
322 echo "expected pixelType=16U SamplesPerPixel=1 PlanarConfiguration=0";
323 echo "         PhotometricInterpretation=MONOCHROME2";
324 xmedcon 16BitsRunLengthGrayScale.dcm.DCM; #OK
325
326 #Were supposed to be bugged
327 #--------------------------
328 #(break xmedcon)
329  xmedcon 00191113.dcm; #No images found
330 testWrite 00191113.dcm d;
331 xmedcon 00191113.dcm.DCM; #OK
332
333 xmedcon DermaColorLossLess.dcm; #breaks xmedcon : No images found
334 testWrite DermaColorLossLess.dcm d;
335 xmedcon DermaColorLossLess.dcm.DCM; #breaks xmedcon 
336 #Feb 02 19:33:16 log[2619]: warning: Tag with uneven length
337 #Feb 02 19:33:16 log[2619]: warning: No transfer syntax found
338 #Feb 02 19:33:16 log[2619]: error: No images found
339 v DermaColorLossLess.dcm.DCM #OK
340
341 #Original breaks xmedcon, affimdcm complian ?!
342 affimdcm filein=RadBWLossLess.dcm; #OK
343 v RadBWLossLess.dcm; #OK
344 xmedcon RadBWLossLess.dcm; # breaks :error: No images found
345 testWrite RadBWLossLess.dcm d;
346 v RadBWLossLess.dcm.DCM; #OK
347 xmedcon RadBWLossLess.dcm.DCM; #error: No images found
348
349 #Known as BUGGED !
350 #----------------
351
352 #Rectangular old 24 Bits image
353 testWrite gdcm-RGB-LibIDORect.acr d;
354 v gdcm-RGB-LibIDORect.acr.DCM;
355 xmedcon gdcm-RGB-LibIDORect.acr.DCM; # breaks : large Bit Allocated (24)
356 #TODO transform '24 bit images' into 8 bits + samples per pixel = 3
357
358 #MR GE GENESIS_SIGNA Palo Alto
359 testWrite DicomSampleNastyGEImage.dcm d;
360 echo " expected : warning uneven length (13) for 0008|103e";
361 xmedcon DicomSampleNastyGEImage.dcm.DCM; #OK
362
363 #MR Philips NTSCAN Hop. Neuro Lyon
364 PrintHeader philipsMR-lossy.ima #OK
365 xmedcon philipsMR-lossy.ima; #original breaks xmedcon
366 v philipsMR-lossy.ima; #Original OK
367 testWrite philipsMR-lossy.ima d; 
368 echo "WAS expected : 'Bogus Huffman table definition' on philipsMR-lossy.ima";
369 echo "IS  expected : 'JERR_BAD_HUFF_TABLE sym 16 (>15)' but the show goes on";
370 v philipsMR-lossy.ima.DCM;  #OK
371 xmedcon philipsMR-lossy.ima.DCM; #OK
372
373 #CT Siemens Hop. Salengro Lille
374 testWrite gdcm-JPEG-LossLess3a.dcm d;
375 echo "expected : wrong sequence delimiter (b00c,0eb6) at end of pixels";
376 echo "xmedcon says 'error: Unexpected end of file'";
377 vtkgdcmViewer gdcm-JPEG-LossLess3a.dcm.DCM;  #OK; needs 'R' for display   
378 xmedcon gdcm-JPEG-LossLess3a.dcm.DCM; #OK
379
380 #CR Philips Thoravision Hop Cardio Lyon
381 affimdcm filein=gdcm-JPEG-LossLessThoravision.dcm; # OK, wrong image as usual
382 xmedcon gdcm-JPEG-LossLessThoravision.dcm;        #original seg faults xmedcon
383 testWrite gdcm-JPEG-LossLessThoravision.dcm d; #breaks ; 
384 echo "expected : 147 fragments,length : 29860 + 145*32760 + 14416";
385 echo "breaks xmedcom, breaks e-film";
386 echo "WAS expected : hashed image -with jLBJpeg-";
387 echo "IS  expected : Seg Fault";
388 xmedcon gdcm-JPEG-LossLessThoravision.dcm.DCM; # NOT CHECKED
389
390 #MR Picker ST. ANTHONY HOSPITAL
391 testWrite MR.6799.1.dcm d;
392 echo "OK; DICOM Image with NO Preamble";
393 xmedcon MR.6799.1.dcm.DCM; #OK
394
395 #Segmented Palette Color LUT Data
396 xmedcon gdcm-US-ALOKA-16.dcm; #breaks
397 vtkgdcmViewer gdcm-US-ALOKA-16.dcm3; #OK
398 testWrite gdcm-US-ALOKA-16.dcm d;                             
399 echo "expected  pixelType=16U SamplesPerPixel=1 PlanarConfiguration=0";
400 echo "          PhotometricInterpretation=PALETTE COLOR";
401 echo "expected : Gray image since 'Segmented xxx Palette Color LUT Data' not yet taken into account";
402 echo "neither e-film nor DicomWorks deals with the color"
403 echo "breaks xmedcom";
404 echo "breaks vtkgdcmViewer (bad result : 24 bits expected; 16 found in Pixels area)";
405 vtkgdcmViewer gdcm-US-ALOKA-16.dcm.DCM; #OK
406 xmedcon gdcm-US-ALOKA-16.dcm.DCM; #breaks
407 #Feb 03 13:40:19 log[26999]: error: Missing CLUT
408 #Feb 03 13:40:19 log[26999]: error: No images found
409
410 # bugged Siemens 'Leonardo' image
411 testWrite 8078283Leonardo.dcm d;
412 xmedcon 8078283Leonardo.dcm.DCM; #OK
413
414 #CT McTwin Elscint C.H.R.U  LILLE  C.HURIEZ
415  xmedcon MxTwinLossLess.dcm; #breaks
416  v MxTwinLossLess.dcm; #OK
417  testWrite MxTwinLossLess.dcm d;
418  v MxTwinLossLess.dcm.DCM;  #OK
419  xmedcon MxTwinLossLess.dcm.DCM #breaks
420
421 # MRI image from VPRO burned CD
422 v mriThruVPRO.dcm;                               # Tasteless SHIT
423 xmedcon mriThruVPRO.dcm;                         # pas mieux
424 testWrite mriThruVPRO.dcm d;
425 v mriThruVPRO.dcm.DCM; 
426 echo "expected : tasteless SHIT !"
427 echo "breaks Siemens Leonardo viewer . JPEG encoding is bugged?"
428
429 # gdcm made Theralys image
430 # due to H table, a SeQuence is tagged with 0 length
431 # when using gdcmFile::WriteDcmXXX
432 xmedcon fromTheralys.dcm; # Original breaks xmedcon
433 testWrite fromTheralys.dcm d;
434 v fromTheralys.dcm.DCM; # OK (unsolved Length = 13 ...)
435 xmedcon fromTheralys.dcm.DCM; # Breaks : no image found