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

v1.0.20230411 removes legitimate b=0 volumes in GE DWI scan after flagging them as "ADC or trace images" #777

Closed
psadil opened this issue Jan 17, 2024 · 5 comments

Comments

@psadil
Copy link

psadil commented Jan 17, 2024

Describe the bug

Given a diffusion scan collected on a GE scanner, the newest version of dcm2niix removes legitimate b=0 volumes as "ADC or trace images".

These are the volumes that are removed

2	B=	0	Vec=	0	0	0
35	B=	0	Vec=	0	0	0
49	B=	0	Vec=	0	0	0
69	B=	0	Vec=	0	0	0
89	B=	0	Vec=	0	0	0
103	B=	0	Vec=	0	0	0

To reproduce

❯ mamba create -n v1.0.20230411 dcm2niix=1.0.20230411
❯ mamba activate v1.0.20230411
❯ dcm2niix -o v1.0.20220720 -z n -i y sub-travel2_ses-UM2_dwi

If it'll help, the data can be shared.

FWIW, the software on the scanner that collected these data has recently been upgraded from "28\LX\MR Software release:RX28.0_R04_UHP3T_2111.a" to "30\LX\SIGNA_LX1.MR30.1_R01_2322.c", and new scans do not have volumes flagged and removed. edit: please ignore, the information about an upgrade was a miscommunication.

Expected behavior

A clear and concise description of what you expected to happen.

Output log

v1.0.20220720 (desired behavior)
❯ dcm2niix -o v1.0.20220720 -z n -i y sub-travel2_ses-UM2_dwi     
Chris Rorden's dcm2niiX version v1.0.20220720  Clang13.0.1 ARM (64-bit MacOS)
Found 8424 DICOM file(s)
Warning: GE sequence with 1 echoes. See issue 359
Warning: Unable to compute slice times for GE Diffusion
Warning: Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)
GE BVal scaling (e.g. 3000 -> 2000 s/mm^2)
Convert 8424 DICOM as v1.0.20220720/sub-travel2_ses-UM2_dwi_A2CPS_32ch_HB_63021_20210701084350_4 (140x140x81x104)
Conversion required 5.163926 seconds (1.745019 for core code).

Note, I don't know which volumes are triggering the "Some images had bval>0 but bvec=0" warning. According to the produced bvals/bvecs files, there are no such volumes.

Saving 104 DTI gradients. GE Reorienting A2CPS_32ch_HB_63021 : please validate. isCol=1 sliceDir=3 flp=0 0 1
GE BVal scaling (e.g. 3000 -> 2000 s/mm^2)
0	B=	0	Vec=	0	0	0
1	B=	0	Vec=	0	0	0
2	B=	0	Vec=	0	0	0
3	B=	3000	Vec=	-0.654875	0.355659	0.666817
4	B=	3000	Vec=	-0.271924	0.933965	0.231877
5	B=	2000	Vec=	0.957387	0.187071	-0.220034
6	B=	3000	Vec=	0.11881	0.110437	0.986756
7	B=	1000	Vec=	0.957388	0.18707	-0.220035
8	B=	3000	Vec=	0.326879	0.866547	0.377155
9	B=	3000	Vec=	-0.394817	0.108337	-0.91235
10	B=	2000	Vec=	-0.190618	0.585246	0.788133
11	B=	3000	Vec=	0.906253	0.349334	-0.238058
12	B=	1000	Vec=	-0.190617	0.585244	0.788133
13	B=	3000	Vec=	0.56633	0.470917	-0.676393
14	B=	3000	Vec=	-0.55854	-0.665203	-0.495518
15	B=	500	Vec=	-0.0062266	0.0644461	-0.997903
16	B=	3000	Vec=	0.648904	-0.611989	-0.452098
17	B=	2000	Vec=	-0.325492	-0.844583	-0.425129
18	B=	3000	Vec=	0.435216	0.497941	0.750095
19	B=	3000	Vec=	-0.060085	-0.972644	-0.224396
20	B=	1000	Vec=	0.325492	0.844583	0.425128
21	B=	3000	Vec=	0.290295	0.619397	-0.729435
22	B=	500	Vec=	-0.636679	-0.653134	0.409944
23	B=	3000	Vec=	0.008761	-0.548745	0.835944
24	B=	3000	Vec=	0.098843	-0.63796	-0.7637
25	B=	2000	Vec=	0.0227962	0.67841	-0.734331
26	B=	3000	Vec=	-0.162887	0.917294	-0.363371
27	B=	1000	Vec=	-0.0227955	-0.67841	0.734331
28	B=	3000	Vec=	0.095045	0.821836	-0.56174
29	B=	3000	Vec=	-0.21496	-0.721063	-0.658681
30	B=	2000	Vec=	-0.596977	0.258722	-0.759394
31	B=	3000	Vec=	0.741627	-0.039918	-0.669624
32	B=	1000	Vec=	-0.596977	0.258722	-0.759395
33	B=	3000	Vec=	0.847852	-0.200363	0.49092
34	B=	3000	Vec=	0.943158	0.304222	0.133799
35	B=	0	Vec=	0	0	0
36	B=	3000	Vec=	0.21565	-0.732737	0.645439
37	B=	2000	Vec=	0.41625	0.343103	0.842031
38	B=	3000	Vec=	0.06036	-0.223624	0.972805
39	B=	1000	Vec=	0.41625	0.343104	0.842031
40	B=	3000	Vec=	0.814723	-0.56112	-0.146185
41	B=	3000	Vec=	-0.265965	-0.335097	0.903866
42	B=	500	Vec=	-0.399916	0.82842	-0.392156
43	B=	3000	Vec=	-0.441982	-0.764517	0.469218
44	B=	2000	Vec=	-0.734448	0.292307	0.612489
45	B=	3000	Vec=	0.566124	0.807614	-0.165116
46	B=	3000	Vec=	-0.716591	-0.584614	0.380425
47	B=	1000	Vec=	0.734448	-0.292308	-0.61249
48	B=	3000	Vec=	-0.331272	-0.943028	-0.03094
49	B=	0	Vec=	0	0	0
50	B=	3000	Vec=	-0.465735	0.168038	0.868823
51	B=	3000	Vec=	-0.480716	0.789299	-0.381994
52	B=	2000	Vec=	0.581881	0.362502	-0.728017
53	B=	3000	Vec=	-0.961362	0.253123	0.108216
54	B=	1000	Vec=	0.581881	0.362503	-0.728016
55	B=	3000	Vec=	-0.92036	-0.003999	0.391053
56	B=	3000	Vec=	0.393331	-0.915435	0.08526
57	B=	2000	Vec=	-0.928822	0.354407	-0.108098
58	B=	3000	Vec=	0.852276	-0.324551	-0.410233
59	B=	1000	Vec=	0.928823	-0.354407	0.108097
60	B=	3000	Vec=	-0.571183	0.799445	0.18611
61	B=	3000	Vec=	-0.535413	-0.167226	0.82787
62	B=	500	Vec=	0.789559	-0.38493	-0.47794
63	B=	3000	Vec=	0.442791	0.203222	0.873291
64	B=	2000	Vec=	-0.861661	-0.322777	-0.391609
65	B=	3000	Vec=	0.143848	0.431269	0.890682
66	B=	3000	Vec=	0.89346	-0.41491	0.171983
67	B=	1000	Vec=	-0.861661	-0.322776	-0.391608
68	B=	3000	Vec=	0.795825	0.511407	0.32423
69	B=	0	Vec=	0	0	0
70	B=	3000	Vec=	0.399108	-0.523871	-0.752511
71	B=	2000	Vec=	0.52577	-0.761172	0.379714
72	B=	3000	Vec=	0.806535	0.590581	-0.026762
73	B=	3000	Vec=	0.69138	-0.710203	0.132686
74	B=	1000	Vec=	-0.525769	0.761172	-0.379714
75	B=	3000	Vec=	0.973847	-0.080055	0.212633
76	B=	500	Vec=	-0.88769	-0.101313	-0.449158
77	B=	3000	Vec=	0.052107	-0.996034	0.072118
78	B=	3000	Vec=	0.696694	0.03436	0.716545
79	B=	2000	Vec=	-0.0342733	-0.991162	0.128152
80	B=	3000	Vec=	0.626272	-0.2862	0.725171
81	B=	1000	Vec=	-0.0342738	-0.991163	0.128153
82	B=	3000	Vec=	0.994108	0.072683	-0.080414
83	B=	3000	Vec=	0.738939	-0.519516	0.429037
84	B=	2000	Vec=	-0.0845074	-0.0561693	0.994838
85	B=	3000	Vec=	0.702182	0.353175	0.61823
86	B=	1000	Vec=	-0.0845085	-0.0561687	0.994838
87	B=	3000	Vec=	-0.505053	0.581614	-0.637689
88	B=	3000	Vec=	-0.37123	0.77018	0.518664
89	B=	0	Vec=	0	0	0
90	B=	3000	Vec=	0.05087	-0.85837	-0.510502
91	B=	2000	Vec=	-0.630413	-0.756662	0.173326
92	B=	3000	Vec=	0.170569	-0.325484	-0.930036
93	B=	3000	Vec=	0.31216	-0.422488	0.850917
94	B=	1000	Vec=	-0.630413	-0.756662	0.173326
95	B=	3000	Vec=	-0.887018	-0.152189	-0.435932
96	B=	500	Vec=	0.152552	0.851205	0.502175
97	B=	3000	Vec=	0.605767	0.776332	0.174228
98	B=	3000	Vec=	-0.215791	-0.937112	0.274326
99	B=	2000	Vec=	-0.491239	0.826626	0.274542
100	B=	3000	Vec=	0.210754	0.013433	-0.977447
101	B=	1000	Vec=	0.491239	-0.826626	-0.274542
102	B=	3000	Vec=	0.787853	0.274495	-0.551307
103	B=	0	Vec=	0	0	0
v1.0.20230411 (unexpected behavior)
❯ dcm2niix -o v1.0.20230411 -z o -i y sub-travel2_ses-UM2_dwi
Chris Rorden's dcm2niiX version v1.0.20230411  Clang15.0.7 ARM (64-bit MacOS)
Found 8424 DICOM file(s)
Warning: GE sequence with 1 echoes. See issue 359
Warning: Unable to compute slice times for GE Diffusion:Cycling
Warning: Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)
Note: 6 volumes appear to be ADC or trace images that will be removed to allow processing
DTI volumes re-ordered by ascending b-value
GE BVal scaling (e.g. 3000 -> 2000 s/mm^2)
Convert 8424 DICOM as v1.0.20230411/sub-travel2_ses-UM2_dwi_A2CPS_32ch_HB_63021_20210701084350_4 (140x140x81x104)
Ignoring derived diffusion image(s). Better isotropic and ADC maps can be generated later processing.
Conversion required 4.110889 seconds (2.303293 for core code).
Saving 98 DTI gradients. GE Reorienting A2CPS_32ch_HB_63021 : please validate. isCol=1 sliceDir=3 flp=0 0 1
GE BVal scaling (e.g. 3000 -> 2000 s/mm^2)
0	B=	0	Vec=	0	0	0
1	B=	0	Vec=	0	0	0
2	B=	3000	Vec=	-0.654875	0.355659	0.666817
3	B=	3000	Vec=	-0.271924	0.933965	0.231877
4	B=	2000	Vec=	0.957387	0.187071	-0.220034
5	B=	3000	Vec=	0.11881	0.110437	0.986756
6	B=	1000	Vec=	0.957388	0.18707	-0.220035
7	B=	3000	Vec=	0.326879	0.866547	0.377155
8	B=	3000	Vec=	-0.394817	0.108337	-0.91235
9	B=	2000	Vec=	-0.190618	0.585246	0.788133
10	B=	3000	Vec=	0.906253	0.349334	-0.238058
11	B=	1000	Vec=	-0.190617	0.585244	0.788133
12	B=	3000	Vec=	0.56633	0.470917	-0.676393
13	B=	3000	Vec=	-0.55854	-0.665203	-0.495518
14	B=	500	Vec=	-0.0062266	0.0644461	-0.997903
15	B=	3000	Vec=	0.648904	-0.611989	-0.452098
16	B=	2000	Vec=	-0.325492	-0.844583	-0.425129
17	B=	3000	Vec=	0.435216	0.497941	0.750095
18	B=	3000	Vec=	-0.060085	-0.972644	-0.224396
19	B=	1000	Vec=	0.325492	0.844583	0.425128
20	B=	3000	Vec=	0.290295	0.619397	-0.729435
21	B=	500	Vec=	-0.636679	-0.653134	0.409944
22	B=	3000	Vec=	0.008761	-0.548745	0.835944
23	B=	3000	Vec=	0.098843	-0.63796	-0.7637
24	B=	2000	Vec=	0.0227962	0.67841	-0.734331
25	B=	3000	Vec=	-0.162887	0.917294	-0.363371
26	B=	1000	Vec=	-0.0227955	-0.67841	0.734331
27	B=	3000	Vec=	0.095045	0.821836	-0.56174
28	B=	3000	Vec=	-0.21496	-0.721063	-0.658681
29	B=	2000	Vec=	-0.596977	0.258722	-0.759394
30	B=	3000	Vec=	0.741627	-0.039918	-0.669624
31	B=	1000	Vec=	-0.596977	0.258722	-0.759395
32	B=	3000	Vec=	0.847852	-0.200363	0.49092
33	B=	3000	Vec=	0.943158	0.304222	0.133799
34	B=	3000	Vec=	0.21565	-0.732737	0.645439
35	B=	2000	Vec=	0.41625	0.343103	0.842031
36	B=	3000	Vec=	0.06036	-0.223624	0.972805
37	B=	1000	Vec=	0.41625	0.343104	0.842031
38	B=	3000	Vec=	0.814723	-0.56112	-0.146185
39	B=	3000	Vec=	-0.265965	-0.335097	0.903866
40	B=	500	Vec=	-0.399916	0.82842	-0.392156
41	B=	3000	Vec=	-0.441982	-0.764517	0.469218
42	B=	2000	Vec=	-0.734448	0.292307	0.612489
43	B=	3000	Vec=	0.566124	0.807614	-0.165116
44	B=	3000	Vec=	-0.716591	-0.584614	0.380425
45	B=	1000	Vec=	0.734448	-0.292308	-0.61249
46	B=	3000	Vec=	-0.331272	-0.943028	-0.03094
47	B=	3000	Vec=	-0.465735	0.168038	0.868823
48	B=	3000	Vec=	-0.480716	0.789299	-0.381994
49	B=	2000	Vec=	0.581881	0.362502	-0.728017
50	B=	3000	Vec=	-0.961362	0.253123	0.108216
51	B=	1000	Vec=	0.581881	0.362503	-0.728016
52	B=	3000	Vec=	-0.92036	-0.003999	0.391053
53	B=	3000	Vec=	0.393331	-0.915435	0.08526
54	B=	2000	Vec=	-0.928822	0.354407	-0.108098
55	B=	3000	Vec=	0.852276	-0.324551	-0.410233
56	B=	1000	Vec=	0.928823	-0.354407	0.108097
57	B=	3000	Vec=	-0.571183	0.799445	0.18611
58	B=	3000	Vec=	-0.535413	-0.167226	0.82787
59	B=	500	Vec=	0.789559	-0.38493	-0.47794
60	B=	3000	Vec=	0.442791	0.203222	0.873291
61	B=	2000	Vec=	-0.861661	-0.322777	-0.391609
62	B=	3000	Vec=	0.143848	0.431269	0.890682
63	B=	3000	Vec=	0.89346	-0.41491	0.171983
64	B=	1000	Vec=	-0.861661	-0.322776	-0.391608
65	B=	3000	Vec=	0.795825	0.511407	0.32423
66	B=	3000	Vec=	0.399108	-0.523871	-0.752511
67	B=	2000	Vec=	0.52577	-0.761172	0.379714
68	B=	3000	Vec=	0.806535	0.590581	-0.026762
69	B=	3000	Vec=	0.69138	-0.710203	0.132686
70	B=	1000	Vec=	-0.525769	0.761172	-0.379714
71	B=	3000	Vec=	0.973847	-0.080055	0.212633
72	B=	500	Vec=	-0.88769	-0.101313	-0.449158
73	B=	3000	Vec=	0.052107	-0.996034	0.072118
74	B=	3000	Vec=	0.696694	0.03436	0.716545
75	B=	2000	Vec=	-0.0342733	-0.991162	0.128152
76	B=	3000	Vec=	0.626272	-0.2862	0.725171
77	B=	1000	Vec=	-0.0342738	-0.991163	0.128153
78	B=	3000	Vec=	0.994108	0.072683	-0.080414
79	B=	3000	Vec=	0.738939	-0.519516	0.429037
80	B=	2000	Vec=	-0.0845074	-0.0561693	0.994838
81	B=	3000	Vec=	0.702182	0.353175	0.61823
82	B=	1000	Vec=	-0.0845085	-0.0561687	0.994838
83	B=	3000	Vec=	-0.505053	0.581614	-0.637689
84	B=	3000	Vec=	-0.37123	0.77018	0.518664
85	B=	3000	Vec=	0.05087	-0.85837	-0.510502
86	B=	2000	Vec=	-0.630413	-0.756662	0.173326
87	B=	3000	Vec=	0.170569	-0.325484	-0.930036
88	B=	3000	Vec=	0.31216	-0.422488	0.850917
89	B=	1000	Vec=	-0.630413	-0.756662	0.173326
90	B=	3000	Vec=	-0.887018	-0.152189	-0.435932
91	B=	500	Vec=	0.152552	0.851205	0.502175
92	B=	3000	Vec=	0.605767	0.776332	0.174228
93	B=	3000	Vec=	-0.215791	-0.937112	0.274326
94	B=	2000	Vec=	-0.491239	0.826626	0.274542
95	B=	3000	Vec=	0.210754	0.013433	-0.977447
96	B=	1000	Vec=	0.491239	-0.826626	-0.274542
97	B=	3000	Vec=	0.787853	0.274495	-0.551307

Version

Please report the complete version string:

❯ dcm2niix --version
Chris Rorden's dcm2niiX version v1.0.20230411  Clang15.0.7 ARM (64-bit MacOS)
v1.0.20230411

Troubleshooting

Please try the following steps to resolve your issue:

  • Is this the latest stable release? Yes. If not, does the latest stable release resolve your issue? No
  • If the latest stable version fails, and you are using Windows. Does the latest commit on the development branch resolve your issue? NA
  • If the latest stable version fails, and you are using macOS or Linux. Does the latest commit on the development branch resolve your issue? No. Given GE Diffusion bvec greater than 1 for single-axis, low-shell #769, I tried conversion with 1485cc5, but no luck. I think that might be expected, since that issue involved non-zero bvecs.
@neurolabusc
Copy link
Collaborator

Please share a sample with my institutional email.

mr-jaemin added a commit to mr-jaemin/dcm2niix that referenced this issue Jan 18, 2024
mr-jaemin added a commit to mr-jaemin/dcm2niix that referenced this issue Jan 18, 2024
@mr-jaemin
Copy link
Collaborator

This issue was associated with code change with issue #690, trying to detect GE non-DTI based on Vas collapse flag (0043,1030).

For GE DTI, Vas collapse flag (image-level) could be either 14 (T2, i.e. initial b=0 images) or 16 (DTI). The existing code missed the case of 14. Alternately, Diffusion direction (0021,105a) (series-level) could be useful.

Additionally, the issue was associated with old multi-shell data (prior to 29.1) where b=0 images (as a part of diffusion tensor file) was incorrectly labeled in DICOM (bval > 0, bvec = all 0). As noted above, MR30.1 data doesn't cause this issue.

The PR also address (or remove) the following warning:

  • Warning: GE sequence with 1 echoes. See issue 359
  • Warning: Some images had bval>0 but bvec=0 (either Trace or b=0, see issue 245)

For #359, I limited the warning with GE non-diffusion (i.e fMRI) only
For #245, I removed this warning because b=0 images will be handled by geCorrectBvecs().

@psadil Once the PR is merged by @neurolabusc, please test your data and close the issue if it works.

@psadil
Copy link
Author

psadil commented Jan 22, 2024

@mr-jaemin , thanks for the fix! 2a515f5 seems like it'll work for our data. Looking forward to the pull request making it into a dcm2niix release.

@mr-jaemin
Copy link
Collaborator

The dev. version v1.0.20240117 would address the issue. @psadil please try the dev version and close this if resolved.

@psadil
Copy link
Author

psadil commented Jan 22, 2024

Looks good, thank you

@psadil psadil closed this as completed Jan 22, 2024
yarikoptic added a commit to neurodebian/dcm2niix that referenced this issue Apr 29, 2024
* tag 'v1.0.20240202': (135 commits)
  Update submodules
  Refactor (rordenlab#791)
  gantry tilt tolerance (rordenlab#791)
  GE step description (rordenlab#790)
  PatientOrient -> Patient Position (rordenlab#786)
  Prevent shell expansion (rordenlab#789)
  Replace presumably accidental bitwise AND operations
  Update JasPer API calls for compatibility with newer versions of the library
  Update divest logic, reducing duplication and supporting new mode of operation
  Fix PhaseEncodingDirectionDisplayed for GE
  Update date
  GE Diffusion issue rordenlab#777 minor
  GE Diffusion issue rordenlab#777
  Kludge for issue 775 (rordenlab#775)
  add docstrings
  better python wrapper I/O
  issue 769: Mildly relax the check for bvec components > 1.
  PRs (rordenlab#745; rordenlab#768)
  Edge cases (rordenlab#763, rordenlab#749)
  Code spell
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants