New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cornerstonetools-rectangle-roi-threshold-segmentation

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cornerstonetools-rectangle-roi-threshold-segmentation - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

2

dist/index.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cornerstone-tools"),require("cornerstone-core")):"function"==typeof define&&define.amd?define("cornerstonetools-rectangle-roi-threshold-segmentation",["cornerstone-tools","cornerstone-core"],t):"object"==typeof exports?exports["cornerstonetools-rectangle-roi-threshold-segmentation"]=t(require("cornerstone-tools"),require("cornerstone-core")):e["cornerstonetools-rectangle-roi-threshold-segmentation"]=t(e.cornerstoneTools,e.cornerstone)}(self,((e,t)=>(()=>{"use strict";var o={213:e=>{e.exports=t},353:t=>{t.exports=e}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return o[e](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s={};return(()=>{r.d(s,{default:()=>p});var e=r(353),t=r.n(e),o=r(213),n=r.n(o);const{getBoundingBoxAroundPolygon:i,getDiffBetweenPixelData:a}=t().import("util/segmentationUtils"),l=t().import("util/triggerEvent"),c=t().import("util/getLogger")("util:segmentation:operations:paintWithinThresholdInsideOrOutsideRectangle");function d(e,o){const{points:r,configuration:s}=o,{image:d}=e.detail,g=r.map((e=>[e.x,e.y])),[h,p]=i(g,d);!function(e,o,r,s,i){const d=e.detail.element,g=t().getToolState(d,"stack").data[0],{imageIds:h,currentImageIdIndex:p}=g,{segmentIndex:u}=o,{getters:m,setters:f}=t().getModule("segmentation"),I=function(e,t,o){const r=[];let s=e;for(let e=0;e<o;e++){let o=s+e;o>=t.length&&(o-=t.length),r.push({imageIdIndex:o,image:n().imageCache.imageCache[t[o]]?.image})}return r}(p,h,i.numberOfSlices),{width:x,height:b}=e.detail.image,[y,D]=r,[L,v]=s;if(!i.inside){const e=[];for(let t=0;t<I.length;t++){const{image:o,imageIdIndex:n}=I[t];if(!o){c.warn("Image is undefined, it most likely has not been cached yet.");continue}const l=m.activeLabelmapIndex(d),g=m.labelmap3D(d,l),h=m.labelmap2DByImageIdIndex(g,n,o.rows,o.columns),{pixelData:p}=h,y=p.slice();for(let e=0;e<x;e++)for(let t=0;t<r[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=i.thresholdLow&&r<=i.thresholdHigh&&(p[n]=u)}for(let e=0;e<r[0];e++)for(let t=r[1];t<s[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=i.thresholdLow&&r<=i.thresholdHigh&&(p[n]=u)}for(let e=s[0];e<x;e++)for(let t=r[1];t<s[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=i.thresholdLow&&r<=i.thresholdHigh&&(p[n]=u)}for(let e=0;e<x;e++)for(let t=s[1];t<b;t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=i.thresholdLow&&r<=i.thresholdHigh&&(p[n]=u)}const D={imageIdIndex:n,diff:a(y,p)};e.push(D),f.updateSegmentsOnLabelmap2D(h)}for(let o=e.length-1;o>=0;o--)f.pushState(d,[e[o]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)});return}const P=[];for(let e=0;e<I.length;e++){const{image:t,imageIdIndex:o}=I[e];if(!t){c.warn("Image is undefined, it most likely has not been cached yet.");continue}const n=m.activeLabelmapIndex(d),r=m.labelmap3D(d,n),s=m.labelmap2DByImageIdIndex(r,o,t.rows,t.columns),{pixelData:l}=s,g=l.slice();for(let e=y;e<L;e++)for(let o=D;o<v;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=i.thresholdLow&&r<=i.thresholdHigh&&(l[n]=u)}const h={imageIdIndex:o,diff:a(g,l)};P.push(h),f.updateSegmentsOnLabelmap2D(s)}for(let e=P.length-1;e>=0;e--)f.pushState(d,[P[e]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)})}(e,o,h,p,s)}const g=t().import("base/BaseTool"),{segRectangleFillInsideCursor:h}=t().import("tools/cursors");const p=class extends g{constructor(e={}){super(e,{name:"RectangleROIThresholdSegmentation",strategies:{PAINT:d},cursors:{PAINT:h},configuration:{thresholdLow:200,thresholdHigh:1e3,numberOfSlices:200,inside:!0},defaultStrategy:"PAINT",supportedInteractionTypes:["Mouse","Touch"],mixins:["rectangleSegmentationMixin"]})}applyActiveStrategy(e,t){return t.configuration=this.configuration,this.strategies[this.activeStrategy].call(this,e,t)}}})(),s=s.default})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("cornerstone-tools"),require("cornerstone-core")):"function"==typeof define&&define.amd?define("RectangleROIThresholdSegmentation",["cornerstone-tools","cornerstone-core"],t):"object"==typeof exports?exports.RectangleROIThresholdSegmentation=t(require("cornerstone-tools"),require("cornerstone-core")):e.RectangleROIThresholdSegmentation=t(e.cornerstoneTools,e.cornerstone)}(self,((e,t)=>(()=>{"use strict";var o={213:e=>{e.exports=t},353:t=>{t.exports=e}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return o[e](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};return(()=>{r.d(i,{default:()=>p});var e=r(353),t=r.n(e),o=r(213),n=r.n(o);const{getBoundingBoxAroundPolygon:a,getDiffBetweenPixelData:s}=t().import("util/segmentationUtils"),l=t().import("util/triggerEvent"),c=t().import("util/getLogger")("util:segmentation:operations:paintWithinThresholdInsideOrOutsideRectangle");function d(e,o){const{points:r,configuration:i}=o,{image:d}=e.detail,g=r.map((e=>[e.x,e.y])),[h,p]=a(g,d);!function(e,o,r,i,a){const d=e.detail.element,g=t().getToolState(d,"stack").data[0],{imageIds:h,currentImageIdIndex:p}=g,{segmentIndex:u}=o,{getters:m,setters:f}=t().getModule("segmentation"),I=function(e,t,o){const r=[];let i=e;for(let e=0;e<o;e++){let o=i+e;o>=t.length&&(o-=t.length),r.push({imageIdIndex:o,image:n().imageCache.imageCache[t[o]]?.image})}return r}(p,h,a.numberOfSlices),{width:x,height:b}=e.detail.image,[y,D]=r,[L,S]=i;if(!a.inside){const e=[];for(let t=0;t<I.length;t++){const{image:o,imageIdIndex:n}=I[t];if(!o){c.warn("Image is undefined, it most likely has not been cached yet.");continue}const l=m.activeLabelmapIndex(d),g=m.labelmap3D(d,l),h=m.labelmap2DByImageIdIndex(g,n,o.rows,o.columns),{pixelData:p}=h,y=p.slice();for(let e=0;e<x;e++)for(let t=0;t<r[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=a.thresholdLow&&r<=a.thresholdHigh&&(p[n]=u)}for(let e=0;e<r[0];e++)for(let t=r[1];t<i[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=a.thresholdLow&&r<=a.thresholdHigh&&(p[n]=u)}for(let e=i[0];e<x;e++)for(let t=r[1];t<i[1];t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=a.thresholdLow&&r<=a.thresholdHigh&&(p[n]=u)}for(let e=0;e<x;e++)for(let t=i[1];t<b;t++){const n=t*x+e,r=o.getPixelData()[n]*o.slope+o.intercept;r>=a.thresholdLow&&r<=a.thresholdHigh&&(p[n]=u)}const D={imageIdIndex:n,diff:s(y,p)};e.push(D),f.updateSegmentsOnLabelmap2D(h)}for(let o=e.length-1;o>=0;o--)f.pushState(d,[e[o]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)});return}const v=[];for(let e=0;e<I.length;e++){const{image:t,imageIdIndex:o}=I[e];if(!t){c.warn("Image is undefined, it most likely has not been cached yet.");continue}const n=m.activeLabelmapIndex(d),r=m.labelmap3D(d,n),i=m.labelmap2DByImageIdIndex(r,o,t.rows,t.columns),{pixelData:l}=i,g=l.slice();for(let e=y;e<L;e++)for(let o=D;o<S;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=a.thresholdLow&&r<=a.thresholdHigh&&(l[n]=u)}const h={imageIdIndex:o,diff:s(g,l)};v.push(h),f.updateSegmentsOnLabelmap2D(i)}for(let e=v.length-1;e>=0;e--)f.pushState(d,[v[e]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)})}(e,o,h,p,i)}const g=t().import("base/BaseTool"),{segRectangleFillInsideCursor:h}=t().import("tools/cursors");const p=class extends g{constructor(e={}){super(e,{name:"RectangleROIThresholdSegmentation",strategies:{PAINT:d},cursors:{PAINT:h},configuration:{thresholdLow:200,thresholdHigh:1e3,numberOfSlices:200,inside:!0},defaultStrategy:"PAINT",supportedInteractionTypes:["Mouse","Touch"],mixins:["rectangleSegmentationMixin"]})}applyActiveStrategy(e,t){return t.configuration=this.configuration,this.strategies[this.activeStrategy].call(this,e,t)}}})(),i=i.default})()));
{
"name": "cornerstonetools-rectangle-roi-threshold-segmentation",
"version": "1.11.0",
"version": "1.12.0",
"description": "3D Threshold segmentation tool that allows you to segment several slices at once using a rectangle ROI",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc