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.
Added support for properly displaying images with non square pixels
Added example showing non square pixel display
- Loading branch information
Showing
10 changed files
with
121 additions
and
14 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!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"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
|
||
<h1> | ||
nonSquarePixels/index.html | ||
</h1> | ||
|
||
This is an example of displaying an image with non square pixels. For this example | ||
we are changing the rowPixelSpacing for an image with square pixels so it is half what | ||
it should be. This should result in a squished image | ||
<br> | ||
<br> | ||
|
||
<div id="dicomImage" style="width:512px;height:512px;"> | ||
</div> | ||
|
||
</div> | ||
</body> | ||
<!-- include the cornerstone library --> | ||
<script src="../../dist/cornerstone.js"></script> | ||
|
||
<!-- jquery - included to make things easier to demo, not needed or used by the cornerstone library but | ||
is used by our example image loader--> | ||
<script src="https://code.jquery.com/jquery-2.1.0.min.js"></script> | ||
|
||
<!-- include special code for these examples which provides images --> | ||
<script src="../exampleImageIdLoader.js"></script> | ||
|
||
<script> | ||
var imageId = 'example://1'; | ||
var element = document.getElementById('dicomImage'); | ||
var viewportOptions = { | ||
scale: 1.0 | ||
}; | ||
cornerstone.enable(element, imageId, viewportOptions); | ||
var imageDeferred = cornerstone.loadImage(imageId); | ||
imageDeferred.done(function(image) { | ||
image.rowPixelSpacing = image.rowPixelSpacing / 2.0; | ||
cornerstone.updateImage(element); | ||
}); | ||
</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
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