-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add CSA header support #220
Conversation
Mhhh, this comment from the main author doesn't sound good:
|
There are two CSA headers, i.e.:
Now only |
Unfortunately the CSA header also supports indexing, e.g.:
|
Alternatively, instead of dicom-parser we can also use nibabel: I don't know what would be the best choice |
I asked colleague about this and his response was that most of the "interesting" info is in CSA Series Header Info. He says he currently doesn't know about anything interesting in CSA Image Header Info. However, he says that if parsing is the same and it is easy to include both, then why not. For us, CSA Series Header Info includes all information we need. |
I'm already parsing both now, and have also added support for nibabel. The test needs to be improved, currently |
For the tags we need,
Differences: From what I can tell, the values (under "items" or "value") are the same except for the ASCCONV part under |
Yes, that is unfortunate regarding not finished separate |
So inside the CSA header, we have to deal with "raw" DICOM fields (with that clumsy index/items structure) as well as MrPhoenixProtocol fields (which have a more straightforward structure). I don't see an easy way to handle this |
I probably don't understand. |
Well, it's probably me who doesn't understand the CSA header very well. I get: >>> get_dicomfield('MrPhoenixProtocol.tProtocolName', dcmfile)
CSASeriesHeaderInfo tag: MrPhoenixProtocol
CSASeriesHeaderInfo tag: tProtocolName
CSAImageHeaderInfo tag: MrPhoenixProtocol
'' But if I read it directly I get: >>> value = Image(dcm_file_csa).header.get('CSASeriesHeaderInfo')
>>> value['MrPhoenixProtocol']['value']['tProtocolName']
'CBU+AF8-DTI+AF8-64D+AF8-1A' I don't have time now to look into it, but it seems to me things are not working as intended |
For the first example, you need to use: Does it return the same value? |
Ok, couldn't help myself, I added better tests and had to make bugfixes. The code is still dodgy because I don't know how exactly the CSA header is structured |
If you would like to see what is the structure loaded from |
Yes, I did that but I still find it fuzzy
…_____________________
Sent from my phone
Op zo 28 jan 2024 23:30 schreef DominikaZ ***@***.***>:
If you would like to see what is the structure loaded from dicom_parser
or nibabel.csa_header, you can look in debugger when the whole csa header
is in value. Or you can copy the content of value with whole csa header
to file and autoformat it, so it is easy to look at.
—
Reply to this email directly, view it on GitHub
<#220 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTUGLZ5ZTEO3LDZWJJGQ2TYQ3GPVAVCNFSM6AAAAABCJRFQKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTG42DEOBZGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I understand. Maybe the code could try to catch exception if there would be any problem with that. |
It seems to work so I'm merging it |
Thank you very much! This will be a big help for us :). |
Note that you should only use dicom-parser when you need data from the
MrPhoenixProtocol, otherwise the nibabel csa parser will much faster (because
of caching) and you will get the latest pydicom version (dicom-parser restricts pydicom
to an older version)
…_____________________
Sent from my phone
Op ma 29 jan 2024 00:40 schreef DominikaZ ***@***.***>:
Thank you very much! This will be a big help for us :).
—
Reply to this email directly, view it on GitHub
<#220 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADTUGL6KCBFSXAAXJKAUO4TYQ3OVPAVCNFSM6AAAAABCJRFQKSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJTG43DCNZYGM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
No description provided.