Stone Viewer Feature(s) request.

  1. Show Series number & image count in Blue Badge for ThumbNail. See the image below. Currently it just displays the image count.


Seems like not a huge change. My code may be slightly different, but in the viewer front-end:

**#{{ series[seriesIndex].tags[SERIES_NUMBER] }} -** {{ series[seriesIndex].numberOfFrames }}

and in app.css around 2400:

.wvSerieslist__badge–blue {
background-color: rgba(51, 152, 219, 0.7);
width: max-content;
border-radius: 5px;
padding: 1px 5px;
line-height: 12px; }

  1. Display thumbnails sorted by SeriesNumber. Currently they appear to be sorted by “seriesIndex”, so maybe there is a way to do that in the frontend actually by sorting on the “SeriesNumber” tag in javascript ?

Kind of a follow-up to the previous comment.

I noticed that when there are presentation state instances stored on Orthanc for a study, in the Stone Viewer they get displayed as thumbnails with the class:

class=“fa fa-eye-slash”, which is appropriate in some sense in that there is no pixeldata to display, but a bit confusing because it isn’t a viewable series either.

I guess Presentation State support is on the roadmap for the Stone Viewer:

In the meantime, this seems to work for excluding the “PR”'s from the thumbnail list:

<li v-if="series[seriesIndex].tags[MODALITY] != 'PR'" class="wvSerieslist__seriesItem"

Not sure if I should start a separate thread or just supplement my previous comment. I have run into a couple of issues related to having series with the Modality Type of “PR” when using the stone viewer. The first issue is mentioned in the previous comment, and my temporary fix when hosting the front-end is mentioned below, namely to exclude the “PR” modality type from the iteration for the thumbnail view generation. A related issue is this. When I load the viewer, I am seeing a number of errors in the console:

The 400 errors are related to the series that have a modality type of “PR”

XHR GET,128 [HTTP/1.1 400 Bad Request 39ms]

XHRGET,128 [HTTP/1.1 400 Bad Request 39ms]

The behavior is the same regardless of whether I am using the hosted frontend for Stone Viewer or the Built-In Stone viewer Plug-in.

An example image of the eye-slash issue is attached as screen capture.

PR is on the roadmap, but would kind of like to know how to eliminate the AJAX requests for the PR series that are causing the console errors. Looks like it is trying to get a thumbnail for series that does not have a thumbnail defined.


Same / similar issue for studies with series that have a “SR” type for the modality (Structured Report). The eye-slash is shown for the thumbnail preview and there is a 400 error in the console for the AJAX request for that series, probably because there is no pixel data for that type of instance and there is no pixel data for the PR type either.


Status 400

Standard Breast Imaging Report
Status: Unknown

Modality: SR
StationName: NONE
SeriesNumber: 1

Hi Stephen,

Thanks for sharing all of these suggestions.

I just wanted to tell you that although we’ve not replied to you, we are not ignoring them.

I hope I’ll have some time to look at the StoneViewer in the next 2 weeks and will have a deeper look at your proposals at that time.

Best regards,


Hi Stephen,

I have implemented some of your suggestions/fixes:

  • SeriesList:
  • display the SeriesNumber tag in front of image count.
  • order series by SeriesNumber
  • don’t show non displayable series (see “SkipSeriesFromModalities”)
  • New configuration options:
  • “SkipSeriesFromModalities” to ignore series from given modality types.

full change logs:

I’ll hopefully look at the “key image creation” a bit later.

Best regards,


Alain, thanks.

The little thing I wrote for Key Images “works” in a dev setup, but there is apparently an “official” way to implement that in DICOM, although I think a lot of vendors have their own implementation. I might dig into that a little deeper.

Key Images - DICOM

Do the .wasm’s get updated also:

I haven’t been building those, but I might learn how to do that from source.


Follow up to my note about “Key Images”. The “official” way I think used structured reports or HL7 / links to the key images. The little procedure I had where I sort of hijacked the download JPEG actually caused an issue with creating a DICOMDIR archive because the SOPInstanceUID and InstanceNumbers were not specified. This seems to fix that problem. If it were possible to add an arrow and text to the annotations and somehow capture the MR sequence or series name to the key image, would be relatively nice:

def MakeKeyImage(output, uri, **request):

pass in StudyInstanceUID, data_url, ImageComment

if request[‘method’] != ‘POST’:
response = dict();
query = json.loads(request[‘body’])
study = json.loads(orthanc.RestApiPost(‘/tools/lookup’, query[‘StudyInstanceUID’]))[0] # assume a unique StudyInstancUID on server
series = json.loads(orthanc.RestApiGet(‘/studies/’ + study[“ID”] + ‘/series’))
keyimagesID = False
instancenumber = 1
for seriesitem in series:
if ‘SeriesDescription’ in seriesitem[‘MainDicomTags’] and seriesitem[‘MainDicomTags’][‘SeriesDescription’] == ‘KEY_IMAGES’:
keyimagesID = seriesitem[‘ID’]
instancenumber = len(seriesitem[‘Instances’]) + 1
dicomdata = dict()

1.2.840.10008. is SOPClassUID for Secondary Capture Image Storage

if keyimagesID:
parent = keyimagesID
dicomdata[‘Tags’] = {“ImageComments”:query[‘ImageComments’],“SOPClassUID”:“1.2.840.10008.”,“InstanceNumber”: str(instancenumber)}
parent = study[“ID”]
dicomdata[‘Tags’] = {“Modality”:“OT”,“SeriesDescription”: “KEY_IMAGES”,“SequenceName” : “KEY_IMAGES”,“ImageComments”:query[‘ImageComments’],“SeriesNumber”:“0”,“SOPClassUID”:“1.2.840.10008.”,“InstanceNumber”: str(instancenumber)}
dicomdata[‘Parent’] = parent
dicomdata[‘Content’] = query[‘data_url’]
dicom = json.loads(orthanc.RestApiPost(‘/tools/create-dicom’, json.dumps(dicomdata)))
response[‘keyimagesID’] = keyimagesID
response[‘status’] = study
response[‘create-dicom’] = dicom
output.AnswerBuffer(json.dumps(response), ‘application/json’)

orthanc.RegisterRestCallback(‘/make_key_image’, MakeKeyImage)