My modalities send studies to Orthanc in uncompressed raw format which takes up a lot of space and is slow to load over the web.Is it possible for Orthanc to convert them to a format like JPEG2000 and then save them ?

Yeppers, this was just asked a few forum posts back. Link is below. You can do this by using a Lua script when the images arrive:

https://groups.google.com/forum/#!topic/orthanc-users/HW7opCMOrEg

Thanks for your reply but I want to achieve this with just one instance of Orthanc. The demo you pointed me to requires two instances if I’m not mistaken ?

No, you just need one instance. The link I sent is for setting up a test environment using a few instances. A link to the code you would need is below:

I wouldnt need the last line in the transcodeAndForward.lua script in my case would I?

```
Delete(SendToModality(jpeg2kInstance['ID'], 'pacs'))
Also what if the image being received in already in JPEG2000 format? Will it still be transcoded ? My Lua scripting skills are pathetic :-(
```

Im getting the following errors after enabling the script and importing a study:

bb86-d496009e-c5d70716-88bc7d77-compressed.dcm: No such file or directory

E0401 06:19:44.427490 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.458752 LuaFunctionCall.cpp:108] [string “line”]:23: e67fa185-d4985963-09d66073-00a2a96a-cff28bd2-compressed.dcm: No such file or directory

E0401 06:19:44.458752 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.527539 LuaFunctionCall.cpp:108] [string “line”]:23: 5f05f684-3e836da0-c903f097-14c7bcf2-f7be3f78-compressed.dcm: No such file or directory

E0401 06:19:44.527539 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.558801 LuaFunctionCall.cpp:108] [string “line”]:23: 282e9df6-83b99ad8-e8f55f9c-40f301b1-00d2dec6-compressed.dcm: No such file or directory

E0401 06:19:44.558801 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.574427 LuaFunctionCall.cpp:108] [string “line”]:23: 1e8c547c-8d1e5de8-34e5cd9c-68ca91a6-d88450cd-compressed.dcm: No such file or directory

E0401 06:19:44.590545 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.627815 LuaFunctionCall.cpp:108] [string “line”]:23: 3aef3440-192d3107-5e2fbf1b-990fdf18-3d1b7e67-compressed.dcm: No such file or directory

E0401 06:19:44.627815 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.659065 LuaFunctionCall.cpp:108] [string “line”]:23: 684af172-fce7b02b-c3537f83-8d44ef4a-e7d48b1b-compressed.dcm: No such file or directory

E0401 06:19:44.659065 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.696815 LuaFunctionCall.cpp:108] [string “line”]:23: eb5ec568-aa89948c-3b160dd8-905c40b0-c36e37b2-compressed.dcm: No such file or directory

E0401 06:19:44.712442 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.728067 LuaFunctionCall.cpp:108] [string “line”]:23: 7ff64aaf-faa685c1-7e182c68-e1e51df1-23acc2f9-compressed.dcm: No such file or directory

E0401 06:19:44.728067 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.759335 LuaFunctionCall.cpp:108] [string “line”]:23: 2f16c042-1fc060c6-c2aacdbb-cb17b163-59b727fd-compressed.dcm: No such file or directory

E0401 06:19:44.759335 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.796590 LuaFunctionCall.cpp:108] [string “line”]:23: b10ff29c-98d59811-51a61be2-5dbd8c83-053512a0-compressed.dcm: No such file or directory

E0401 06:19:44.812281 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.827907 LuaFunctionCall.cpp:108] [string “line”]:23: 57a2f313-b55e1f4d-92e5d829-746f11d9-cad5d573-compressed.dcm: No such file or directory

E0401 06:19:44.827907 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.859168 LuaFunctionCall.cpp:108] [string “line”]:23: c413fd38-8e8ce4c2-7fbc028b-b8417897-78e528ee-compressed.dcm: No such file or directory

E0401 06:19:44.859168 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.896429 LuaFunctionCall.cpp:108] [string “line”]:23: 6374e3de-027ec710-e443f08c-906d139c-f9b16198-compressed.dcm: No such file or directory

E0401 06:19:44.912153 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.927787 LuaFunctionCall.cpp:108] [string “line”]:23: 19dd8d97-95eebdc7-d45553fa-c844d332-20ec03b4-compressed.dcm: No such file or directory

E0401 06:19:44.927787 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:44.959030 LuaFunctionCall.cpp:108] [string “line”]:23: 380c29da-7c90cd3c-d1665a3b-0e906243-fa507c27-compressed.dcm: No such file or directory

E0401 06:19:44.959030 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.012443 LuaFunctionCall.cpp:108] [string “line”]:23: f4d8c171-626e9df4-b78d1d36-6e233454-f36034d6-compressed.dcm: No such file or directory

E0401 06:19:45.012443 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.043692 LuaFunctionCall.cpp:108] [string “line”]:23: 98894da1-bcc8f093-ada5c6c1-0f8fc4f9-b0bb77d6-compressed.dcm: No such file or directory

E0401 06:19:45.043692 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.059327 LuaFunctionCall.cpp:108] [string “line”]:23: d57e5df3-53af0b6c-d0bc6b56-b6a46480-e09b7f52-compressed.dcm: No such file or directory

E0401 06:19:45.074942 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.112717 LuaFunctionCall.cpp:108] [string “line”]:23: c65f44c4-30a47280-f134f66b-ff972ea0-6f8aaffb-compressed.dcm: No such file or directory

E0401 06:19:45.112717 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.143966 LuaFunctionCall.cpp:108] [string “line”]:23: 4e293c89-ef0c99c8-5dc66430-f2eae2a9-827b481e-compressed.dcm: No such file or directory

E0401 06:19:45.143966 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.175228 LuaFunctionCall.cpp:108] [string “line”]:23: a9f8b1d3-5e3f4182-845ccb31-94634151-4c37c782-compressed.dcm: No such file or directory

E0401 06:19:45.175228 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.212536 LuaFunctionCall.cpp:108] [string “line”]:23: 7f31b0ca-775a8840-168946f2-801ff847-fe2a4a6f-compressed.dcm: No such file or directory

E0401 06:19:45.212536 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.243777 LuaFunctionCall.cpp:108] [string “line”]:23: 200285ee-54735752-05c83662-8ab66616-5028d6a6-compressed.dcm: No such file or directory

E0401 06:19:45.243777 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.275029 LuaFunctionCall.cpp:108] [string “line”]:23: f1b321f4-528cb74b-fd854f3f-d5e1c3c2-6be304c6-compressed.dcm: No such file or directory

E0401 06:19:45.275029 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.312953 LuaFunctionCall.cpp:108] [string “line”]:23: ba6c7ebf-41e454aa-3c9819ff-b48055d2-40aa41eb-compressed.dcm: No such file or directory

E0401 06:19:45.328578 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.344202 LuaFunctionCall.cpp:108] [string “line”]:23: aefac7a6-4d197dd1-80e5c3b3-6cfb4bec-17e393bf-compressed.dcm: No such file or directory

E0401 06:19:45.344202 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.375462 LuaFunctionCall.cpp:108] [string “line”]:23: 2cafdbb2-aa23ee42-b8aa0456-1f373858-5e1ffbee-compressed.dcm: No such file or directory

E0401 06:19:45.375462 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.428839 LuaFunctionCall.cpp:108] [string “line”]:23: 226b7d3e-2e6999be-b1ce3458-d2aad011-7c94695a-compressed.dcm: No such file or directory

E0401 06:19:45.428839 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.444465 LuaFunctionCall.cpp:108] [string “line”]:23: a3fb02a8-b71b65a7-823baafe-4785f50d-8474dcbe-compressed.dcm: No such file or directory

E0401 06:19:45.460109 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.475715 LuaFunctionCall.cpp:108] [string “line”]:23: bed05080-a9573663-ab7870d9-ffe221f3-ef47fbfe-compressed.dcm: No such file or directory

E0401 06:19:45.475715 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.529104 LuaFunctionCall.cpp:108] [string “line”]:23: df47ae06-36f1922f-9e52ad6b-a2568d75-468a58d8-compressed.dcm: No such file or directory

E0401 06:19:45.529104 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.560366 LuaFunctionCall.cpp:108] [string “line”]:23: 0e54e9bb-5bec86e3-01f68fb6-161c244b-62ccad92-compressed.dcm: No such file or directory

E0401 06:19:45.560366 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.593608 LuaFunctionCall.cpp:108] [string “line”]:23: 9ccd2fe8-ac92e154-c970b0fb-4811ef2c-1e3b9bde-compressed.dcm: No such file or directory

E0401 06:19:45.596610 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.628877 LuaFunctionCall.cpp:108] [string “line”]:23: a01e8614-c938aa49-020fba7f-3035714d-d61870d9-compressed.dcm: No such file or directory

E0401 06:19:45.628877 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.660126 LuaFunctionCall.cpp:108] [string “line”]:23: 13be6b0c-fb7e17e7-77088d2a-1e19cac5-06e862f2-compressed.dcm: No such file or directory

E0401 06:19:45.660126 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.697885 LuaFunctionCall.cpp:108] [string “line”]:23: 420b6c70-f14c88aa-e43e71ea-8fdcc091-35002fc3-compressed.dcm: No such file or directory

E0401 06:19:45.697885 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

‘gdcmconv’ is not recognized as an internal or external command,

operable program or batch file.

‘dcmodify’ is not recognized as an internal or external command,

operable program or batch file.

E0401 06:19:45.729222 LuaFunctionCall.cpp:108] [string “line”]:23: 54c4b076-e4c13572-99cfc5df-0250cb67-92c8067a-compressed.dcm: No such file or directory

E0401 06:19:45.744846 ServerContext.cpp:304] Error in the Lua callback while receiving an instance: Cannot execute a Lua command (code 2031)

Only if you want to forward the DICOM file somewhere else after the conversion.

Are you running on Linux or Windows? Looks like you will need to install gdcmconv and dcmodify.

I’m on Windows. How would I go about installing gdcmconv and dcmodify ?

I really appreciate all your help

Note. I have never used this so I may be wrong:

Try downloading the windows version here: https://github.com/malaterre/GDCM/releases

After installing, open a command prompt and run: gdcmconv.exe

If that doesn’t work, then you may need to change the scripts to point directly to the executable where you installed it.

HEY !!! Its working…like you said I had to change the scripts to point directly to the executable where I installed it.Just one last thing.During import Its showing the following warnings:

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

W: DcmItem: Length of element (7fe0,0010) is not a multiple of 2 (VR=OW)

Great to hear!

For that warning. Is this a test file you are using? If so you can ignore it. If they are real and happening with all your studies than it would be best to dig deeper

No these are not test files.I have tried different studies from three different modalities from different manufacturers and get the same warning on all studies when importing with the script enabled.There are no warnings while importing the same studies when the script is disabled.

I can probably give it a try and see what I get in a couple of days. Stay tuned!

Looking forward to it.Thanks for everything so far.

Sorry, alot later than what I had planned. Here is my script, working so far. Note that I change certain things with dcmodify, I have commented them out.

function OnStoredInstance(instanceId, tags, metadata, origin)

– Do not compress twice the same file

if origin[‘RequestOrigin’] ~= ‘Lua’ then

– Retrieve the incoming DICOM instance from Orthanc

local dicom = RestApiGet(‘/instances/’ … instanceId … ‘/file’)

– Write the DICOM content to some temporary file

local uncompressed = instanceId … ‘-uncompressed.dcm’

local target = assert(io.open(uncompressed, ‘wb’))

target:write(dicom)

target:close()

– Compress to JPEG2000 using gdcm

local compressed = instanceId … ‘-compressed.dcm’

os.execute('C:\Realtime\Scripts\gdcm\bin\gdcmconv.exe -U --j2k ’ … uncompressed … ’ ’ … compressed)

–If Required, prefix the patient ID. Modify PatientID= and add any prefix identifier you need.

–os.execute(‘C:\Realtime\Scripts\dcmtk\bin\dcmodify.exe --no-backup -i "PatientID=PREFIX’ … tags[‘PatientID’] … '" ’ … compressed). --***** UNCOMMENT AND MODIFY ONLY IF YOU NEED PATIENT ID PREFIX ********

–os.execute('C:\Realtime\Scripts\dcmtk\bin\dcmodify.exe --no-backup -i “Originator=ORIGINATOR” ’ … compressed) –**REPLACE WITH SITE ID**

if origin[‘CalledAet’] == ‘CURRENT’ then –**REPLACE WITH CURRENT STUDY AE TITLE**

– Route to Collector using Current Tag

PrintRecursive(“Current Image Has Arrived. Forwarding”)

– The tags to be replaced for Current Images

–os.execute('C:\Orthanc\Scripts\dcmtk\bin\dcmodify.exe --no-backup -i “RetrieveAETitle=CURRENT” ’ … compressed)

else

– Route everything else as prior

PrintRecursive(“Prior Image Has Arrived. Forwarding”)

– The tags to be replaced for prior images

–os.execute('C:\Orthanc\Scripts\dcmtk\bin\dcmodify.exe --no-backup -i “RetrieveAETitle=PRIOR” ’ … compressed)

end

– Read the JPEG2000 file

local source = assert(io.open(compressed, ‘rb’))

local jpeg2k = source:read(“*all”)

source:close()

– Upload the JPEG2000 file and remove the uncompressed file

RestApiDelete(‘/instances/’ … instanceId)

local jpeg2kInstance = ParseJson(RestApiPost(‘/instances’, jpeg2k))

– Remove the temporary DICOM files

os.remove(uncompressed)

os.remove(compressed)

–print(instanceId)

–PrintRecursive(jpeg2kInstance)

–print(jpeg2kInstance[‘ID’])

– forward to the PACS and delete

SendToPeer(jpeg2kInstance[‘ID’], ‘ORTHANC’)

end

end