Skip to content
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

extract sequence_name from PulseSequenceName on Siemens XA** data #753

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

bpinsard
Copy link
Contributor

fixes #752

  • need shareable test data
  • write tests

@bpinsard bpinsard changed the title sequence_name from PulseSequenceName on Siemens XA** data extract sequence_name from PulseSequenceName on Siemens XA** data Apr 18, 2024
@yarikoptic
Copy link
Member

Hi @bpinsard -- sounds important. Any sample dicoms ? may be some among dcm2niix test ones (ping @rordenlab)

@bpinsard
Copy link
Contributor Author

The XA dicoms I got are not mine. However, it seems that the dcm2niix XA test data show that behavior. eg. https://github.com/neurolabusc/dcm_qa_nih/blob/master/Ref/DCM2NIIX_regression_test_4.json only has PulseSequenceName and not SequenceName tag.

@yarikoptic
Copy link
Member

ah, what could go wrong, right? ;-) that sequence_name was added by @leej3 in 2017 in 5a7fb1f and it seems that no existing here heuristics use it:

❯ git grep '\[19\]' | grep -v '\.dcm'
❯ git grep sequence_name
heudiconv/dicoms.py:        sequence_name = dcminfo[0x18, 0x24].value
heudiconv/dicoms.py:        sequence_name = dcminfo[0x19, 0x109C].value
heudiconv/dicoms.py:        sequence_name = ""
heudiconv/dicoms.py:        sequence_name=sequence_name,
heudiconv/utils.py:    sequence_name: str  # 19

and no tests test it? (not good). FWIW on my Siemens sample files I do not see that field at all

The XA dicoms I got are not mine. However, it seems that the dcm2niix XA test data show that behavior. eg. https://github.com/neurolabusc/dcm_qa_nih/blob/master/Ref/DCM2NIIX_regression_test_4.json only has PulseSequenceName and not SequenceName tag.

well -- there the epiRT seems to be found only in GE data if I get naming of folders correctly:

❯ pwd
/home/yoh/deb/gits/pkg-exppsy/dcm2niix/dcm_qa_nih/In/20180918Si
❯ dcmdump */*dcm | grep epiRT | head
❯ cd -
~exppsy/dcm2niix/dcm_qa_nih/In/20180918GE
README-Study.txt*  mr_0004/  mr_0005/  mr_0006/  mr_0007/
❯ dcmdump */*dcm | grep epiRT | head
(0019,109c) LO [epiRT]                                  #   6, 1 PulseSequenceName

do you have private data which would attest to that field being useful on XA** data?

@bpinsard
Copy link
Contributor Author

(Sorry for the super late reply, slammed with 10**10 things since I got back from vacations.)

My bad for posting the wrong repo: https://github.com/neurolabusc/dcm_qa_xa30 contains XA dicoms with similar problem: only PulseSequenceName containing the pertinent info for seqinfo (and reflected in dcm2niix sidecars).

I try to rely as much as possible on sequence info rather than idiosyncratic ProtocolName when I write heuristics, but yes it should be covered by tests.

@bpinsard bpinsard force-pushed the fix/xa_pulse_seq_name branch 2 times, most recently from 19253e0 to 49c5783 Compare August 8, 2024 18:31
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.13%. Comparing base (1b0bb5a) to head (9afeae9).
Report is 23 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #753      +/-   ##
==========================================
+ Coverage   82.09%   82.13%   +0.03%     
==========================================
  Files          42       42              
  Lines        4217     4226       +9     
==========================================
+ Hits         3462     3471       +9     
  Misses        755      755              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bpinsard
Copy link
Contributor Author

bpinsard commented Aug 8, 2024

Added really basic test that grabs all the dicoms in the test data folder and try to create seqinfo for each one.
It effectively covers the current fix.
As create_seqinfo was not covered at all in unit tests, I caught and fixed another problem with ProtocolName.
@yarikoptic let me know if that's enough testing for that PR.
Thanks!

@bpinsard
Copy link
Contributor Author

rebased, all green! yay!

@yarikoptic
Copy link
Member

Let's proceed and I will submit a follow up PR with some RFs.

@yarikoptic yarikoptic added the patch Increment the patch version when merged label Sep 16, 2024
@yarikoptic yarikoptic merged commit 383525d into nipy:master Sep 16, 2024
11 checks passed
Copy link

github-actions bot commented Oct 2, 2024

🚀 PR was released in v1.3.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enhanced dicoms (XA) and sequence_name in PulseSequenceName dicom tag
2 participants