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.3.0 to 1.4.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("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:()=>u});var e=r(353),t=r.n(e),o=r(213),n=r.n(o);const{getBoundingBoxAroundPolygon:s,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:i}=o,{image:d}=e.detail,g=r.map((e=>[e.x,e.y])),[h,u]=s(g,d);!function(e,o,r,i,s){const d=e.detail.element,g=t().getToolState(d,"stack").data[0],{imageIds:h,currentImageIdIndex:u}=g,{segmentIndex:p}=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}(u,h,s.numberOfSlices),{width:x,height:y}=e.detail.image,[b,D]=r,[v,T]=i;if(!s.inside){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),a=m.labelmap3D(d,n),l=m.labelmap2DByImageIdIndex(a,o,t.rows,t.columns),{pixelData:g}=l;for(let e=0;e<x;e++)for(let o=0;o<r[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=0;e<r[0];e++)for(let o=r[1];o<i[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=i[0];e<x;e++)for(let o=r[1];o<i[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=0;e<x;e++)for(let o=i[1];o<y;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}}return}const w=[];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=b;e<v;e++)for(let o=D;o<T;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(l[n]=p)}const h={imageIdIndex:o,diff:a(g,l)};w.push(h)}for(let e=w.length-1;e>=0;e--)f.pushState(d,[w[e]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)})}(e,o,h,u,i)}const g=t().import("base/BaseTool"),{segRectangleFillInsideCursor:h}=t().import("tools/cursors");const u=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})()));
!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:()=>u});var e=r(353),t=r.n(e),o=r(213),n=r.n(o);const{getBoundingBoxAroundPolygon:s,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:i}=o,{image:d}=e.detail,g=r.map((e=>[e.x,e.y])),[h,u]=s(g,d);!function(e,o,r,i,s){const d=e.detail.element,g=t().getToolState(d,"stack").data[0],{imageIds:h,currentImageIdIndex:u}=g,{segmentIndex:p}=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}(u,h,s.numberOfSlices),{width:x,height:y}=e.detail.image,[b,D]=r,[v,T]=i;if(!s.inside){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),a=m.labelmap3D(d,n),l=m.labelmap2DByImageIdIndex(a,o,t.rows,t.columns),{pixelData:g}=l;for(let e=0;e<x;e++)for(let o=0;o<r[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=0;e<r[0];e++)for(let o=r[1];o<i[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=i[0];e<x;e++)for(let o=r[1];o<i[1];o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}for(let e=0;e<x;e++)for(let o=i[1];o<y;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(g[n]=p)}}return}const w=[];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=b;e<v;e++)for(let o=D;o<T;o++){const n=o*x+e,r=t.getPixelData()[n]*t.slope+t.intercept;r>=s.thresholdLow&&r<=s.thresholdHigh&&(l[n]=p)}const h={imageIdIndex:o,diff:a(g,l)};w.push(h)}for(let e=w.length-1;e>=0;e--)f.pushState(d,[w[e]]),l(d,t().EVENTS.LABELMAP_MODIFIED,{labelmapIndex:m.activeLabelmapIndex(d)})}(e,o,h,u,i)}const g=t().import("base/BaseTool"),{segRectangleFillInsideCursor:h}=t().import("tools/cursors");const u=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.3.0",
"version": "1.4.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