-
Notifications
You must be signed in to change notification settings - Fork 261
ENH: Add writer for Siemens CSA header #417
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
This is another bite-sized chunk from #290. I was tempted to make a It would also be nice to use |
☔ The latest upstream changes (presumably #393) made this pull request unmergeable. Please resolve the merge conflicts. |
The csa representation as we wrote it originally is a bit kludgy, I think - if you're interested - it would be worth improving that with a new csa module, and depracting the I don't think we have to worry as much as usual about backwards compatibility - the |
By the way - thanks very much for breaking out the change from the big PR - it's extremely helpful. |
Allows us to take a parsed CSA header and convert it back into a string. Useful for things like DICOM anonymization, or perhaps round tripping DICOM -> Nifti -> DICOM.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #417 +/- ##
==========================================
- Coverage 91.70% 91.66% -0.04%
==========================================
Files 96 96
Lines 12311 12360 +49
Branches 2173 2186 +13
==========================================
+ Hits 11290 11330 +40
- Misses 684 690 +6
- Partials 337 340 +3 ☔ View full report in Codecov by Sentry. |
@ZviBaratz @matthew-brett @effigies During our recent meeting, I forgot the original reason I wrote this was to support anonymization of Siemens mosaic/DWI Dicom files (not round-tripping back to DICOM). The standard way to anonymize DICOM removes all private headers, but then you lose the mosaic info and b-values/b-vecs. You can whitelist the CSA sub-header with this info, but at least some versions of the scanner software will use uninitialized memory for the CSA buffer and then leak PHI in the unused portions. So by parsing it and rewriting it with this code (which does zero out the memory) you can avoid this issue. So... it is pretty niche but still useful. This also got me thinking, is dicom_parser going to make any attempt at supporting anonymization? Should we start a dicom_anon project? |
I haven't really given it much thought so far, but I definitely support the idea. Do you think a separate package will be better? I feel like it could probably be added to dicom_parser fairly easily, but it's possible I'm simply not aware of some anonymization edge-cases, such as the CSA thing. |
I'm going to go ahead and merge this. Coverage is reasonable, and can be built off of. Sorry for taking so long to get back to this. |
Allows us to take a parsed CSA header and convert it back into a
string. Useful for things like DICOM anonymization, or perhaps
round tripping DICOM -> Nifti -> DICOM.