# HG changeset patch # User Sebastien Jodogne # Date 1785408637 -7200 # Node ID 6ac5d5c49a26bf28c5852806d27dcaa487ec053d # Parent 0c20ad09e34b60c5c1075303d89449bfb8621c6d simplification diff -r 0c20ad09e34b -r 6ac5d5c49a26 Sources/EducationToolbox.cpp --- a/Sources/EducationToolbox.cpp Thu Jul 30 12:37:40 2026 +0200 +++ b/Sources/EducationToolbox.cpp Thu Jul 30 12:50:37 2026 +0200 @@ -52,80 +52,80 @@ } -namespace EducationToolbox +static std::string GenerateStudyViewerUrl(ViewerType viewer, + const std::string& studyId, + const std::string& studyInstanceUid, + const std::string& title) { - std::string GenerateStudyViewerUrl(ViewerType viewer, - const std::string& studyId, - const std::string& studyInstanceUid, - const std::string& title) + switch (viewer) { - switch (viewer) - { - case ViewerType_StoneWebViewer: - return "stone-webviewer/index.html?study=" + studyInstanceUid; + case ViewerType_StoneWebViewer: + return "stone-webviewer/index.html?study=" + studyInstanceUid; - case ViewerType_VolView: - return "volview/index.html?names=[archive.zip]&urls=[../studies/" + studyId + "/archive]"; + case ViewerType_VolView: + return "volview/index.html?names=[archive.zip]&urls=[../studies/" + studyId + "/archive]"; - case ViewerType_OHIF_Basic: - return "ohif/viewer?StudyInstanceUIDs=" + studyInstanceUid; + case ViewerType_OHIF_Basic: + return "ohif/viewer?StudyInstanceUIDs=" + studyInstanceUid; - case ViewerType_OHIF_VolumeRendering: - return "ohif/viewer?hangingprotocolId=mprAnd3DVolumeViewport&StudyInstanceUIDs=" + studyInstanceUid; + case ViewerType_OHIF_VolumeRendering: + return "ohif/viewer?hangingprotocolId=mprAnd3DVolumeViewport&StudyInstanceUIDs=" + studyInstanceUid; - case ViewerType_OHIF_TumorVolume: - return "ohif/tmtv?StudyInstanceUIDs=" + studyInstanceUid; + case ViewerType_OHIF_TumorVolume: + return "ohif/tmtv?StudyInstanceUIDs=" + studyInstanceUid; - case ViewerType_OHIF_Segmentation: - return "ohif/segmentation?StudyInstanceUIDs=" + studyInstanceUid; + case ViewerType_OHIF_Segmentation: + return "ohif/segmentation?StudyInstanceUIDs=" + studyInstanceUid; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); - } + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } +} - std::string GenerateSeriesViewerUrl(ViewerType viewer, - const std::string& seriesId, - const std::string& studyInstanceUid, - const std::string& seriesInstanceUid, - const std::string& title) +static std::string GenerateSeriesViewerUrl(ViewerType viewer, + const std::string& seriesId, + const std::string& studyInstanceUid, + const std::string& seriesInstanceUid, + const std::string& title) +{ + switch (viewer) { - switch (viewer) - { - case ViewerType_StoneWebViewer: - return "stone-webviewer/index.html?study=" + studyInstanceUid + "&series=" + seriesInstanceUid; + case ViewerType_StoneWebViewer: + return "stone-webviewer/index.html?study=" + studyInstanceUid + "&series=" + seriesInstanceUid; - case ViewerType_WholeSlideImaging: - return "wsi/app/viewer.html?series=" + seriesId + FormatWSITitle(title); + case ViewerType_WholeSlideImaging: + return "wsi/app/viewer.html?series=" + seriesId + FormatWSITitle(title); - case ViewerType_VolView: - return "volview/index.html?names=[archive.zip]&urls=[../series/" + seriesId + "/archive]"; + case ViewerType_VolView: + return "volview/index.html?names=[archive.zip]&urls=[../series/" + seriesId + "/archive]"; - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); - } + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } +} - std::string GenerateInstanceViewerUrl(ViewerType viewer, - const std::string& instanceId, - const std::string& studyInstanceUid, - const std::string& seriesInstanceUid, - const std::string& sopInstanceUid, - const std::string& title) +static std::string GenerateInstanceViewerUrl(ViewerType viewer, + const std::string& instanceId, + const std::string& studyInstanceUid, + const std::string& seriesInstanceUid, + const std::string& sopInstanceUid, + const std::string& title) +{ + switch (viewer) { - switch (viewer) - { - case ViewerType_WholeSlideImaging: - return "wsi/app/viewer.html?instance=" + instanceId + FormatWSITitle(title); + case ViewerType_WholeSlideImaging: + return "wsi/app/viewer.html?instance=" + instanceId + FormatWSITitle(title); - default: - throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); - } + default: + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } +} +namespace EducationToolbox +{ std::string GenerateViewerUrl(ViewerType viewer, const std::map& resource) { diff -r 0c20ad09e34b -r 6ac5d5c49a26 Sources/EducationToolbox.h --- a/Sources/EducationToolbox.h Thu Jul 30 12:37:40 2026 +0200 +++ b/Sources/EducationToolbox.h Thu Jul 30 12:50:37 2026 +0200 @@ -29,24 +29,6 @@ namespace EducationToolbox { - std::string GenerateStudyViewerUrl(ViewerType viewer, - const std::string& studyId, - 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& 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& description); - std::string GenerateViewerUrl(ViewerType viewer, const std::map& resource);