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