Limit frame numbers

Hallo Everything,

I am using Orthanc. I fetching a multi frame dicom series using rest api call as following:
http://myorthanc_server/dicom-web/studies/[StudyInstanceUID]/series/[SeriesInstanceUID]

In Orthanc cheat sheet, there is an example to get the frames like:
“/instances/{id}/frames”

My question is:
" when we are fetching the multiframe dicom series from Orthance, can we limit the number frames we want? For example, if a series have 30 frames. Can we limit the view only to 10 to 20 ??
Please feel free to ask if you have any question. Thanks in advance.

Hi,

You can use the dicom-web/studies/{study}/series/{series}/instances/{instance}/frames/{frames} uri to retrieve individual frames one by one.

Thanks for the reply.
But if i have 100 frames in a mutliframe dicom. And I need only to show from 20-
70. I have to call the api so many times. Also, there will be another problem. How to bind them together again as single multiframe dicom.

So, is there any way to to call the api like :

dicom-web/studies/{study}/series/{series}/instances/{instance}/frames/{frames 20 -50}

Or something similar to that ?

No, there’s no such thing in the dicom-web standard.

Note that you can still write a python plugin that would rebuild a DICOM file server side with only the requested frames.
However, note that the Orthanc Rest-API currently does not allow you to create multi-frame files (https://hg.orthanc-server.com/orthanc/file/94616af363ec/TODO#l53) so you would probably have to use pydicom to generate that file.

Another alternative is still to call N times the …/frames/{id} route. That’s how most web-viewers work.

Alain.

Hello,

The DICOMweb standard allows you to retrieve multiple frames as follows:

$ curl https://demo.orthanc-server.com/dicom-web/studies/1.3.6.1.4.1.14519.5.2.1.2193.7172.847236098565581057121195872945/series/1.3.6.1.4.1.14519.5.2.1.2193.7172.329574933994116044160154909094/instances/1.3.6.1.4.1.14519.5.2.1.2193.7172.227588763982019545194084732872/frames/10,11,12

Note the comma-separated list of frames.

HTH,
Sébastien-

Hi Sebastien,
Nice, if it works.
$curl http://myorthanc_server/dicom-web/studies/[studyUID]/series/[seriesUID]/instances/[SOPinstanceUID ?]/frames/10,11,12

My question is after …/instances/ which id to put ?
It is supposed to be SOP instance UID or Orthanc assigned instance id ? I guess the first one ( SOP instance UID )?

Thanks a lot again.

Hi Sebastien,
I tried the curl command as following:

$curl [http://myorthanc_server/dicom-web/studies/[studyUID]/series/[seriesUID]/instances/SOPinstanceUID ]/frames/1,2,3

Unfortunately it does not work. It throws error:
“Invoke-WebRequest : Cannot convert ‘System.Object[]’ to the type ‘System.Uri’ required by parameter ‘Uri’. Specified method is not
supported.”

You must use the “Study Instance UID”, “Series Instance UID” and “SOP Instance UID” tags from DICOM, not the Orthanc identifiers.

This is because you are using the Microsoft Windows PowerShell, not a UNIX-like shell. Check out this section of the Orthanc Book:
https://book.orthanc-server.com/users/rest.html?highlight=powershell#warning-about-using-curl-from-the-windows-prompt

Sébastien-

Hey Sebastien,
You are correct :slight_smile:
I was using windows Power shell. The command worked in a GitBash and in Ubunutu .
Thanks a lot :slight_smile:
Note for others:
_________ Issue resolved. See The answer of Sebastien.___________