-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
72 changed files
with
5,124 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,7 +38,7 @@ body { | |
|
||
.overlay { | ||
position: absolute; | ||
color: #f1c40f; | ||
color: #75736c; | ||
} | ||
|
||
.imageViewer { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
const EVENTS = { | ||
// Events from Cornerstone Core | ||
IMAGE_RENDERED: 'cornerstoneimagerendered', | ||
NEW_IMAGE: 'cornerstonenewimage', | ||
IMAGE_CACHE_PROMISE_REMOVED: 'cornerstoneimagecachepromiseremoved', | ||
ELEMENT_DISABLED: 'cornerstoneelementdisabled', | ||
|
||
// Mouse events | ||
MOUSE_DOWN: 'cornerstonetoolsmousedown', | ||
MOUSE_UP: 'cornerstonetoolsmouseup', | ||
MOUSE_DOWN_ACTIVATE: 'cornerstonetoolsmousedownactivate', | ||
MOUSE_DRAG: 'cornerstonetoolsmousedrag', | ||
MOUSE_MOVE: 'cornerstonetoolsmousemove', | ||
MOUSE_CLICK: 'cornerstonetoolsmouseclick', | ||
MOUSE_DOUBLE_CLICK: 'cornerstonetoolsmousedoubleclick', | ||
MOUSE_WHEEL: 'cornerstonetoolsmousewheel', | ||
|
||
// Touch events | ||
TOUCH_START: 'cornerstonetoolstouchstart', | ||
TOUCH_START_ACTIVE: 'cornerstonetoolstouchstartactive', | ||
TOUCH_END: 'cornerstonetoolstouchend', | ||
TOUCH_DRAG: 'cornerstonetoolstouchdrag', | ||
TOUCH_DRAG_END: 'cornerstonetoolstouchdragend', | ||
TOUCH_PINCH: 'cornerstonetoolstouchpinch', | ||
TOUCH_ROTATE: 'cornerstonetoolstouchrotate', | ||
TOUCH_PRESS: 'cornerstonetoolstouchpress', | ||
TAP: 'cornerstonetoolstap', | ||
DOUBLE_TAP: 'cornerstonetoolsdoubletap', | ||
MULTI_TOUCH_START: 'cornerstonetoolsmultitouchstart', | ||
MULTI_TOUCH_START_ACTIVE: 'cornerstonetoolsmultitouchstartactive', | ||
MULTI_TOUCH_DRAG: 'cornerstonetoolsmultitouchdrag', | ||
|
||
// Keyboard events | ||
KEY_DOWN: 'cornerstonetoolskeydown', | ||
KEY_UP: 'cornerstonetoolskeyup', | ||
KEY_PRESS: 'cornerstonetoolskeypress', | ||
|
||
// Measurement / tool events | ||
MEASUREMENT_ADDED: 'cornerstonetoolsmeasurementadded', | ||
MEASUREMENT_MODIFIED: 'cornerstonetoolsmeasurementmodified', | ||
MEASUREMENT_REMOVED: 'cornerstonemeasurementremoved', | ||
TOOL_DEACTIVATED: 'cornerstonetoolstooldeactivated', | ||
CLIP_STOPPED: 'cornerstonetoolsclipstopped', | ||
STACK_SCROLL: 'cornerstonestackscroll', // Should be renamed | ||
|
||
LINE_SAMPLE_UPDATED: 'cornerstonelinesampleupdated' | ||
}; | ||
|
||
export default EVENTS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
let cornerstone = window.cornerstone; | ||
let cornerstoneMath = window.cornerstoneMath; | ||
let Hammer = window.Hammer; | ||
|
||
export default { | ||
set cornerstone (cs) { | ||
cornerstone = cs; | ||
}, | ||
get cornerstone () { | ||
return cornerstone; | ||
}, | ||
set cornerstoneMath (cm) { | ||
cornerstoneMath = cm; | ||
}, | ||
get cornerstoneMath () { | ||
return cornerstoneMath; | ||
}, | ||
set Hammer (module) { | ||
Hammer = module; | ||
}, | ||
get Hammer () { | ||
return Hammer; | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import pointInEllipse from './pointInEllipse.js'; | ||
|
||
export default function (sp, ellipse) { | ||
// TODO: Get a real statistics library here that supports large counts | ||
|
||
let sum = 0; | ||
let sumSquared = 0; | ||
let count = 0; | ||
let index = 0; | ||
|
||
for (let y = ellipse.top; y < ellipse.top + ellipse.height; y++) { | ||
for (let x = ellipse.left; x < ellipse.left + ellipse.width; x++) { | ||
const point = { | ||
x, | ||
y | ||
}; | ||
|
||
if (pointInEllipse(ellipse, point)) { | ||
sum += sp[index]; | ||
sumSquared += sp[index] * sp[index]; | ||
count++; | ||
} | ||
|
||
index++; | ||
} | ||
} | ||
|
||
if (count === 0) { | ||
return { | ||
count, | ||
mean: 0.0, | ||
variance: 0.0, | ||
stdDev: 0.0 | ||
}; | ||
} | ||
|
||
const mean = sum / count; | ||
const variance = sumSquared / count - mean * mean; | ||
|
||
return { | ||
count, | ||
mean, | ||
variance, | ||
stdDev: Math.sqrt(variance) | ||
}; | ||
} |
Oops, something went wrong.