'Patient position' value changes after Q/R

Hello to everyone,
I'm a new Orthanc user.

I'm writing because I've noticed that patient position changes when I query/retrieve a study from the PACS.

Has this already happened to someone else? Do you have hints?

Hello,

Orthanc never modifies by itself the content of DICOM tags of the files it receives.

I suspect your problem is on the side of your sender.

If not, please provide a sample file so that we can further analyze the issue.

Regards,
Sébastien-

Hello Sebastien,

you’re right, I’ve just discovered that what Orthanc reads is what actually is in the PACS. But now I’ve another question…
Is it possible, during Q/R from the PACS, to automatically copy the slice location (0020-1104) inside patient position (0020-0032, third value)?

Regards,
Simone

Yes, you need to do a lua script that store that tag as you whant, there is examples of lua scripts modifing DICOM tags on the repository

Yes, I understand that and I’ve already found the script to do it. What I’m asking is: how can I reference the third value of Patient Position Tag? Is it like a vector?
Sorry but this is the first time I try to edit DICOM fields…

Should the example script work in a C-Move operation?
Or the study needs to be firstly stored in Orthanc, edited with the script and only at this point it can be sent to Orthanc?

Hello,

Yes, I understand that and I’ve already found the script to do it. What I’m asking is: how can I reference the third value of Patient Position Tag? Is it like a vector?
Sorry but this is the first time I try to edit DICOM fields…

You could retrieve the third value of the “ImagePositionPatient” tag as follows:

function OnStoredInstance(instanceId, tags, metadata)
local position = tags[‘ImagePositionPatient’]
local x, y, z = string.match(position, ‘([^\])\([^\])\([^\]*)’)
print(z)
end

Should the example script work in a C-Move operation?
Or the study needs to be firstly stored in Orthanc, edited with the script and only at this point it can be sent to Orthanc?

The script above would be applied to any incoming instance (either received by DICOM C-Store, DICOM C-Move, or REST). You can modify these incoming instance as illustrated in the following sample:

https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Lua/ModifyInstanceWithSequence.lua

HTH,

Sébastien-