Skip to content

Commit

Permalink
Only show pixel value for monochrome data. Releates to ivmartel#29.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Dec 10, 2013
1 parent 284344f commit 9554e2d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ dwv.image.View = function(image, isSigned)
colorMap = dwv.image.lut.invPlain;
this.fireEvent({"type": "colorchange",
"wc": this.getWindowLut().getCenter(),
"ww": this.getWindowLut().getWidth() });
"ww": this.getWindowLut().getWidth() });
};

/**
Expand All @@ -156,9 +156,18 @@ dwv.image.View = function(image, isSigned)
if( !image.getSize().isInBounds(pos.i,pos.j,pos.k) ) return false;
var oldPosition = currentPosition;
currentPosition = pos;
this.fireEvent({"type": "positionchange",
"i": pos.i, "j": pos.j, "k": pos.k,
"value": image.getRescaledValue(pos.i,pos.j,pos.k)});
// only display value for monochrome data
if( app.getImage().getPhotometricInterpretation().match(/MONOCHROME/) !== null )
{
this.fireEvent({"type": "positionchange",
"i": pos.i, "j": pos.j, "k": pos.k,
"value": image.getRescaledValue(pos.i,pos.j,pos.k)});
}
else
{
this.fireEvent({"type": "positionchange",
"i": pos.i, "j": pos.j, "k": pos.k});
}
// slice change event (used to trigger redraw)
if( oldPosition.k !== currentPosition.k ) {
this.fireEvent({"type": "slicechange"});
Expand Down

0 comments on commit 9554e2d

Please sign in to comment.