# HG changeset patch # User Sebastien Jodogne # Date 1762439902 -3600 # Node ID 6d73737301c37aeb1435f5df068c74292a792ee3 # Parent 08a279251a4e18067473397c2c5ffe2bf70e4801 transmitting image title to wsi viewer diff -r 08a279251a4e -r 6d73737301c3 Sources/OrthancDatabase.cpp --- a/Sources/OrthancDatabase.cpp Wed Oct 22 18:49:04 2025 +0200 +++ b/Sources/OrthancDatabase.cpp Thu Nov 06 15:38:22 2025 +0100 @@ -435,11 +435,27 @@ } +static std::string FormatWSITitle(const std::string& title) +{ + if (title.empty()) + { + return ""; + } + else + { + std::string tmp; + Orthanc::Toolbox::UriEncode(tmp, title); + return "&description=" + tmp; + } +} + + namespace OrthancDatabase { std::string GenerateStudyViewerUrl(ViewerType viewer, const std::string& studyId, - const std::string& studyInstanceUid) + const std::string& studyInstanceUid, + const std::string& title) { switch (viewer) { @@ -470,7 +486,8 @@ std::string GenerateSeriesViewerUrl(ViewerType viewer, const std::string& seriesId, const std::string& studyInstanceUid, - const std::string& seriesInstanceUid) + const std::string& seriesInstanceUid, + const std::string& title) { switch (viewer) { @@ -478,7 +495,7 @@ return "stone-webviewer/index.html?study=" + studyInstanceUid + "&series=" + seriesInstanceUid; case ViewerType_WholeSlideImaging: - return "wsi/app/viewer.html?series=" + seriesId; + return "wsi/app/viewer.html?series=" + seriesId + FormatWSITitle(title); case ViewerType_VolView: return "volview/index.html?names=[archive.zip]&urls=[../series/" + seriesId + "/archive]"; @@ -493,12 +510,13 @@ const std::string& instanceId, const std::string& studyInstanceUid, const std::string& seriesInstanceUid, - const std::string& sopInstanceUid) + const std::string& sopInstanceUid, + const std::string& title) { switch (viewer) { case ViewerType_WholeSlideImaging: - return "wsi/app/viewer.html?instance=" + instanceId; + return "wsi/app/viewer.html?instance=" + instanceId + FormatWSITitle(title); default: throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); @@ -517,20 +535,23 @@ case Orthanc::ResourceType_Study: return GenerateStudyViewerUrl(viewer, HttpToolbox::ReadMandatoryString(resource, "resource-id"), - HttpToolbox::ReadMandatoryString(resource, "study-instance-uid")); + HttpToolbox::ReadMandatoryString(resource, "study-instance-uid"), + HttpToolbox::ReadMandatoryString(resource, "title")); case Orthanc::ResourceType_Series: return GenerateSeriesViewerUrl(viewer, HttpToolbox::ReadMandatoryString(resource, "resource-id"), HttpToolbox::ReadMandatoryString(resource, "study-instance-uid"), - HttpToolbox::ReadMandatoryString(resource, "series-instance-uid")); + HttpToolbox::ReadMandatoryString(resource, "series-instance-uid"), + HttpToolbox::ReadMandatoryString(resource, "title")); case Orthanc::ResourceType_Instance: return GenerateInstanceViewerUrl(viewer, HttpToolbox::ReadMandatoryString(resource, "resource-id"), HttpToolbox::ReadMandatoryString(resource, "study-instance-uid"), HttpToolbox::ReadMandatoryString(resource, "series-instance-uid"), - HttpToolbox::ReadMandatoryString(resource, "sop-instance-uid")); + HttpToolbox::ReadMandatoryString(resource, "sop-instance-uid"), + HttpToolbox::ReadMandatoryString(resource, "title")); default: throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); diff -r 08a279251a4e -r 6d73737301c3 Sources/OrthancDatabase.h --- a/Sources/OrthancDatabase.h Wed Oct 22 18:49:04 2025 +0200 +++ b/Sources/OrthancDatabase.h Thu Nov 06 15:38:22 2025 +0100 @@ -54,18 +54,21 @@ std::string GenerateStudyViewerUrl(ViewerType viewer, const std::string& studyId, - const std::string& studyInstanceUid); + const std::string& studyInstanceUid, + const std::string& description); std::string GenerateSeriesViewerUrl(ViewerType viewer, const std::string& seriesId, const std::string& studyInstanceUid, - const std::string& seriesInstanceUid); + const std::string& seriesInstanceUid, + const std::string& description); std::string GenerateInstanceViewerUrl(ViewerType viewer, const std::string& instanceId, const std::string& studyInstanceUid, const std::string& seriesInstanceUid, - const std::string& sopInstanceUid); + const std::string& sopInstanceUid, + const std::string& description); std::string GenerateViewerUrl(ViewerType viewer, const std::map& resource);