diff --git a/package.json b/package.json index 06b10447..d48f0f28 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "url": "git://github.com/ivmartel/dwv-jqui.git" }, "dependencies": { - "dwv": "0.32.6", + "dwv": "0.33.0", "i18next": "~23.11.2", "i18next-browser-languagedetector": "~7.2.0", "i18next-http-backend": "~2.5.0", diff --git a/src/gui/colourMap.js b/src/gui/colourMap.js index 098cf791..5f66693c 100644 --- a/src/gui/colourMap.js +++ b/src/gui/colourMap.js @@ -44,11 +44,13 @@ dwvjq.gui.info.MiniColourMap = function (div, app) { var lg = app.getActiveLayerGroup(); var vl = lg.getActiveViewLayer(); var viewController = vl.getViewController(); - var colourMap = viewController.getColourMap(); + var colourMapName = viewController.getColourMap(); + var colourMap = dwv.luts[colourMapName]; var imageData = context.getImageData(0, 0, canvas.width, canvas.height); // histogram sampling var c = 0; - var range = app.getImage(0).getRescaledDataRange(); + const dataId0 = app.getDataIds()[0]; + var range = app.getImage(dataId0).getRescaledDataRange(); var minInt = range.min; var size = range.max - minInt; var incrC = size / canvas.width; diff --git a/src/gui/custom.js b/src/gui/custom.js index b34c67eb..9b0cf685 100644 --- a/src/gui/custom.js +++ b/src/gui/custom.js @@ -45,18 +45,27 @@ dwvjq.gui.Slider = function (app) { * Initialise the slider HTML. */ this.initialise = function () { - var dataRange = app.getImage(0).getDataRange(); + var dataId0 = app.getDataIds()[0]; + var dataRange = app.getImage(dataId0).getDataRange(); var min = dataRange.min; var max = dataRange.max; + console.log(min, max); // jquery-ui slider - $('.thresholdLi').slider({ + $('#thresholdLi').slider({ range: true, min: min, max: max, values: [min, max], slide: function (event, ui) { - app.setFilterMinMax({min: ui.values[0], max: ui.values[1]}); + app.setToolFeatures({ + run: true, + runArgs: { + dataId: app.getDataIds()[0], + min: ui.values[0], + max: ui.values[1] + } + }); } }); }; diff --git a/src/gui/filter.js b/src/gui/filter.js index 9f448d63..0ff48295 100644 --- a/src/gui/filter.js +++ b/src/gui/filter.js @@ -160,7 +160,12 @@ dwvjq.gui.filter.base.createFilterApplyButton = function (app) { var button = document.createElement('button'); button.id = 'runFilterButton'; button.onclick = function (/*event*/) { - app.setToolFeatures({run: true}); + app.setToolFeatures({ + runArgs: { + dataId: app.getDataIds()[0] + }, + run: true + }); }; button.setAttribute('style', 'width:100%; margin-top:0.5em;'); button.setAttribute('class', 'ui-btn ui-btn-b'); diff --git a/src/gui/plot.js b/src/gui/plot.js index 596c1da5..a441780c 100644 --- a/src/gui/plot.js +++ b/src/gui/plot.js @@ -19,7 +19,8 @@ dwvjq.gui.info.Plot = function (div, app) { dwvjq.html.cleanNode(div); } // plot - plot(div, app.getImage(0).getHistogram()); + const dataId0 = app.getDataIds()[0]; + plot(div, app.getImage(dataId0).getHistogram()); }; /** @@ -42,7 +43,8 @@ dwvjq.gui.info.Plot = function (div, app) { ]; // plot - plot(div, app.getImage(0).getHistogram(), {markings: markings}); + const dataId0 = app.getDataIds()[0]; + plot(div, app.getImage(dataId0).getHistogram(), {markings: markings}); }; /** diff --git a/yarn.lock b/yarn.lock index 55177ea1..6f111249 100644 --- a/yarn.lock +++ b/yarn.lock @@ -409,12 +409,12 @@ duplexify@^3.5.1: readable-stream "^2.0.0" stream-shift "^1.0.0" -dwv@0.32.6: - version "0.32.6" - resolved "https://registry.yarnpkg.com/dwv/-/dwv-0.32.6.tgz#0d9bba6ce143adb6173771ed6d0b6750b9a0f4ab" - integrity sha512-PRjuBMJruhK1ZeEWhnLZa1uP1By1Kyf8GWJPv0f5/VqyTF60CHwDvsa2OilP5YFBKnPh5dd9hgQ3FR0nWnAvGA== +dwv@0.33.0: + version "0.33.0" + resolved "https://registry.yarnpkg.com/dwv/-/dwv-0.33.0.tgz#727ba406593c52b10d8efbc4a54012f08de62f2d" + integrity sha512-RhfiUedI+4RNEjaLrfDoVjTm9gYVAAaZgKGZlwg7x6lU5nHGuipRjbHRhz+xfgiCPZ/s6t1+cQLkNw5rrr7Wjg== dependencies: - jszip "~3.10.1" + jszip "^3.10.1" konva "~8.4.2" magic-wand-tool "~1.1.7" @@ -1201,7 +1201,7 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= -jszip@~3.10.1: +jszip@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2" integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==