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