Question about sorting C-find or tool/find results. Presuming this is not supported natively within Orthanc

I’m looking at optimizing a Python Plug-in script that does sorting and pagination of tools/find results in python. I based my original script on some of the examples in the Orthanc Book, but it seems somewhat slow with a large dataset, mostly this one:

Sorting & Pagination

There is an example there for MetaData also, but I might be able to replace some of those by using the new Labels feature.

For starters, I was wondering if the API supports sorting itself. It seems not ??

tools/find

and

C-Find

/sds

P.S. I did a little benchmarking with that and it seems that the tools/find call itself is the main bottleneck. All of the other Python code that does the pagination and other processing (i.e. sorting and slicing) seems to take very little time. I suppose it has a bit to do with the MainDicomTags setup and other configurations. Also wondering if there are optimizations or other things to be done if I am using Postgres as a DB ? i.e. config, Docker vs. not. Docker bound folder for Postgres vs. a Docker volume, etc. Seems like it should be possible to speed that up a bit.

Hello,

1- No, /tools/find has no support for pagination/sorting, as can be seen in the API documentation: Orthanc REST API

2- No, the DICOM C-FIND standard does not provide any way to sort/paginate over the DICOM protocol.

3- All I have to say about performance is already written in the Orthanc Book: Scalability of Orthanc — Orthanc Book documentation

Regards,
Sébastien-

1 Like