forked from cornerstonejs/cornerstone
-
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.
Modified window/level example to include invert button to see that work
fixed bug with invert not invalidating the lut Added support for toggling pixel repication on/off Added firefox support for pixel replication Added example for pixel replication
- Loading branch information
Showing
10 changed files
with
136 additions
and
16 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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,87 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<!-- twitter bootstrap CSS stylesheet - not required by cornerstone --> | ||
<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> | ||
|
||
<!-- cornerstone css - provides some useful css classes --> | ||
<link href="../../dist/cornerstone.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
|
||
<h1> | ||
interpolation/index.html | ||
</h1> | ||
|
||
This is an example of turning on/off interpolation | ||
|
||
<br> | ||
<br> | ||
|
||
<div id="dicomImage" style="width:512px;height:512px" | ||
class="cornerstone-enabled-image" | ||
oncontextmenu="return false" | ||
unselectable='on' | ||
onselectstart='return false;' | ||
onmousedown='return false;'> | ||
</div> | ||
|
||
<button id="interpolation" class="btn">Toggle Interpolation</button> | ||
|
||
</div> | ||
</body> | ||
<!-- include the cornerstone library --> | ||
<script src="../../dist/cornerstone.js"></script> | ||
|
||
<!-- include special code for these examples which provides images --> | ||
<script src="../exampleImageIdLoader.js"></script> | ||
|
||
<!-- jquery - included to make things easier to demo, not needed or used by cornerstone --> | ||
<script src="https://code.jquery.com/jquery-2.1.0.min.js"></script> | ||
|
||
<script> | ||
|
||
// image enable the dicomImage element | ||
var imageId = 'example://1'; | ||
var element = $('#dicomImage').get(0); | ||
var viewportOptions = { | ||
scale : 6.0 | ||
} | ||
cornerstone.enable(element, imageId, viewportOptions); | ||
|
||
$('#interpolation').click(function(e) { | ||
var viewport = cornerstone.getViewport(element); | ||
if(viewport.pixelReplication === true) { | ||
viewport.pixelReplication = false; | ||
} else { | ||
viewport.pixelReplication = true; | ||
} | ||
cornerstone.setViewport(element, viewport); | ||
}); | ||
|
||
// add event handlers to mouse move to adjust window/center | ||
$('#dicomImage').mousedown(function(e) { | ||
var lastX = e.pageX; | ||
var lastY = e.pageY; | ||
|
||
$(document).mousemove(function(e) { | ||
var deltaX = e.pageX - lastX, | ||
deltaY = e.pageY - lastY ; | ||
lastX = e.pageX; | ||
lastY = e.pageY; | ||
|
||
var viewport = cornerstone.getViewport(element); | ||
viewport.windowWidth += (deltaX / viewport.scale); | ||
viewport.windowCenter += (deltaY / viewport.scale); | ||
cornerstone.setViewport(element, viewport); | ||
}); | ||
|
||
$(document).mouseup(function(e) { | ||
$(document).unbind('mousemove'); | ||
$(document).unbind('mouseup'); | ||
}); | ||
}); | ||
|
||
</script> | ||
</html> |
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