Problem when Delete Dicom Images from Storage...


When i call a resquest for delete one or more studies to Orthanc, he delete this studies from dataBase but, do not delete them on Storage?

Is needed some special configuragtion on json files, or i make something wrong?

I use: (C#)

var request = new RestRequest(“studies/” + studyID, Method.DELETE);
clientrest.ExecuteAsync(request, removeCallBack);

This work only for DataBase…do not delete from Storage. (I’m use a Docker with Postgres and Orthanc…)

Thanks for help me, if you need more information, please ask me.

That’s the correct API call to delete a study and it will always delete it both from DB and from Storage (there’s no configuration involved)

Hi Alain,

Thank you so much for your answer.

I questioned the fact that there may be some extra configuration because, this has been working correctly before, but now it only deletes the data from the Database, that is, when we consult with Orthanc.

Is the delete method Async? Is it possible for Orthanc to schedule the removal of files from storage, and not to delete the files at the same time that the study is deleted?

Thank you very much for your attention and availability.

A sexta-feira, 25 de setembro de 2020 à(s) 11:39:27 UTC+1, escreveu:

No, deletion is synchronous.

What do you observe exactly ?

Hi Alain,

I place the normal REST request:
new RestRequest (“studies /” + studyIDRemove, Method.DELETE);

Result: Eliminates the study of the Database at the moment, but continues in storage.

But I am sure it has worked at some point.

I have already checked the entire process and am unable to find the problem.

My configuration files are attached.

A sexta-feira, 25 de setembro de 2020 à(s) 13:50:41 UTC+1, escreveu:

storage.json (585 Bytes)

dicom.json (261 Bytes)

plugins.json (46 Bytes)

postgresql.json (227 Bytes)

remote-access.json (99 Bytes)

http.json (266 Bytes)

your dicom files are stored in postgresql:


What you see in the ‘storage’ is probably old files that are not used anymore (and will never be deleted since they are not referenced in the DB.

The SQL plugin, EnableIndex and EnableStorage are configurations you can change only before storing any data. If you change it while you’ve already stored data, you’ll end up with inconsistent data.

Hi ,

I am asking to delete a list of studies, for example 200 studies with a foreach and make 200 REST requests.

Is there a way to eliminate the studies obtained by a given Job?

Thank you so much again!

A sexta-feira, 25 de setembro de 2020 à(s) 15:05:43 UTC+1, escreveu:

Are you saying that I need to change the value of “enableStorage”?

I’m only define “EnableStorage”(i think “EnableIndex” follow the same path…), Is the “EnableIndex” path nedded?

In reality, I just need Orthanc to keep the study data in the database for me, then he can delete the files from storage because I don’t need them …

A sexta-feira, 25 de setembro de 2020 à(s) 15:08:06 UTC+1, André Sousa escreveu:

Your configuration file shows that Orthanc uses PostgreSQL both for the database and the attachments (Dicom instances)

If you want to only use PostgrelSQL for the database, set EnableIndex to true and EnableStorage to false. In that case, they will be stored in the filesystem, at the location specified by the StorageDirectory configuration option.

I am not aware of a way to totally disable storage and only use the database. You might try using /dev/null for StorageDirectory, even though that will obviously cause issues when you try to access the instances afterwards (i.e. for reading their non-indexed Dicom tags),