|
From: <way...@us...> - 2011-07-28 15:27:55
|
Revision: 15731
http://dcm4che.svn.sourceforge.net/dcm4che/?rev=15731&view=rev
Author: wayfarer3130
Date: 2011-07-28 15:27:48 +0000 (Thu, 28 Jul 2011)
Log Message:
-----------
Review #2658: "[artf58955] : Window / Level "jumps" significantly from original setting" (due in 1 day)
Also [#DCM-487] VOI LUT with a rescale slope other than 1 come out all black/white in the dcm4che2 codebase.
Subversion - 1 files.
Subversion - 2 files.
Modified Paths:
--------------
dcm4che2/trunk/dcm4che-image/src/main/java/org/dcm4che2/image/LookupTable.java
Modified: dcm4che2/trunk/dcm4che-image/src/main/java/org/dcm4che2/image/LookupTable.java
===================================================================
--- dcm4che2/trunk/dcm4che-image/src/main/java/org/dcm4che2/image/LookupTable.java 2011-07-28 12:13:36 UTC (rev 15730)
+++ dcm4che2/trunk/dcm4che-image/src/main/java/org/dcm4che2/image/LookupTable.java 2011-07-28 15:27:48 UTC (rev 15731)
@@ -771,21 +771,21 @@
return lut;
}
- LookupTable vlut = createLut(32, true, voiLut, pixelPaddingValue, pixelPaddingRange, inverse);
+ LookupTable vlut = createLut(inBits, signed, voiLut, pixelPaddingValue, pixelPaddingRange, inverse);
float in1 = (vlut.off - intercept) / slope;
float in2 = in1 + vlut.length() / slope;
int off = (int) Math.floor(Math.min(in1, in2));
int len = ((int) Math.ceil(Math.max(in1, in2))) - off;
short[] data = new short[len];
for (int i = 0; i < data.length; i++) {
- data[i] = vlut.lookupShort(Math.round(i * slope + intercept));
+ data[i] = vlut.lookupShort(Math.round(i * slope +off + intercept));
}
GenericNumericArray dataArray = GenericNumericArray.create(data);
Integer[] minMaxPixelPadding = getMinMaxPixelPadding(pixelPaddingValue, pixelPaddingRange);
applyPixelPadding(dataArray, 0, minMaxPixelPadding[0], minMaxPixelPadding[1], off);
- return new ShortLookupTable(inBits, signed, off, vlut.outBits,
+ return new ShortLookupTable(inBits, signed, off, vlut.outBits,
(short[]) dataArray.getArray());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|