diff --git a/changelog.md b/changelog.md index 3aa81e8692..a14bdead77 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## [v0.31.3](https://github.com/ivmartel/dwv/releases/tag/v0.31.3) - 16/11/2023 + +### Added + +- Allow to change image smoothing from the app [#1555](https://github.com/ivmartel/dwv/issues/1555) + ## [v0.31.2](https://github.com/ivmartel/dwv/releases/tag/v0.31.2) - 07/05/2023 ### Fixed @@ -483,7 +489,7 @@ ### Added -- Make mouse-wheel and mouse-move coherent for scroll [#427](https://github.com/ivmartel/dwv/issues/427) +- Make mouse-wheel and mouse-move coherent for scroll [#427](https://github.com/ivmartel/dwv/issues/427) - Misprint in label [#426](https://github.com/ivmartel/dwv/issues/426) - Add folder support on file input [#424](https://github.com/ivmartel/dwv/issues/424) - Allow to cancel a file download and/or display [#412](https://github.com/ivmartel/dwv/issues/412) @@ -532,7 +538,7 @@ ### Added -- Allow for easier file loader integration [#337](https://github.com/ivmartel/dwv/issues/337) +- Allow for easier file loader integration [#337](https://github.com/ivmartel/dwv/issues/337) - Use a top of page line progress for the mobile viewer [#333](https://github.com/ivmartel/dwv/issues/333) - Import data from video file [#328](https://github.com/ivmartel/dwv/issues/328) - Do not show mesures when no pixel spacing is set [#302](https://github.com/ivmartel/dwv/issues/302) @@ -589,7 +595,7 @@ ### Added -- Allow for individual draw display toggle [#293](https://github.com/ivmartel/dwv/issues/293) +- Allow for individual draw display toggle [#293](https://github.com/ivmartel/dwv/issues/293) - Add a free-hand draw tool [#292](https://github.com/ivmartel/dwv/issues/292) - Add an annotation draw tool [#291](https://github.com/ivmartel/dwv/issues/291) - Change the line tool into a ruler [#290](https://github.com/ivmartel/dwv/issues/290) @@ -677,7 +683,7 @@ - Fix id generator [#201](https://github.com/ivmartel/dwv/issues/201) - Fix slice order glitch [#200](https://github.com/ivmartel/dwv/issues/200) -- group.id argument for draw listener [#198](https://github.com/ivmartel/dwv/issues/198) +- group.id argument for draw listener [#198](https://github.com/ivmartel/dwv/issues/198) - Uncaught TypeError: Cannot read property 'add' of null [#197](https://github.com/ivmartel/dwv/issues/197) --- @@ -699,7 +705,7 @@ ### Added -- Access GUI component per app [#177](https://github.com/ivmartel/dwv/issues/177) +- Access GUI component per app [#177](https://github.com/ivmartel/dwv/issues/177) ### Fixed @@ -897,7 +903,7 @@ - Adapt presets to modality [#37](https://github.com/ivmartel/dwv/issues/37) - MVC Design [#36](https://github.com/ivmartel/dwv/issues/36) - Safeguard zoom/pan [#35](https://github.com/ivmartel/dwv/issues/35) -- Use the bits* DICOM tags [#30](https://github.com/ivmartel/dwv/issues/30) +- Use the bits\* DICOM tags [#30](https://github.com/ivmartel/dwv/issues/30) - Load multiple local slices [#3](https://github.com/ivmartel/dwv/issues/3) ### Fixed diff --git a/dist/dwv.js b/dist/dwv.js index d3e2e49037..843063f971 100644 --- a/dist/dwv.js +++ b/dist/dwv.js @@ -1,4 +1,4 @@ -/*! dwv 0.31.2 2023-05-07 12:03:47 */ +/*! dwv 0.31.3 2023-11-16 12:13:08 */ // Inspired from umdjs // See https://github.com/umdjs/umd/blob/master/templates/returnExports.js (function (root, factory) { @@ -617,6 +617,16 @@ dwv.App = function () { controller.initialise(); }; + /** + * Set the imageSmoothing flag value. Default is false. + * + * @param {boolean} flag True to enable smoothing. + */ + this.setImageSmoothing = function (flag) { + stage.setImageSmoothing(flag); + stage.draw(); + }; + /** * Get the layer group configuration from a data index. * Defaults to div id 'layerGroup' if no association object has been set. @@ -4749,7 +4759,7 @@ dwv.dicom = dwv.dicom || {}; * @returns {string} The version of the library. */ dwv.getVersion = function () { - return '0.31.2'; + return '0.31.3'; }; /** @@ -13819,6 +13829,13 @@ dwv.gui.LayerGroup = function (containerDiv) { */ var currentPosition; + /** + * Image smoothing flag. + * + * @type {boolean} + */ + var imageSmoothing = false; + /** * Get the target orientation. * @@ -13868,6 +13885,21 @@ dwv.gui.LayerGroup = function (containerDiv) { } }; + /** + * Set the imageSmoothing flag value. + * + * @param {boolean} flag True to enable smoothing. + */ + this.setImageSmoothing = function (flag) { + imageSmoothing = flag; + // set for existing layers + for (let i = 0; i < layers.length; ++i) { + if (layers[i] instanceof dwv.gui.ViewLayer) { + layers[i].enableImageSmoothing(flag); + } + } + }; + /** * Update crosshair on offset or zoom change. */ @@ -14080,6 +14112,7 @@ dwv.gui.LayerGroup = function (containerDiv) { containerDiv.append(div); // view layer var layer = new dwv.gui.ViewLayer(div); + layer.enableImageSmoothing(imageSmoothing); // add layer layers.push(layer); // mark it as active @@ -14693,6 +14726,9 @@ dwv.gui.Stage = function () { // binder callbacks var callbackStore = null; + // image smoothing flag + var imageSmoothing = false; + /** * Get the layer group at the given index. * @@ -14758,6 +14794,7 @@ dwv.gui.Stage = function () { this.addLayerGroup = function (htmlElement) { activeLayerGroupIndex = layerGroups.length; var layerGroup = new dwv.gui.LayerGroup(htmlElement); + layerGroup.setImageSmoothing(imageSmoothing); // add to storage var isBound = callbackStore && callbackStore.length !== 0; if (isBound) { @@ -14895,6 +14932,18 @@ dwv.gui.Stage = function () { callbackStore = null; }; + /** + * Set the imageSmoothing flag value. + * + * @param {boolean} flag True to enable smoothing. + */ + this.setImageSmoothing = function (flag) { + imageSmoothing = flag; + for (let i = 0; i < layerGroups.length; ++i) { + layerGroups[i].setImageSmoothing(flag); + } + }; + /** * Get the binder callback function for a given layer group index. * The function is created if not yet stored. diff --git a/dist/dwv.min.js b/dist/dwv.min.js index bf368e211b..ae104a9614 100644 --- a/dist/dwv.min.js +++ b/dist/dwv.min.js @@ -1,2 +1,2 @@ -/*! dwv 0.31.2 2023-05-07 12:03:47 */ -!function(e,t){"function"==typeof define&&define.amd?define(["jszip","konva","magic-wand-tool"],t):"object"==typeof module&&module.exports?module.exports=t(require("jszip"),require("konva/cmj"),require("magic-wand-tool")):e.dwv=t(e.JSZip,e.Konva,e.MagicWand)}(this,function(i,L,v){{{var e,l=void 0!==l?l:"undefined"!=typeof self?self:"undefined"!=typeof global?global:{},_=(void 0!==(e=L)&&void 0!==e.default&&(L=L.default),_||{}),_=(_.App=function(){var d=this,S=null,m=null,h=null,f=null,p=null,y=null,e=new _.gui.Style,n=new _.utils.ListenerHandler;function o(e){if(null===S.dataViewConfigs||void 0===S.dataViewConfigs)throw new Error("No available data view configuration");var t=[];return void 0!==S.dataViewConfigs["*"]?t=S.dataViewConfigs["*"]:void 0!==S.dataViewConfigs[e]&&(t=S.dataViewConfigs[e]),t}function a(e){for(var t=Object.keys(e),n=[],i=0;i2^"+t+")."))}return i},_.dicom.is32bitVLVR=function(e){return _.dicom.vr32bitVL.includes(e)},_.dicom.getDataElementPrefixByteSize=function(e,t){return!t&&_.dicom.is32bitVLVR(e)?12:8},_.dicom.DicomParser=function(){this.dicomElements={};var t,n=new _.dicom.DefaultTextDecoder,i=n;this.decodeString=function(e){return n.decode(e)},this.decodeSpecialString=function(e){return i.decode(e)},this.getDefaultCharacterSet=function(){return t},this.setDefaultCharacterSet=function(e){t=e,this.setCharacterSet(e)},this.setDecoderCharacterSet=function(e){i=new TextDecoder(e)}},_.dicom.DicomParser.prototype.getRawDicomElements=function(){return this.dicomElements},_.dicom.DicomParser.prototype.getDicomElements=function(){return new _.dicom.DicomElementsWrapper(this.dicomElements)},_.dicom.DicomParser.prototype.readTag=function(e,t){var n=e.readHex(t),e=(t+=Uint16Array.BYTES_PER_ELEMENT,e.readHex(t));return t+=Uint16Array.BYTES_PER_ELEMENT,{tag:new _.dicom.Tag(n,e),endOffset:t}},_.dicom.DicomParser.prototype.readItemDataElement=function(e,t,n){var i={},r=this.readDataElement(e,t,n);if(t=r.endOffset,_.dicom.isSequenceDelimitationItemTag(r.tag))return{data:i,endOffset:r.endOffset,isSeqDelim:!0};if(i[r.tag.getKey()]={tag:r.tag,vr:"NONE",vl:r.vl,undefinedLength:r.undefinedLength},r.undefinedLength)for(var o=!1;!o;)t=(r=this.readDataElement(e,t,n)).endOffset,(o=_.dicom.isItemDelimitationItemTag(r.tag))||(i[r.tag.getKey()]=r);else{var a=t;for(t-=r.vl;t8 and OB VR."),u=[],1===i)u.push(t.readBinaryArray(s,o));else if(8===i)0===n?u.push(t.readUint8Array(s,o)):u.push(t.readInt8Array(s,o));else{if(16!==i)throw new Error("Unsupported bits allocated: "+i);0===n?u.push(t.readUint16Array(s,o)):u.push(t.readInt16Array(s,o))}else if(void 0!==l)if("Uint8"===l)u=t.readUint8Array(s,o);else if("Uint16"===l)u=t.readUint16Array(s,o);else if("Uint32"===l)u=t.readUint32Array(s,o);else if("Uint64"===l)u=t.readUint64Array(s,o);else if("Int16"===l)u=t.readInt16Array(s,o);else if("Int32"===l)u=t.readInt32Array(s,o);else if("Int64"===l)u=t.readInt64Array(s,o);else if("Float32"===l)u=t.readFloat32Array(s,o);else if("Float64"===l)u=t.readFloat64Array(s,o);else{if("string"!==l)throw Error("Unknown VR type: "+l);r=t.readUint8Array(s,o);u=(u=_.dicom.charSetString.includes(a)?this.decodeSpecialString(r):this.decodeString(r)).split("\\")}else if("ox"===a)u=8===i?t.readUint8Array(s,o):t.readUint16Array(s,o);else if("xs"===a)u=0===n?t.readUint16Array(s,o):t.readInt16Array(s,o);else if("AT"===a){var d=t.readUint16Array(s,o);u=[];for(var g=0,x=d.length;gg){for(var S=x.length/g,m=[],h=0;ht.x&&(t.x=e.x),e.y>t.y&&(t.y=e.y));return t=0===t.x&&0===t.y?void 0:t},this.flipScaleZ=function(){e.z*=-1,this.setScale(e)},this.addScale=function(e,t){e={x:i.x*(1+e),y:i.y*(1+e),z:i.z*(1+e)};this.setScale(e,t)},this.setScale=function(e,t){i=e;for(var n=0;n2^"+i+") for decompressed data.")),g.abort(),d.onerror({error:e,source:origin}),d.onloadend({source:origin})}}n.length!==m[t]&&_.logger.warn("Unsupported varying decompressed data size: "+n.length+" != "+m[t]),S[t].set(n,m[t]*e.itemNumber)}else S[t]=n;0===e.itemNumber&&h(t,origin)}(e),e.itemNumber+1===e.numberOfItems&&(d.onload(e),d.onloadend(e))},g.onerror=d.onerror,g.onabort=d.onabort);for(var l=0;ln.getMax()?t:e})},_.image.filter.Sharpen=function(){this.getName=function(){return"Sharpen"};var t=null;this.setOriginalImage=function(e){t=e},this.getOriginalImage=function(){return t}},_.image.filter.Sharpen.prototype.update=function(){return this.getOriginalImage().convolute2D([0,-1,0,-1,5,-1,0,-1,0])},_.image.filter.Sobel=function(){this.getName=function(){return"Sobel"};var t=null;this.setOriginalImage=function(e){t=e},this.getOriginalImage=function(){return t}},_.image.filter.Sobel.prototype.update=function(){var e=this.getOriginalImage(),t=e.convolute2D([1,0,-1,2,0,-2,1,0,-1]),e=e.convolute2D([1,2,1,0,0,0,-1,-2,-1]);return t.compose(e,function(e,t){return Math.sqrt(e*e+t*t)})},_||{}),_=(_.image=_.image||{},_.image.Geometry=function(e,i,r,s,t){var o,u=[e],l={},a=(void 0!==t&&(l[o=t]=[e]),void 0===s&&(s=new _.math.getIdentityMat33),!1);this.getInitialTime=function(){return o},this.getCurrentTotalNumberOfSlices=function(){var e=Object.keys(l);if(0===e.length)return u.length;for(var t=0,n=0;n=T.numberOfFiles)throw new Error("Cannot append a frame at an index above the number of frames");y.set(e,n*t),this.appendFrame()},this.appendFrame=function(e,t){p.appendFrame(e,t),d({type:"appendframe"})},this.getDataRange=function(){return n=n||this.calculateDataRange()},this.getRescaledDataRange=function(){return i=i||this.calculateRescaledDataRange()},this.getHistogram=function(){var e;return u||(e=this.calculateHistogram(),n=e.dataRange,i=e.rescaledDataRange,u=e.histogram),u},this.addEventListener=function(e,t){l.add(e,t)},this.removeEventListener=function(e,t){l.remove(e,t)},this.setAtOffsets=function(e,t){for(var n,i=0,r=e.length;i>8}),u=u.map(i),a=a.map(i))):8===t[2]&&(_.logger.info("Scaling 16bits color lut since the lut descriptor is 8."),r=l.slice(0),l=new Uint8Array(r.buffer),r=u.slice(0),u=new Uint8Array(r.buffer),r=a.slice(0),a=new Uint8Array(r.buffer))),o.paletteLut={red:l,green:u,blue:a});s=e.getFromKey("x00082144");return s&&(o.RecommendedDisplayFrameRate=parseInt(s,10)),c.setMeta(o),c},_||{}),_=(_.image=_.image||{},_.image.simpleRange=function(t,e,n,i){void 0===i&&(i=1);var r=e;return{next:function(){var e;return r=t[r+1].index&&++r,e={value:t[r].colour,done:!1,index:i},++i,e):{done:!0,index:n}}}},_||{}),_=(_.image=_.image||{},_.image.lut=_.image.lut||{},_.image.lut.range_max=256,_.image.lut.buildLut=function(e){for(var t=[],n=0;n<_.image.lut.range_max;++n)t.push(e(n));return t},_.image.lut.max=function(e){return _.image.lut.range_max-1},_.image.lut.maxFirstThird=function(e){return e<_.image.lut.range_max/3?_.image.lut.range_max-1:0},_.image.lut.maxSecondThird=function(e){var t=_.image.lut.range_max/3;return t<=e&&e<2*t?_.image.lut.range_max-1:0},_.image.lut.maxThirdThird=function(e){return e>=2*_.image.lut.range_max/3?_.image.lut.range_max-1:0},_.image.lut.toMaxFirstThird=function(e){e*=3;return e>_.image.lut.range_max-1?_.image.lut.range_max-1:e},_.image.lut.toMaxSecondThird=function(e){var t=_.image.lut.range_max/3,n=0;return t<=e&&(n=3*(e-t))>_.image.lut.range_max-1?_.image.lut.range_max-1:n},_.image.lut.toMaxThirdThird=function(e){var t=_.image.lut.range_max/3,n=0;return 2*t<=e&&(n=3*(e-2*t))>_.image.lut.range_max-1?_.image.lut.range_max-1:n},_.image.lut.zero=function(e){return 0},_.image.lut.id=function(e){return e},_.image.lut.invId=function(e){return _.image.lut.range_max-1-e},_.image.lut.plain={red:_.image.lut.buildLut(_.image.lut.id),green:_.image.lut.buildLut(_.image.lut.id),blue:_.image.lut.buildLut(_.image.lut.id)},_.image.lut.invPlain={red:_.image.lut.buildLut(_.image.lut.invId),green:_.image.lut.buildLut(_.image.lut.invId),blue:_.image.lut.buildLut(_.image.lut.invId)},_.image.lut.rainbow={blue:[0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,247,239,231,223,215,207,199,191,183,175,167,159,151,143,135,127,119,111,103,95,87,79,71,63,55,47,39,31,23,15,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,251,249,247,245,243,241,239,237,235,233,231,229,227,225,223,221,219,217,215,213,211,209,207,205,203,201,199,197,195,193,192,189,186,183,180,177,174,171,168,165,162,159,156,153,150,147,144,141,138,135,132,129,126,123,120,117,114,111,108,105,102,99,96,93,90,87,84,81,78,75,72,69,66,63,60,57,54,51,48,45,42,39,36,33,30,27,24,21,18,15,12,9,6,3],red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,62,60,58,56,54,52,50,48,46,44,42,40,38,36,34,32,30,28,26,24,22,20,18,16,14,12,10,8,6,4,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]},_.image.lut.hot={red:_.image.lut.buildLut(_.image.lut.toMaxFirstThird),green:_.image.lut.buildLut(_.image.lut.toMaxSecondThird),blue:_.image.lut.buildLut(_.image.lut.toMaxThirdThird)},_.image.lut.hot_iron={red:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,255]},_.image.lut.pet={red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,128,126,124,122,120,118,116,114,112,110,108,106,104,102,100,98,96,94,92,90,88,86,84,82,80,78,76,74,72,70,68,66,64,63,61,59,57,55,53,51,49,47,45,43,41,39,37,35,33,31,29,27,25,23,21,19,17,15,13,11,9,7,5,3,1,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,255],blue:[0,1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,252,248,244,240,236,232,228,224,220,216,212,208,204,200,196,192,188,184,180,176,172,168,164,160,156,152,148,144,140,136,132,128,124,120,116,112,108,104,100,96,92,88,84,80,76,72,68,64,60,56,52,48,44,40,36,32,28,24,20,16,12,8,4,0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,170,174,178,182,186,190,194,198,202,206,210,214,218,222,226,230,234,238,242,246,250,255]},_.image.lut.hot_metal_blue={red:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,52,55,57,59,62,64,66,69,71,74,76,78,81,83,85,88,90,93,96,99,102,105,108,111,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,166,169,172,175,178,181,184,187,190,194,198,201,205,209,213,217,221,224,228,232,236,240,244,247,251,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,4,6,8,9,11,13,15,17,19,21,23,24,26,28,30,32,34,36,38,40,41,43,45,47,49,51,53,55,56,58,60,62,64,66,68,70,72,73,75,77,79,81,83,85,87,88,90,92,94,96,98,100,102,104,105,107,109,111,113,115,117,119,120,122,124,126,128,130,132,134,136,137,139,141,143,145,147,149,151,152,154,156,158,160,162,164,166,168,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,201,203,205,207,209,211,213,215,216,218,220,222,224,226,228,229,231,233,235,237,239,240,242,244,246,248,250,251,253,255],blue:[0,2,4,6,8,10,12,14,16,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,184,186,188,190,192,194,196,198,200,197,194,191,188,185,182,179,176,174,171,168,165,162,159,156,153,150,144,138,132,126,121,115,109,103,97,91,85,79,74,68,62,56,50,47,44,41,38,35,32,29,26,24,21,18,15,12,9,6,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,6,9,12,15,18,21,24,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,76,79,82,85,88,91,94,97,100,103,106,109,112,115,118,121,124,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,176,179,182,185,188,191,194,197,200,203,206,210,213,216,219,223,226,229,232,236,239,242,245,249,252,255]},_.image.lut.pet_20step={red:[0,0,0,0,0,0,0,0,0,0,0,0,0,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192,192,192,192,192,176,176,176,176,176,176,176,176,176,176,176,176,176,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255],green:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,112,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,96,96,96,96,96,96,96,96,96,96,96,96,96,144,144,144,144,144,144,144,144,144,144,144,144,144,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,224,208,208,208,208,208,208,208,208,208,208,208,208,208,176,176,176,176,176,176,176,176,176,176,176,176,176,144,144,144,144,144,144,144,144,144,144,144,144,96,96,96,96,96,96,96,96,96,96,96,96,96,48,48,48,48,48,48,48,48,48,48,48,48,48,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255],blue:[0,0,0,0,0,0,0,0,0,0,0,0,0,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,112,112,112,112,112,112,112,112,112,112,112,112,128,128,128,128,128,128,128,128,128,128,128,128,128,176,176,176,176,176,176,176,176,176,176,176,176,176,192,192,192,192,192,192,192,192,192,192,192,192,192,224,224,224,224,224,224,224,224,224,224,224,224,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,80,80,80,80,80,80,80,80,80,80,80,80,80,64,64,64,64,64,64,64,64,64,64,64,64,80,80,80,80,80,80,80,80,80,80,80,80,80,96,96,96,96,96,96,96,96,96,96,96,96,96,64,64,64,64,64,64,64,64,64,64,64,64,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,255]},_.image.lut.test={red:_.image.lut.buildLut(_.image.lut.id),green:_.image.lut.buildLut(_.image.lut.zero),blue:_.image.lut.buildLut(_.image.lut.zero)},_||{}),_=(_.image=_.image||{},_.dicom.equalPosPat=function(e,t){return JSON.stringify(e)===JSON.stringify(t)},_.dicom.getComparePosPat=function(e){var n=e.getInverse();return function(e,t){e=n.multiplyArray3D(e),t=n.multiplyArray3D(t);return e[2]-t[2]}},_.dicom.checkTag=function(e,t){var n=e.getFromKey(t.tag);if(1===t.type||2===t.type){if(null==n)throw new Error("Missing or empty "+t.name)}else if(null==n)return;var i=!1;if(Array.isArray(n))for(var n=n.map(function(e){return _.dicom.cleanString(e)}),r=0;r_.math.REAL_WORLD_EPSILON)&&((L=T>10*_.math.REAL_WORLD_EPSILON)?(L=T>100*_.math.REAL_WORLD_EPSILON)||_.logger.warn("Using even larger real world epsilon in SEG pos pat adding"):_.logger.warn("Using larger real world epsilon in SEG pos pat adding")),L;)if(_.logger.debug("Adding intermediate pos pats for DICOM seg at "+F.toString()),P.push([F.getX(),F.getY(),F.getZ()]),++w,B=new _.math.Index([0,0,w]),F=Q.indexToWorld(B).get3D(),G<(N=V.getDistance(F)))throw new Error("Test distance is increasing when adding intermediate pos pats");P.push(p[A])}for(var k=P.length,W=new _.image.Geometry(v[0],x,D,S),H=[0],O=1;O