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.

stone_requests.png

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: https://hg.orthanc-server.com/orthanc-stone/file/default/TODO

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

https://hg.orthanc-server.com/orthanc-stone/file/default/TODO:

<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 GEThttps://portal.medical.ky/pacs-2/dicom-web//studies/1.3.76.2.1.1.4.1.2.5388.681822806/series/1.3.76.2.1.1.4.1.3.5388.681826246/rendered?viewport=128,128 [HTTP/1.1 400 Bad Request 39ms]

XHRGEThttps://portal.medical.ky/pacs-2/dicom-web//studies/1.3.76.2.1.1.4.1.2.5388.681822806/series/1.3.76.2.1.1.4.1.3.5388.681826282/rendered?viewport=128,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.

eyslash.png

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.

GET
http://localhost:8042/dicom-web/studies/1.3.6.1.4.1.14519.5.2.1.4792.2001.197465940191351169846602444317/series/1.3.6.1.4.1.5962.1.1.0.0.1548529146.50549.1/rendered?viewport=128,128

Status 400

Standard Breast Imaging Report
Status: Unknown

Modality: SR
StationName: NONE
SeriesInstanceUID: 1.3.6.1.4.1.5962.1.1.0.0.1548529146.50549.1
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,

Alain.

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: https://hg.orthanc-server.com/orthanc-stone/

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

Best regards,

Alain.

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: https://lsb.orthanc-server.com/stone-webviewer/2.0/

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

/sds

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’:
output.SendMethodNotAllowed(‘POST’)
else:
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
print(keyimagesID)
dicomdata = dict()

1.2.840.10008.5.1.4.1.1.7 is SOPClassUID for Secondary Capture Image Storage

if keyimagesID:
parent = keyimagesID
dicomdata[‘Tags’] = {“ImageComments”:query[‘ImageComments’],“SOPClassUID”:“1.2.840.10008.5.1.4.1.1.7”,“InstanceNumber”: str(instancenumber)}
else:
parent = study[“ID”]
dicomdata[‘Tags’] = {“Modality”:“OT”,“SeriesDescription”: “KEY_IMAGES”,“SequenceName” : “KEY_IMAGES”,“ImageComments”:query[‘ImageComments’],“SeriesNumber”:“0”,“SOPClassUID”:“1.2.840.10008.5.1.4.1.1.7”,“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)