-
Notifications
You must be signed in to change notification settings - Fork 261
ENH: Add some conversions for DICOM values #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
nibabel/nicom/utils.py
Outdated
|
||
|
||
def tm_to_seconds(time_str): | ||
'''Convert a DICOM time value (value representation of 'TM') to the number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be single descriptive line - maybe Convert DICOM time value (VR of 'TM') to seconds past midnight
?
I was playing with regexps for a long evening last night (had a few glasses of wine and wasn't sleeping), ended up with this: master...matthew-brett:419-using-regexps Please feel totally free to ignore, but if you like it, will make a PR to your branch. |
Brendan - anything I can do to help keep up the momentum? |
Adds conversions between DICOM 'TM' value representation and seconds past midnight, as well as between 'AS' value representation and years of age.
Also some numpy fancification of the nice error minimization of the AS string selection.
Codecov Report
@@ Coverage Diff @@
## master #419 +/- ##
=======================================
Coverage 91.70% 91.71%
=======================================
Files 96 96
Lines 12311 12349 +38
Branches 2173 2178 +5
=======================================
+ Hits 11290 11326 +36
- Misses 684 685 +1
- Partials 337 338 +1
Continue to review full report at Codecov.
|
Implemented in dicom_parser, see Value Representation (particularly the Age String example and |
Yes, I will close this one as we are moving to use dicom_parser for this functionality. |
Adds conversions between DICOM 'TM' value representation and
seconds past midnight, as well as between 'AS' value representation
and years of age.