When processing images where the getDataType() method returns values other than daikon.Image.BYTE_TYPE_INTEGER and daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED, the getInterpolatedData() method returns all-zero data, due to this block of code in the pixel-processing loop:
for (ctr = 0; ctr < numElements; ctr += 1) {
// Value only assigned if datatype has one of two values, but it often has others
if (datatype === daikon.Image.BYTE_TYPE_INTEGER) {
if (numBytes === 1) {
rawValue = dataView.getInt8(ctr * numBytes);
} else if (numBytes === 2) {
rawValue = dataView.getInt16(ctr * numBytes, littleEndian);
}
} else if (datatype === daikon.Image.BYTE_TYPE_INTEGER_UNSIGNED) {
if (numBytes === 1) {
rawValue = dataView.getUint8(ctr * numBytes);
} else if (numBytes === 2) {
rawValue = dataView.getUint16(ctr * numBytes, littleEndian);
}
}
// ** At this point, value can be unassigned (==0) if neither of above forks taken
value = ((rawValue & mask) * slope) + intercept;
data[ctr] = value;
// ... rest of loop
Solution is to limit datatype to only the standard values - I created PR #13 to address this.
When processing images where the
getDataType()
method returns values other thandaikon.Image.BYTE_TYPE_INTEGER
anddaikon.Image.BYTE_TYPE_INTEGER_UNSIGNED
, thegetInterpolatedData()
method returns all-zero data, due to this block of code in the pixel-processing loop:Solution is to limit datatype to only the standard values - I created PR #13 to address this.