Skip to content

Commit

Permalink
Replace YBR_FULL_422 by YBR_FULL. Fixes #63
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Jul 24, 2019
1 parent 47d6f53 commit e87ce7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ dwv.image.Image = function(geometry, buffer, numberOfFrames)

// calculate slice size
var mul = 1;
if( photometricInterpretation === "RGB" || photometricInterpretation === "YBR_FULL_422") {
if( photometricInterpretation === "RGB" || photometricInterpretation === "YBR_FULL") {
mul = 3;
}
var sliceSize = mul * size.getSliceSize();
Expand Down
8 changes: 4 additions & 4 deletions src/image/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ dwv.image.View.prototype.generateImageData = function( array )
}
break;

case "YBR_FULL_422":
case "YBR_FULL":
// theory:
// http://dicom.nema.org/dicom/2013/output/chtml/part03/sect_C.7.html#sect_C.7.6.3.1.2
// reverse equation:
Expand Down Expand Up @@ -764,9 +764,9 @@ dwv.image.View.prototype.generateImageData = function( array )
g = y - 0.34414 * (cb - 128) - 0.71414 * (cr - 128);
b = y + 1.772 * (cb - 128);

array.data[index] = windowLut.getValue(r);
array.data[index+1] = windowLut.getValue(g);
array.data[index+2] = windowLut.getValue(b);
array.data[index] = r;
array.data[index+1] = g;
array.data[index+2] = b;
array.data[index+3] = 0xff;
index += 4;

Expand Down

0 comments on commit e87ce7e

Please sign in to comment.