Skip to content

Conversation

KarlSjostrand
Copy link
Contributor

@KarlSjostrand KarlSjostrand commented Aug 6, 2018

This bug was messing with DICOM files with explicit VR that included elements with VR encoded as UN but which have known VRs according to the dictionary. The file in question included the element PatientIdentityRemoved which has VR CS according to the dictionary but was encoded with VR UN in the file. This bug fix makes sure the VR stays UN is these cases. ParseFlow should not change the data!

@KarlSjostrand KarlSjostrand added the bug Something isn't working label Aug 6, 2018
currentHeader = Some(header)
currentModification = Some(tagModification)
value = ByteString.empty
Nil
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above is an unrelated fix that slipped in. Else-part of this if-else cannot happen.

else
Some(HeaderPart(tag, updatedVr2, valueLength, isFmi = false, state.bigEndian, state.explicitVR, bytes))
else {
val realVr = if (state.explicitVR) vr else updatedVr2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bug fix. If explicit VR, use the original VR from the binary data, not the VR based on the guessing that takes place above with updatedVr1 and updatedVr2.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 94

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.4%) to 92.244%

Totals Coverage Status
Change from base Build 92: 0.4%
Covered Lines: 1439
Relevant Lines: 1560

💛 - Coveralls

Copy link
Contributor

@fredrik-exini fredrik-exini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fredrik-exini fredrik-exini merged commit d748e6a into develop Aug 13, 2018
@KarlSjostrand KarlSjostrand deleted the bugfix/#8-VR-UN-handling branch August 13, 2018 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants