Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@sedghi @swederik, I was going through to make sure CSWIL would automatically select the proper type for cs3d and think there might be a bug. I could very likely wrong though since afaik no such issue has been reported...
Essentially, cs3d will rely on the native decoded array type CSWIL provides. In the case the PixelData is
PixelRepresentation === 0
, it is usually aUint16ArrayBuffer
view for CT data. However, usually this data is preScaled within CSWIL and after scaling, aUint16ArrayBuffer
view should really be aInt16ArrayBuffer
. However, it does not seem like this view is used in thesetPixelDataType
function.It seems like PixelRepresentation also only refers to the stored pixel data tag, not post slope + intercept. (https://groups.google.com/g/comp.protocols.dicom/c/LQv-Vq8fQYA)
A
Uint16
view can easily be recast toInt16
view downstream, which may be why no issues have popped up thus far?Let me know if I'm missing anything here as I'm a bit confused how a Uint16 typed PixelData + rescale would provide back a proper
imageFrame.pixelData
without the changes below.