Problem when I send a study twice

Hi everyone, I have Orthanc installed and I’m having a problem when I send a study twice.
What’s happening is that if I have a study with 10 images, and I send it again, I get the same study but with 20 images. I don’t know how to solve this. I tried modifying several parameters in the configuration file, but I couldn’t get it to work.
Any ideas or someone who could solve this?

Regards.
Cristian

Hi @cristian2025

Here, I’m assuming that you have not installed any lua or python script in Orthanc that modifies the received data right ?

By default, Orthanc will not duplicate studies/series/instances, provided that they are sent again with the same StudyInstanceUID, SeriesInstanceUID and SOPInstanceUID. So, if you are getting 10 more instances each time you send the study, that’s because the sender modifies SOPInstanceUID before sending them. You may check the DICOM Tags in the Orthanc user interface and compare tags received in the first batch and the second batch.

What is the device/program sending the data ?

Best regards,

Alain.

Hello @alainmazy, good day.
No, I don’t have any plugins installed under Lua or Python. It’s direct, and I use the jodogne/orthanc-plugins version of Docker.
Yes, that’s what’s happening. I tried using Microdicom and also Charrua Worksoft, and both do the same thing. Then I tried using orthanc, and to my surprise, it also does the same thing. I don’t know why; I honestly don’t understand why this happens.
With the two programs mentioned, if I send the studies, it doesn’t duplicate them.
I deployed an application, and while doing other things, I noticed this problem. I’ve been testing for a week now, and I don’t know how to fix it. I’ve tried modifying parameters in one way or another in the configuration JSON, but I haven’t been able to resolve it.
Because my original idea, I thought, was to put orthanc on the PC that will upload the studies, but it does the same thing.
Do you know of any tool I can use to upload the studies that doesn’t do this? What can I do/change in Orthanc?
Best regards,
Cristian

Hi,

We have never seen that problem and Orthanc is deployed in a lot of places…
So there is a misconfiguration somewhere :slight_smile:
Could you share more details about your setup ?
Configuration file, context,…

Regards,

Hi @bcrickboom.
Orthanc.json:
{
“Name”: “IMAGEN”,
“StorageDirectory”: “/var/lib/orthanc/db”,
“IndexDirectory”: “/var/lib/orthanc/db”,
“StorageCompression”: true,
“StorageLossless”: true,
“Transcoder”: “jpeg2000”,
“MaximumStorageSize”: 0,
“MaximumPatientCount”: 0,
“MaximumStorageCacheSize”: 128,
“LuaScripts”: ,
“Plugins”: [
“/usr/share/orthanc/plugins”,
“/usr/local/share/orthanc/plugins”
],
“ConcurrentJobs”: 2,
“HttpServerEnabled”: true,
“OrthancExplorerEnabled”: true,
“HttpPort”: 8042,
“HttpDescribeErrors”: true,
“HttpCompressionEnabled”: true,
“WebDavEnabled”: true,
“WebDavDeleteAllowed”: false,
“WebDavUploadAllowed”: true,
“DicomServerEnabled”: true,
“DicomAet”: “MAPDR”,
“DicomCheckCalledAet”: true,
“DicomPort”: 4242,
“DefaultEncoding”: “Latin1”,
“AcceptedTransferSyntaxes”: [
“1.2.840.10008.1.*”
],
“UnknownSopClassAccepted”: false,
“DicomScpTimeout”: 30,
“RemoteAccessAllowed”: true,
“RemoteLuaScriptsEnabled”: true,
“SslEnabled”: false,
“SslCertificate”: “certificate.pem”,
“SslMinimumProtocolVersion”: 4,
“SslVerifyPeers”: false,
“SslTrustedClientCertificates”: “trustedClientCertificates.pem”,
“AuthenticationEnabled”: false,
“RegisteredUsers”: {
“mapdr”: “changestrongpassword”
},
“DicomTlsEnabled”: false,
“DicomTlsRemoteCertificateRequired”: true,
“DicomAlwaysAllowEcho”: true,
“DicomAlwaysAllowStore”: true,
“DicomModalities”: {
“CWS”: [
“CWS”,
“192.168.10.107”,
104
],
“IMAGEN”: [
“IMAGEN”,
“192.168.1.10”,
4242
]
},
“DicomModalitiesInDatabase”: false,
“OverwriteInstances”: false,
“DicomAlwaysAllowFind”: false,
“DicomAlwaysAllowFindWorklist”: false,
“DicomAlwaysAllowGet”: false,
“DicomAlwaysAllowMove”: false,
“DicomCheckModalityHost”: false,
“DicomEchoChecksFind”: false,
“DicomScuTimeout”: 10,
“DicomScuPreferredTransferSyntax”: “1.2.840.10008.1.2.1”,
“DicomThreadsCount”: 4,
“OrthancPeers”: {},
“OrthancPeersInDatabase”: false,
“HttpProxy”: “”,
“HttpVerbose”: false,
“HttpTimeout”: 60,
“HttpsVerifyPeers”: true,
“HttpsCACertificates”: “/etc/ssl/certs/ca-certificates.crt”,
“UserMetadata”: {
// “Sample” : 1024
},
“UserContentType”: {
// “sample” : 1024
// “sample2” : [ 1025, “application/pdf” ]
},
“StableAge”: 60,
“StrictAetComparison”: false,
“StoreMD5ForAttachments”: true,
“LimitFindResults”: 0,
“LimitFindInstances”: 0,
“LogExportedResources”: false,
“KeepAlive”: true,
“TcpNoDelay”: true,
“HttpThreadsCount”: 50,
“StoreDicom”: true,
“DicomAssociationCloseDelay”: 5,
“QueryRetrieveSize”: 100,
“CaseSensitivePN”: false,
“LoadPrivateDictionary”: true,
“Dictionary”: {},
“SynchronousCMove”: true,
“JobsHistorySize”: 10,
“SaveJobs”: true,
“MediaArchiveSize”: 1,
“StorageAccessOnFind”: “Always”,
“MetricsEnabled”: true,
“ExecuteLuaEnabled”: false,
“HttpRequestTimeout”: 30,
“DefaultPrivateCreator”: “”,
“StorageCommitmentReportsSize”: 100,
“TranscodeDicomProtocol”: true,
“BuiltinDecoderTranscoderOrder”: “After”,
“IngestTranscoding”: “1.2.840.10008.1.2.4.91”,
“IngestTranscodingOfUncompressed”: true,
“IngestTranscodingOfCompressed”: true,
“DicomLossyTranscodingQuality”: 90,
“SyncStorageArea”: true,
“MallocArenaMax”: 5,
“DeidentifyLogs”: true,
“DeidentifyLogsDicomVersion”: “2021b”,
“MaximumPduLength”: 16384,
“CheckRevisions”: false,
“SynchronousZipStream”: true,
“ZipLoaderThreads”: 0,
“Warnings”: {
“W001_TagsBeingReadFromStorage”: true,
“W002_InconsistentDicomTagsInDb”: true
}
}
.
That’s my configuration, and I’ve already tweaked it several times without being able to fix it. Now I’m trying to run a script with Python.
What software do you use to upload images to Orthanc?
Regards

Hi @cristian2025

This is the culprit:

“IngestTranscoding”: “1.2.840.10008.1.2.4.91”,

This is a lossy transfer syntax. As stated in the doc:

// If this option is set, Orthanc will transparently transcode any
// incoming DICOM instance to the given transfer syntax before
// storing it into its database. Beware that this might result in
// high CPU usage (if transcoding to some compressed transfer
// syntax), or in higher disk consumption (if transcoding to an
// uncompressed syntax). Also, beware that transcoding to a transfer
// syntax with lossy compression (notably JPEG) will change the
// "SOPInstanceUID" DICOM tag, and thus the Orthanc identifier at
// the instance level, which might break external workflow.
/**
   "IngestTranscoding" : "1.2.840.10008.1.2",
**/

So, each time you upload the instance, the SOPInstancUID changes:

You should just use a lossless compression like

“IngestTranscoding”: “1.2.840.10008.1.2.4.90”,

This change of SOPInstanceUID is enforced by the DICOM standard and does not depend on Orthanc. In general, we strongly discourage using lossy transfer syntaxes - this is anyway usually not “legal” for human medicine.

Hope this helps,

Alain.

2 Likes

Hi @alainmazy, good day!!

That was the problem specifically. The same thing with the photo you sent.
Actually, I was able to resolve everything by correcting that line.
What I did have to do was delete the studies I already had stored, then resubmit them, and from then on, they weren’t duplicated anymore.
Yesterday I was up until the wee hours trying to create a Python script, but I couldn’t fix the problem.
Thanks for your help.
I was able to resolve the issue, and now I’ll learn more about what you mentioned regarding legal matters.

Thanks again. :waving_hand: :waving_hand: :ok_hand: :ok_hand:
Best regards!!
Cristian G.