comparison Resources/Samples/Lua/AutomatedJpeg2kCompression.lua @ 2294:e371519d4ac9

added -U option to gdcmconv to prevent gdcmconv to mess up the files. Without that option, we have seen the SpecificCharSet tag becoming invalid !!! (seen on the VIX samples)
author Alain Mazy <am@osimis.io>
date Tue, 04 Jul 2017 15:36:19 +0000
parents 1c9e99d2bfd2
children
comparison
equal deleted inserted replaced
2293:9d87f308d35c 2294:e371519d4ac9
14 target:write(dicom) 14 target:write(dicom)
15 target:close() 15 target:close()
16 16
17 -- Compress to JPEG2000 using gdcm 17 -- Compress to JPEG2000 using gdcm
18 local compressed = instanceId .. '-compressed.dcm' 18 local compressed = instanceId .. '-compressed.dcm'
19 os.execute('gdcmconv --j2k ' .. uncompressed .. ' ' .. compressed) 19 os.execute('gdcmconv -U --j2k ' .. uncompressed .. ' ' .. compressed)
20 20
21 -- Generate a new SOPInstanceUID for the JPEG2000 file, as 21 -- Generate a new SOPInstanceUID for the JPEG2000 file, as
22 -- gdcmconv does not do this by itself 22 -- gdcmconv does not do this by itself
23 os.execute('dcmodify --no-backup -gin ' .. compressed) 23 os.execute('dcmodify --no-backup -gin ' .. compressed)
24 24