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