+# Check READ
+#-----------
+#
+# We just write RAW Files and AFFIM them
+# to be sure the reading was OK
+#
+
+#No Swap Info
+#------------
+testWrite mr176621.dcm r;
+affim filein=mr176621.dcm.raw DIMX=512 DIMY=512 nbit=16
+
+# No Transfert Syntax
+#--------------------
+testWrite cr172241.dcm r;
+affim filein=cr172241.dcm.raw DIMX=1792 DIMY=2392 nbit=16 zoom=-4
+
+testWrite cr_45031.dcm r
+affim filein=cr_45031.dcm.raw DIMX=1670 DIMY=2010 nbit=16 zoom=-4
+
+testWrite CR-MONO1-10-chest.dcm r
+affim filein=CR-MONO1-10-chest.dcm.raw DIMX=440 DIMY=440 nbit=16
+
+testWrite CT-MONO2-12-lomb-an2.acr2 r
+affim filein=CT-MONO2-12-lomb-an2.acr2.raw DIM=512 nbit=16
+
+testWrite gdcm-MR-SIEMENS-16.acr1 r
+affim filein=gdcm-MR-SIEMENS-16.acr1.raw DIMX=256 DIMY=256 nbit=16
+
+testWrite gdcm-MR-SIEMENS-16.acr2 r
+affim filein=gdcm-MR-SIEMENS-16.acr2.raw DIMX=512 DIMY=512 nbit=16
+
+testWrite MR-MONO2-12-an2.acr2 r
+affim filein=MR-MONO2-12-an2.acr2.raw DIMX=256 DIMY=256 nbit=16
+
+testWrite newACR1000.nema r # == gdcmMR-SIEMENS-16.acr2
+affim filein=newACR1000.nema.raw DIMX=512 DIMY=512 nbit=16
+
+testWrite oldACR00001.ima r # == gdcm-MR-SIEMENS.16.acr1
+affim filein=oldACR00001.ima.raw DIMX=256 DIMY=256 nbit=16
+
+testWrite OT-MONO2-8-a7.dcm r
+affim filein=OT-MONO2-8-a7.dcm.raw DIMX=512 DIMY=512
+
+#No Samples Per Pixel
+#--------------------
+testWrite gdcm-CR-DCMTK-16-NonSamplePrPix.dcm r
+affim filein=gdcm-CR-DCMTK-16-NonSamplePrPix.dcm dim=750 nbit=8
+
+#Unnormalized Rectangular LibIDO format image
+#--------------------------------------------
+testWrite gdcm-ACR-LibIDO.acr r
+affim filein=gdcm-ACR-LibIDO.acr.raw dimx=512 dimy=301
+
+#Bits Allocated =12, Bits Stored=12
+#----------------------------------
+#MR Philips (once upon a time in Lyon-Sud)
+testWrite MR-MONO2-12-angio-an1.acr1 r
+affim filein=MR-MONO2-12-angio-an1.acr1.raw dim=256 nbit=16
+
+#RGB
+#---
+testWrite US.3405.1.dcm r
+echo "expected pixelType=8U SamplesPerPixel=1 PlanarConfiguration=0"
+echo " PhotometricInterpretation=RGB"
+affim filein=US.3405.1.dcm.raw DIMX=768 DIMY=576 nbit=24
+
+testWrite OT-PAL-8-face.dcm r
+echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=1"
+echo " PhotometricInterpretation=PALETTE COLOR"
+affim filein=OT-PAL-8-face.dcm.raw dimx=640 dimy=480 nbit=24
+
+testWrite 8BitsUncompressedColor.dcm r
+affim filein=8BitsUncompressedColor.dcm.raw dimx=800 dimy=535 nbit=24
+
+# Implicit VR - Little Endian
+#-----------------------------
+
+testWrite CT-MONO2-16-ankle.dcm r
+ affim filein=CT-MONO2-16-ankle.dcm.raw DIMX=512 DIMY=512 nbit=16 signe=o
+
+testWrite CT-MONO2-16-ort.dcm r
+affim filein=CT-MONO2-16-ort.dcm.raw DIMX=512 DIMY=512 nbit=16 signe=o
+
+testWrite CT-MONO2-8-abdo.dcm r
+affim filein=CT-MONO2-8-abdo.dcm.raw DIMX=512 DIMY=512
+
+testWrite gdcm-MR-PHILIPS-16.dcm r
+affim filein=gdcm-MR-PHILIPS-16.dcm.raw DIMX=256 DIMY=256 nbit=16
+
+testWrite MR-MONO2-16-head.dcm r
+affim filein=MR-MONO2-16-head.dcm.raw dim=256 nbit=16 signe=o
+
+testWrite multiframe1Integris.dcm r
+affim filein=multiframe1Integris.dcm.raw dim=1024 nbit=16 zoom=-2
+affim filein=multiframe1Integris.dcm.raw dim=1024 nbit=16 offset=31457280 zoom=-2
+
+testWrite multiframe2GE.dcm r
+affim filein=multiframe2GE.dcm.raw dim=512
+affim filein=multiframe2GE.dcm.raw dim=512 offset=14417920
+
+testWrite irmPhlipsNew1.dcm r # == gdcm-MR-PHILIPS-16.dcm
+affim DIMX=256 DIMY=256 filein=irmPhlipsNew1.dcm.raw nbit=16
+
+#avec imagette (icone)
+
+testWrite icone.dcm r
+echo "Hopeless till we stop considering the Tag as an identifier inside the Header"
+echo "The Tag is an identifier inside the *Dicom Dictionnary* only"
+affim filein=icone.dcm bypassacr=1 dim=512 nbit=16 offset=18240
+affim filein=icone.dcm dim=64 offset=13984 bypassacr=1
+affim filein=icone.dcm.raw dim=512 nbit=16
+
+#Palette
+
+# ???
+# 8 Bits ?
+# 16 Bits ?
+
+#Explicit VR - Little Endian
+#----------------------------
+testWrite CT-MONO2-16-brain.dcm r
+affim filein=CT-MONO2-16-brain.dcm.raw DIMX=512 DIMY=512 nbit=16 signe=o
+
+testWrite gdcm-MR-PHILIPS-16-Multi-Seq.dcm r
+affim filein=gdcm-MR-PHILIPS-16-Multi-Seq.dcm.raw DIMX=128 DIMY=128 nbit=16
+
+testWrite gdcm-MR-PHILIPS-16-NonRectPix.dcm r
+affim filein=gdcm-MR-PHILIPS-16-NonRectPix.dcm.raw DIMX=160 DIMY=64 nbit=16
+
+testWrite MR-MONO2-8-16x-heart.dcm r
+affim filein=MR-MONO2-8-16x-heart.dcm.raw DIMX=256 DIMY=256
+
+testWrite NM-MONO2-16-13x-heart.dcm r
+affim filein=NM-MONO2-16-13x-heart.dcm.raw DIMX=64 DIMY=64 nbit=16
+affim filein=NM-MONO2-16-13x-heart.dcm.raw DIMX=64 DIMY=64 nbit=16 offset=98304
+
+testWrite sonataMonaco.dcm r
+affim filein=sonataMonaco.dcm.raw DIMX=256 DIMY=208 nbit=16
+
+#MultiFrame
+testWrite US-MONO2-8-8x-execho.dcm r
+affim filein=US-MONO2-8-8x-execho.dcm.raw DIMX=128 DIMY=120
+affim filein=US-MONO2-8-8x-execho.dcm.raw DIMX=128 DIMY=120 offset=92160
+
+#RGB
+
+testWrite US-RGB-8-epicard.dcm r
+echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=1"
+echo " PhotometricInterpretation=RGB"
+affim filein=US-RGB-8-epicard.dcm.raw dimx=640 dimy=480 nbit=24
+
+testWrite US-RGB-8-esopecho.dcm r
+echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=0"
+echo " PhotometricInterpretation=RGB"
+affim filein=US-RGB-8-esopecho.dcm.raw dimx=256 dimy=120 nbit=24
+
+# Non-Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])
+#--------------------------------------------------------------------------
+# (JPEG Lossless)
+
+testWrite CT-MONO2-16-chest.dcm r;
+affim filein=CT-MONO2-16-chest.dcm.raw dimx=512 dimy=400 nbit=16 signe=o
+
+testWrite 012345.002.050.dcm r
+affim filein=012345.002.050.dcm.raw dim=256 nbit=16
+
+testWrite gdcm-JPEG-LossLess3a.dcm r;
+affim filein=gdcm-JPEG-LossLess3a.dcm.raw dim=512 nbit=16
+
+testWrite XA-MONO2-8-12x-catheter.dcm r;
+affim filein=XA-MONO2-8-12x-catheter.dcm.raw dim=512;
+affim filein=XA-MONO2-8-12x-catheter.dcm.raw dim=512 offset=262144
+affim filein=XA-MONO2-8-12x-catheter.dcm.raw dim=512 offset=2883584
+
+testWrite xa_integris.dcm r;
+echo "a lot of fragments expected here"
+affim filein=xa_integris.dcm.raw dim=512
+affim filein=xa_integris.dcm.raw dim=512 offset=13107200
+affim filein=xa_integris.dcm.raw dim=512 offset=19660800
+
+testWrite 16BitsJpegLosslessGrayScale.dcm r
+affim filein=16BitsJpegLosslessGrayScale.dcm.raw DIMX=800 DIMY=535 nbit=16
+
+#comming from GE dlx via VTServer
+testWrite I9000001.dcm r
+affim filein=I9000001.dcm.raw dim=512
+affim filein=I9000001.dcm.raw dim=512 offset=7864320
+
+#JPEG Extended (Process 2 & 4) // 16 bits
+#-----------------------------
+testWrite gdcm-JPEG-Extended.dcm r;
+affim filein=gdcm-JPEG-Extended.dcm.raw dim=512 nbit=16
+
+testWrite jpeglossy1.dcm r;
+affim filein=jpeglossy1.dcm.raw dim=512 nbit=16
+
+#JPEG Baseline (Process 14)
+#--------------------------
+testWrite MR-MONO2-12-shoulder.dcm r
+affim filein=MR-MONO2-12-shoulder.dcm.raw DIMX=1024 DIMY=1024 nbit=16
+
+
+#fichier format ecat.
+#testWrite imageEcat.ecat r
+
+#JPEG Lossy 8 bits
+#=================
+#JPEG Baseline (Process 1)
+#-------------------------
+# Bracco Files
+testWrite US.1.2.dcm r
+echo "expected : A lot of Fragments (40), nb Frames = 40 ;-)"
+echo "expected pixelType=8U SamplesPerPixel=3 PlanarConfiguration=0"
+echo " PhotometricInterpretation=YBR_FULL_422"
+affim filein=US.1.2.dcm.raw DIMX=768 DIMY=576 nbit=24
+affim filein=US.1.2.dcm.raw DIMX=768 DIMY=576 nbit=24 offset=13271040
+affim filein=US.1.2.dcm.raw DIMX=768 DIMY=576 nbit=24 offset=39813120
+
+#Sequoia Acusson U11
+testWrite CLIP0001-Sequoia-U11.dcm r
+affim filein=CLIP0001-Sequoia-U11.dcm.raw DIMX=768 DIMY=576 nbit=24
+affim filein=CLIP0001-Sequoia-U11.dcm.raw DIMX=768 DIMY=576 nbit=24 offset=1327104
+affim filein=CLIP0001-Sequoia-U11.dcm.raw DIMX=768 DIMY=576 nbit=24 offset=13271040
+affim filein=CLIP0001-Sequoia-U11.dcm.raw DIMX=768 DIMY=576 nbit=24 offset=26542080
+
+#RLE Lossless
+#-------------
+testWrite canadaAloka.dcm r
+echo "expected pixelType=8U SamplesPerPixel=1"
+echo " PlanarConfiguration=0 PhotometricInterpretation=MONOCHROME2"
+echo " nb Frames (DIMZ) : 1"
+affim filein=canadaAloka.dcm.raw DIMX=608 DIMY=420
+
+testWrite FMAG0001.dcm r
+echo "expected pixelType=8U SamplesPerPixel=3"
+echo " PlanarConfiguration=1 PhotometricInterpretation=YBR_FULL"
+echo " nb Frames (DIMZ) : 1"
+affim filein=FMAG0001.dcm.raw DIMX=768 DIMY=576 nbit=24
+
+testWrite QMAG0001.dcm r
+echo "expected pixelType=8U SamplesPerPixel=3"
+echo " PlanarConfiguration=1 PhotometricInterpretation=YBR_FULL"
+affim filein=QMAG0001.dcm.raw DIMX=384 DIMY=288 nbit=24;
+
+testWrite US-PAL-8-10x-echo.dcm r
+echo "expected pixelType=8U SamplesPerPixel=1 PlanarConfiguration=0"
+echo " PhotometricInterpretation=PALETTE COLOR"
+echo " nb Frames (DIMZ): 10"
+echo "expected : Parsing 10 'single fragment' Segments"
+echo " Reading 10 'single fragment' Segments (ouf!)"
+affim filein=US-PAL-8-10x-echo.dcm.raw DIMX=600 DIMY=430 nbit=24
+affim filein=US-PAL-8-10x-echo.dcm.raw DIMX=600 DIMY=430 nbit=24 offset=774000
+affim filein=US-PAL-8-10x-echo.dcm.raw DIMX=600 DIMY=430 nbit=24 offset=1548000
+affim filein=US-PAL-8-10x-echo.dcm.raw DIMX=600 DIMY=430 nbit=24 offset=6966000
+
+testWrite 8BitsRunLengthGrayScale.dcm r
+echo "expected : correct Gray image"
+affim filein=8BitsRunLengthGrayScale.dcm.raw DIMX=800 DIMY=535
+
+testWrite 8BitsRunLengthColor.dcm r
+echo "expected pixelType=8U SamplesPerPixel=1 PlanarConfiguration=2"
+echo " PhotometricInterpretation=PALETTE COLOR"
+echo "expected correct color image"
+affim filein=8BitsRunLengthColor.dcm.raw DIMX=800 DIMY=535 nbit=24
+
+#RLE 16 bits --> Try to find some more images
+
+testWrite 16BitsRunLengthGrayScale.dcm r
+echo "expected pixelType=16U SamplesPerPixel=1 PlanarConfiguration=0"
+echo " PhotometricInterpretation=MONOCHROME2"
+affim filein=16BitsRunLengthGrayScale.dcm.raw DIMX=800 DIMY=535 nbit=16
+
+#Were supposed to be bugged
+#--------------------------
+#(break xmedcon)
+
+testWrite 00191113.dcm r
+affim filein=00191113.dcm.raw DIMX=512 DIMY=512
+affim filein=00191113.dcm.raw DIMX=512 DIMY=512 offset=786432
+
+testWrite DermaColorLossLess.dcm r
+affim filein=DermaColorLossLess.dcm.raw DIMX=117 DIMY=181 nbit=24
+
+testWrite RadBWLossLess.dcm r
+affim filein=RadBWLossLess.dcm.raw DIMX=136 DIMY=92 nbit=16
+
+#Known as BUGGED !
+#----------------
+
+#Rectangular old 24 Bits image
+testWrite gdcm-RGB-LibIDORect.acr r
+affim filein=gdcm-RGB-LibIDORect.acr.raw DIMX=400 DIMY=100 nbit=24
+
+#MR GE GENESIS_SIGNA Palo Alto
+testWrite DicomSampleNastyGEImage.dcm r
+echo "WAS expected : wrong lenth (13) for 0008|103e"
+affim filein=DicomSampleNastyGEImage.dcm.raw DIMX=256 DIMY=256 nbit=16
+
+#MR Philips NTSCAN Hop. Neuro Lyon
+testWrite philipsMR-lossy.ima r;
+echo "WAS expected : 'Bogus Huffman table definition' on philipsMR-lossy.ima"
+echo "IS expected : 'JERR_BAD_HUFF_TABLE sym 16 (>15') but the show goes on"
+echo "breaks xmedcon"
+affim filein=philipsMR-lossy.ima.raw dim=512 nbit=16
+
+#CT Siemens Hop. Salengro Lille
+testWrite gdcm-JPEG-LossLess3a.dcm r;
+echo "expected : wrong sequence delimiter (b00c,0eb6) at end of pixels";
+echo "xmedcon says 'error: Unexpected end of file'"
+affim filein=gdcm-JPEG-LossLess3a.dcm.raw dim=512 nbit=16
+vtkgdcmViewer gdcm-JPEG-LossLess3a.dcm
+
+#CR Philips Thoravision Hop Cardio Lyon
+testWrite gdcm-JPEG-LossLessThoravision.dcm r
+echo "expected : 147 fragments,length : 29860 + 145*32760 + 14416"
+echo "breaks xmedcom, breaks e-film"
+echo "WAS expected : hashed image -with jLBJpeg-"
+echo "IS expected : Seg Fault"
+affim filein=gdcm-JPEG-LossLessThoravision.dcm.raw DIMX=1876 DIMY=2076 nbit=16
+
+#MR Picker ST. ANTHONY HOSPITAL
+testWrite MR.6799.1.dcm r
+echo "OK; DICOM Image with NO Preamble"
+affim filein=MR.6799.1.dcm.raw dim=512 nbit=16
+
+#Segmented Palette Color LUT Data
+testWrite gdcm-US-ALOKA-16.dcm r
+echo "expected pixelType=16U SamplesPerPixel=1 PlanarConfiguration=0"
+echo " PhotometricInterpretation=PALETTE COLOR"
+echo "expected : Gray image since 'Segmented xxx Palette Color LUT Data' not yet taken into account"
+echo "neither e-film nor DicomWorks deals with the color"
+echo "breaks xmedcom"
+echo "breaks vtkgdcmViewer (bad result : 24 bits expected; 16 found in Pixels area)"
+vtkgdcmViewer gdcm-US-ALOKA-16.dcm
+affim dimx=640 dimy=480 filein=gdcm-US-ALOKA-16.dcm.raw nbit=16
+
+# bugged Siemens 'Leonardo' image
+testWrite 8078283Leonardo.dcm r
+affim filein=8078283Leonardo.dcm.raw dim=512 nbit=16
+
+#CT McTwin Elscint C.H.R.U LILLE C.HURIEZ
+testWrite MxTwinLossLess.dcm r
+affim filein=MxTwinLossLess.dcm.raw DIMX=512 DIMY=512 nbit=16
+
+# MRI image from VPRO burned CD
+testWrite mriThruVPRO.dcm r
+affim filein=mriThruVPRO.dcm.raw DIMX=256 DIMY=256 nbit=16
+echo "expected : tasteless SHIT !"
+echo "breaks Siemens Leonardo viewer . JPEG encoding is bugged?"