Orthanc Web Viewer Overlay Customization

Hello, I want customize the metadata overlay field that appears on the top-right corner of the orthanc web viewer once an image is opened using that plugin. I tried miaking some changes to ‘seriesInformationAdapter.cpp’ as well as the ‘viewer.js’ by simply replacing the currect fields like “PatientID” with “Modality” in both files respectively, but after rebuilding, the PatientID value was not replaced with the Modality, it simply dissapeared from the UI.
I need help understanding how these values work and how best I can go about implementing these changes.
Your help will be highly appreciated.

Hi Andrew,

Disclaimer: I have not tested my changes but this is what I would do:

In seriesInformationAdapter.cpp

    Json::Value result;
    result["ID"] = seriesId;
    // add this line
    result["Modality"] = series["MainDicomTags"]["Modality"].asString();    
   // keep other lines untouched

and in viewer.js:

      if (volume.Slices.length != 0) {
        instances = volume.Slices;
        var topRightElement = $('<span>');
        // next 2 lines changed:
        topRightElement.append($('<span>', { text: volume.Modality}));
        topRightElement.append($('<br/>'));

HTH,

Alain.

Hello Alain,

Thank you for the responce. I have tried making these changes and building the plugin again but i still cannot still the Modality in the top right corner.

I do not know if they could be something that limits the data inside “volume” in the viewer.js. I tried the option of looping through and displaying all the information inside ‘volume’ and still noticed it only prints out tags defined in the followong:

result[“ID”] = seriesId;
result[“SeriesDescription”] = series[“MainDicomTags”][“SeriesDescription”].asString();
result[“StudyDescription”] = study[“StudyDescription”].asString();
result[“PatientID”] = patient[“PatientID”].asString();
result[“PatientName”] = patient[“PatientName”].asString();
result[“Type”] = ordered[“Type”];
result[“Slices”] = ordered[“Slices”];

Which are the fileds initially passed in the seriesInformationAdapter.cpp before any changes are made. I’m slighty confused at this point.

Hi,

The old data is probably still in the WebViewer cache. You should set "CacheSize": 1 (it can not be 0). Delete and reimport the series.

HTH,

Alain

Hello,

Thank you very much. I tried this and it worked.
However, I was wondering if it would be possible to add other tags that appear on the instance level, to that top right coner overlay?
e.g the tags that we get when the curl command below is used:
$ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/simplified-tags

I wanted to find out what the best approach would be if I wanted to display some of these tags ?