# HG changeset patch # User Sebastien Jodogne # Date 1667398496 -3600 # Node ID 963f28eb40cb92231b7068c8ca61c037362add91 # Parent 2034ae383cfda04c4ccbec490a93aea42a419487# Parent 1bb0a97168762d2c77308ce45439beab0cf8f3a1 integration default->deep-learning diff -r 2034ae383cfd -r 963f28eb40cb Applications/Resources/RunCppCheck.sh --- a/Applications/Resources/RunCppCheck.sh Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/Resources/RunCppCheck.sh Wed Nov 02 15:14:56 2022 +0100 @@ -29,13 +29,14 @@ fi cat < /tmp/cppcheck-suppressions.txt +constParameter:../../RenderingPlugin/Sources/Plugin.cpp:778 stlFindInsert:../../Applications/Samples/WebAssembly/SingleFrameViewer/SingleFrameViewerApplication.h -stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:508 -stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:1151 +stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:1166 +stlFindInsert:../../Applications/StoneWebViewer/WebAssembly/StoneWebViewer.cpp:523 unpreciseMathCall:../../OrthancStone/Sources/Scene2D/Internals/CairoFloatTextureRenderer.cpp unpreciseMathCall:../../OrthancStone/Sources/Scene2D/LookupTableTextureSceneLayer.cpp -unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:143 -unreadVariable:../../OrthancStone/Sources/Viewport/SdlViewport.cpp:197 +unreadVariable:../../OrthancStone/Sources/Platforms/Sdl/SdlViewport.cpp:159 +unreadVariable:../../OrthancStone/Sources/Platforms/Sdl/SdlViewport.cpp:213 unusedFunction EOF diff -r 2034ae383cfd -r 963f28eb40cb Applications/Samples/Common/RtViewerApp.cpp --- a/Applications/Samples/Common/RtViewerApp.cpp Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/Samples/Common/RtViewerApp.cpp Wed Nov 02 15:14:56 2022 +0100 @@ -99,7 +99,12 @@ { if (activeTracker_) { - activeTracker_->Cancel(); + // Creating "dummyScene" is a HACK: It won't work with trackers + // that probe the values of the textures. For such trackers, the + // actual underlying scene should be provided. + Scene2D dummyScene; + activeTracker_->Cancel(dummyScene); + activeTracker_.reset(); } } diff -r 2034ae383cfd -r 963f28eb40cb Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp --- a/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewer.cpp Wed Nov 02 15:14:56 2022 +0100 @@ -80,8 +80,11 @@ << " a\tCreate angle annotations" << std::endl << " c\tCreate circle annotations" << std::endl << " d\tDelete mode for annotations" << std::endl - << " e\tEdit mode, don't create annotation (default)" << std::endl - << " l\tCreate line annotations" << std::endl + << " e\tCreate ellipse probe" << std::endl + << " l\tCreate length annotations" << std::endl + << " m\tModification/edit mode, don't create annotation (default)" << std::endl + << " p\tCreate pixel probe" << std::endl + << " r\tCreate rectangle probe" << std::endl #else << " a\tEnable/disable the angle annotation tool" << std::endl << " l\tEnable/disable the line annotation tool" << std::endl @@ -194,6 +197,7 @@ #if SAMPLE_USE_ANNOTATIONS_LAYER == 1 OrthancStone::AnnotationsSceneLayer annotations(10); annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); + annotations.SetProbedLayer(0); #else ActiveTool activeTool = ActiveTool_None; @@ -300,7 +304,7 @@ #endif #if SAMPLE_USE_ANNOTATIONS_LAYER == 1 - case SDLK_e: + case SDLK_m: annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Edit); break; #endif @@ -313,7 +317,7 @@ case SDLK_l: #if SAMPLE_USE_ANNOTATIONS_LAYER == 1 - annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Segment); + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_Length); #else if (activeTool == ActiveTool_Line) { @@ -380,6 +384,24 @@ #endif break; +#if SAMPLE_USE_ANNOTATIONS_LAYER == 1 + case SDLK_p: + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_PixelProbe); + break; +#endif + +#if SAMPLE_USE_ANNOTATIONS_LAYER == 1 + case SDLK_e: + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_EllipseProbe); + break; +#endif + +#if SAMPLE_USE_ANNOTATIONS_LAYER == 1 + case SDLK_r: + annotations.SetActiveTool(OrthancStone::AnnotationsSceneLayer::Tool_RectangleProbe); + break; +#endif + default: break; } diff -r 2034ae383cfd -r 963f28eb40cb Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h --- a/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/Samples/Sdl/SingleFrameViewer/SdlSimpleViewerApplication.h Wed Nov 02 15:14:56 2022 +0100 @@ -130,7 +130,8 @@ std::unique_ptr layer( message.GetInstanceParameters().CreateTexture(message.GetImage())); - layer->SetLinearInterpolation(true); + //layer->SetLinearInterpolation(true); + layer->SetLinearInterpolation(false); { std::unique_ptr lock(viewport_->Lock()); diff -r 2034ae383cfd -r 963f28eb40cb Applications/StoneWebViewer/NEWS --- a/Applications/StoneWebViewer/NEWS Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/StoneWebViewer/NEWS Wed Nov 02 15:14:56 2022 +0100 @@ -1,15 +1,32 @@ Pending changes in the mainline =============================== +* New types of annotations: + - Text annotation + - Pixel probe + - Rectangle probe + - Ellipse probe +* Added left/right rotation buttons +* Added magnifying glass +* Added vertical slider showing position of the current frame inside the series * Display of orientation markers +* The text field with the instance number is editable to go to a specific instance +* Linear interpolation of images can be turned off in the user preferences * New configuration options: - "ShowInfoPanelAtStartup" to control the info panel at startup - "ShowUserPreferencesButton" to show the button for setting preferences - "ShowNotForDiagnosticUsageDisclaimer" to show disclaimer about diagnostic usage - "DicomWebHttpHeaders" to set HTTP headers in DICOMweb requests + +Maintenance +----------- + +* Fix issues with drag-and-drop +* Fix handling of "token": The authorization header was not set in QIDO-RS requests +* Start at the first frame for series presumably not containing 3D images (e.g. US) * More tolerance wrt. bad values of the Pixel Spacing (0028,0030) tag * Support of DICOM images without the Study Date (0008,0020) tag -* Fix handling of "token": The authorization header was not set in QIDO-RS requests +* Upgraded Vue.js to 2.6.14 Version 2.3 (2022-03-24) diff -r 2034ae383cfd -r 963f28eb40cb Applications/StoneWebViewer/WebApplication/app-fixes.css --- a/Applications/StoneWebViewer/WebApplication/app-fixes.css Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/StoneWebViewer/WebApplication/app-fixes.css Wed Nov 02 15:14:56 2022 +0100 @@ -43,3 +43,31 @@ border-radius: 5px; padding: 7px; } + + +.wvVerticalScrollbar { + position: absolute; + top: 0; + bottom: 0; + right: 0; + width: 10px; + background-color: #1b663e; +} + +.wvInfoRightMargin { + right: 10px !important; /* must match the "width" of "wvVerticalScrollbar" */ +} + +.wvVerticalScrollbarHighlight { + position: absolute; + left: 0; + right: 0; + height: 5%; + background-color: #00ff00; +} + +.wvInputInstanceNumber { + width: 6ch; /* width of 6 characters */ + border: 2px solid rgba(255, 202, 128, 0.24); + background-color: transparent; +} diff -r 2034ae383cfd -r 963f28eb40cb Applications/StoneWebViewer/WebApplication/app.js --- a/Applications/StoneWebViewer/WebApplication/app.js Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/StoneWebViewer/WebApplication/app.js Wed Nov 02 15:14:56 2022 +0100 @@ -42,10 +42,15 @@ var MOUSE_TOOL_ZOOM = 2; var MOUSE_TOOL_PAN = 3; var MOUSE_TOOL_CROSSHAIR = 4; -var MOUSE_TOOL_CREATE_SEGMENT = 5; +var MOUSE_TOOL_CREATE_LENGTH = 5; var MOUSE_TOOL_CREATE_ANGLE = 6; var MOUSE_TOOL_CREATE_CIRCLE = 7; var MOUSE_TOOL_REMOVE_MEASURE = 8; +var MOUSE_TOOL_CREATE_PIXEL_PROBE = 9; // New in 2.4 +var MOUSE_TOOL_CREATE_ELLIPSE_PROBE = 10; // New in 2.4 +var MOUSE_TOOL_CREATE_RECTANGLE_PROBE = 11; // New in 2.4 +var MOUSE_TOOL_CREATE_TEXT_ANNOTATION = 12; // New in 2.4 +var MOUSE_TOOL_MAGNIFYING_GLASS = 13; // New in 2.4 function getParameterFromUrl(key) { @@ -109,6 +114,9 @@ else if (config == "Crosshair") { return stone.WebViewerAction.CROSSHAIR; } + else if (config == "MagnifyingGlass") { + return stone.WebViewerAction.MAGNIFYING_GLASS; + } else { alert('Unsupported mouse action in the configuration file: ' + config); return stone.WebViewerAction.PAN; @@ -141,6 +149,7 @@ stone: stone, // To access global object "stone" from "index.html" status: 'waiting', currentFrame: 0, + currentFrameFromUser: 0, numberOfFrames: 0, quality: '', cineControls: false, @@ -158,12 +167,24 @@ }, watch: { currentFrame: function(newVal, oldVal) { - /** - * The "FrameUpdated" event has been received, which indicates - * that the schedule frame has been displayed: The cine loop can - * proceed to the next frame (check out "CineCallback()"). - **/ - this.cineLoadingFrame = false; + this.currentFrameFromUser = newVal + 1; + if (this.cineLoadingFrame) { + /** + * The "FrameUpdated" event has been received, which indicates + * that the schedule frame has been displayed: The cine loop can + * proceed to the next frame (check out "CineCallback()"). + **/ + this.cineLoadingFrame = false; + } else { + stone.SetFrame(this.canvasId, newVal); + } + }, + currentFrameFromUser: function(newVal, oldVal) { + if (parseInt(newVal, 10) !== NaN && + newVal >= 1 && + newVal <= this.numberOfFrames) { + this.currentFrame = this.currentFrameFromUser - 1; + } }, content: function(newVal, oldVal) { this.status = 'loading'; @@ -424,6 +445,7 @@ // User preferences (stored in the local storage) settingNotDiagnostic: true, settingSoftwareRendering: false, + settingLinearInterpolation: true, layoutCountX: 1, layoutCountY: 1, @@ -505,6 +527,9 @@ }, settingSoftwareRendering: function(newVal, oldVal) { localStorage.settingSoftwareRendering = (newVal ? '1' : '0'); + }, + settingLinearInterpolation: function(newVal, oldVal) { + localStorage.settingLinearInterpolation = (newVal ? '1' : '0'); } }, methods: { @@ -885,9 +910,25 @@ } }, + RotateLeft: function() { + var canvas = this.GetActiveCanvas(); + if (canvas != '') { + stone.RotateLeft(canvas); + } + }, + + RotateRight: function() { + var canvas = this.GetActiveCanvas(); + if (canvas != '') { + stone.RotateRight(canvas); + } + }, + ApplyPreferences: function() { this.modalPreferences = false; + stone.SetLinearInterpolation(localStorage.settingLinearInterpolation); + if ((stone.IsSoftwareRendering() != 0) != this.settingSoftwareRendering) { document.location.reload(); } @@ -1114,6 +1155,8 @@ }, mounted: function() { + // Warning: In this function, the "stone" global object is not initialized yet! + this.SetViewportLayout('1x1'); if (localStorage.settingNotDiagnostic) { @@ -1124,6 +1167,10 @@ this.settingSoftwareRendering = (localStorage.settingSoftwareRendering == '1'); } + if (localStorage.settingLinearInterpolation) { + this.settingLinearInterpolation = (localStorage.settingLinearInterpolation == '1'); + } + var that = this; window.addEventListener('VirtualSeriesThumbnailLoaded', function(args) { @@ -1149,6 +1196,15 @@ window.addEventListener('StoneAnnotationRemoved', function() { // Ignore }); + + window.addEventListener('TextAnnotationRequired', function(args) { + var label = prompt('Enter your annotation:', ''); + if (label !== null) { + stone.AddTextAnnotation(args.detail.canvasId, label, + args.detail.pointedX, args.detail.pointedY, + args.detail.labelX, args.detail.labelY); + } + }); } }); @@ -1163,7 +1219,8 @@ stone.Setup(Module); stone.SetDicomWebRoot(app.globalConfiguration.DicomWebRoot, true /* assume "/rendered" is available in DICOMweb (could be a configuration option) */); - stone.SetSoftwareRendering(localStorage.settingSoftwareRendering == '1'); + stone.SetSoftwareRendering(app.settingSoftwareRendering); + stone.SetLinearInterpolation(app.settingLinearInterpolation); if ('DicomCacheSize' in app.globalConfiguration) { stone.SetDicomCacheSize(app.globalConfiguration.DicomCacheSize); diff -r 2034ae383cfd -r 963f28eb40cb Applications/StoneWebViewer/WebApplication/configuration.json --- a/Applications/StoneWebViewer/WebApplication/configuration.json Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/StoneWebViewer/WebApplication/configuration.json Wed Nov 02 15:14:56 2022 +0100 @@ -37,7 +37,8 @@ * windowing, zoom and pan from a single mouse configuration. The * behaviour of the combined tool is defined in * CombinedToolBehaviour. The available mouse actions are - * "Crosshair", "Windowing", "Pan", "Rotate" and "Zoom". + * "Crosshair", "Windowing", "Pan", "Rotate", "Zoom" and + * "MagnifyingGlass". **/ "CombinedToolEnabled" : true, "CombinedToolBehaviour" : { diff -r 2034ae383cfd -r 963f28eb40cb Applications/StoneWebViewer/WebApplication/index.html --- a/Applications/StoneWebViewer/WebApplication/index.html Fri Oct 28 07:47:55 2022 +0200 +++ b/Applications/StoneWebViewer/WebApplication/index.html Wed Nov 02 15:14:56 2022 +0100 @@ -85,7 +85,11 @@
-