Skip to content

Commit

Permalink
Shortcuts added. Hide/show info fixed. Canvas and infos packed in a div.
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-kas committed Apr 22, 2013
1 parent dbe4316 commit d1c87a0
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 10 deletions.
12 changes: 8 additions & 4 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ html, body {
height: 100%;
width: 100%;
overflow: hidden;
font-family: "Helvetica Neue",Helvetica,Arial, sans-serif;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 1em;
color: #333;
-webkit-user-select: none;
Expand Down Expand Up @@ -49,7 +49,7 @@ html, body {
}
#viewerScreen {
display: table;
height: 100%;
/*height: 100%;*/
}
.viewerRows .viewerCells {
border-bottom: 1px solid #ddd;
Expand All @@ -66,11 +66,15 @@ html, body {
}
.viewerCells {
display: table-cell;
position:relative;
/*display: block;*/
position: relative;
}
#viewerScreen .viewerCellContent {
display: block;
}
canvas {
cursor:default;
display: block;
/*display: block;*/
margin: auto;
}

Expand Down
17 changes: 16 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@
}
});

// Shortcuts for move, zoom and windowLevel
$(window).keydown(function(e) {
// strg/ctrl or Mac cmd key
if(e.ctrlKey || e.keyCode === 91) {
$('#move').click();
}
if(e.altKey) {
$('#windowLevel').click();
}
if(e.shiftKey) {
$('#zoom').click();
}

return;
});

$('#buttonSet').buttonset();
$('#resetButton').button();
$('#metaButton').button();
Expand Down Expand Up @@ -169,7 +185,6 @@
<body>
<div id="container">
<aside id="sidebar">
<!--<input id="dicomUpload" type="file" accept="application/dicom" multiple />-->
<!--Only Chrome supports webkitdirectory-->
<div id="inputContainer" class="ui-toolbar ui-widget-header">
<input id="dicomUpload" type="file" value="Upload file" webkitdirectory multiple />
Expand Down
22 changes: 17 additions & 5 deletions js/DcmViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ DcmViewer.prototype.showSeries = function(files) {
};

DcmViewer.prototype.inputHandler = function(e) {

};

DcmViewer.prototype.eventHandler = function(e) {
Expand Down Expand Up @@ -94,7 +94,7 @@ DcmViewer.prototype.scrollOne = function(num) {
this.painters[i].drawImg();
// Update instance number
var instanceNum = this.painters[i].currentFile.InstanceNumber ? this.painters[i].currentFile.InstanceNumber : ' - ';
$(getSelector(this.painters[i]) + ' #instanceNum').text(instanceNum + ' / ' + this.numFiles);
$(getSelector(this.painters[i]) + ' #instanceNum').text(instanceNum + ' / ' + this.numFiles);
}
};

Expand All @@ -117,9 +117,12 @@ DcmViewer.prototype.matrixHandler = function(e) {
//var newSize = Math.min(cellWidth, cellHeight);
var tmpId = '#' + rowName + ' #column' + x;
var newId = 'canvas' + x + '' + y;
$(tmpId).append('<canvas id="' + newId + '" width="' + cellWidth + '" height="' + cellHeight + '">Your browser does not support HTML5 canvas</canvas>');
$(tmpId).append('<div class="studyInfo"></div>');
$(tmpId).append('<div class="patientInfo"></div>');
var newId2 = 'content' + x + '' + y;
$(tmpId).append('<div id="' + newId2 + '" class="viewerCellContent" style="display:block;"></div>');

$('#' + newId2).append('<canvas id="' + newId + '" width="' + cellWidth + '" height="' + cellHeight + '">Your browser does not support HTML5 canvas</canvas>');
$('#' + newId2).append('<div class="studyInfo"></div>');
$('#' + newId2).append('<div class="patientInfo"></div>');

var tmpPainter = new CanvasPainter(newId);
newPainters.push(tmpPainter);
Expand All @@ -133,6 +136,15 @@ DcmViewer.prototype.matrixHandler = function(e) {
}
}
}
// Show or hide infos
if($('.studyInfo').is(':visible')) {
$('.studyInfo').hide();
$('.patientInfo').hide();
} else {
$('.studyInfo').show();
$('.patientInfo').show();
}

this.painters = newPainters;
};

Expand Down

0 comments on commit d1c87a0

Please sign in to comment.