Implement support for modifying DICOM tags for patients, sequences, and scans
Orthanc exposes the ability to update DICOM values for scans, sequences, and instances. This capability should be exposed as a method on the scan, series, and patient objects of the client library.
The general structure of the request is the same for each type of resource. Example:
$ curl -X POST http://localhost:8042/instances/6e67da51-d119d6ae-c5667437-87b9a8a5-0f07c49f/modify \
--data '{
"Replace": {
"PatientName":"hello",
"PatientID":"world"
},
"Remove":[
"InstitutionName"
],
"RemovePrivateTags": true,
"Force": true,
"Transcode": "1.2.840.10008.1.2.4.70"
}' > Modified.dcm
Example taken from Orthanc REST documentation. Comments on request structure (also taken from Orthanc REST documentation).
Remarks:
- The
Remove
array specifies the list of the tags to remove. - The
Replace
associative array specifies the substitions to be applied (cf. anonymization). - If
RemovePrivateTags
is set to true, the private tags (i.e. manufacturer-specific tags) are removed. - The
Transcode
option allows you to define theTransferSyntax
of the modified file. - The
Force
option must be set to true, in order to allow the modification of thePatientID
, as such a modification of the DICOM identifiers might lead to breaking the DICOM model of the real-world. In general, any explicit modification to one of thePatientID
,StudyInstanceUID
,SeriesInstanceUID
, andSOPInstanceUID
requires Force to be set to true, in order to prevent any unwanted side effect. - To replace a sequence of tags, you may use this syntax:
{ "Replace" : { "ProcedureCodeSequence" : [ { "CodeValue" : "2", "CodingSchemeDesignator" : "1", "CodeMeaning": "1" } ] } }