Closed jcohenadad closed 4 months ago
Weirdly, the output CSV, only for the DWI files, did not include a header:
When re-running the command, fresh, the header is here:
Re-running, on another subject, the header is kept intact:
So, at some point, for some reasons, the header is removed 🤔
For LD-214
sct_extract_metric
did not complete:
Spinal Cord Toolbox (git-jca/4527-register-template-step0-517cc66596db50a310ddc0bdf8985fbbe54405a4*)
sct_extract_metric -i sub-LD214_chunk-1_DWI_moco_FA.nii.gz -f label_sub-LD214_chunk-1_DWI_moco/atlas -l 32,33 -combine 1 -vert 2:12 -vertfile label_sub-LD214_chunk-1_DWI_moco/template/PAM50_levels.nii.gz -perlevel 1 -method map -o /home/GRAMES.POLYMTL.CA/p101317/lydia/results_20240702_140359/results/DWI_FA_32-33.csv -append 1
--
Load metric image...
Estimation for label: 32,33
Traceback (most recent call last):
File "/home/GRAMES.POLYMTL.CA/p101317/code/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_extract_metric.py", line 400, in <module>
main(sys.argv[1:])
File "/home/GRAMES.POLYMTL.CA/p101317/code/spinalcordtoolbox/spinalcordtoolbox/scripts/sct_extract_metric.py", line 393, in main
save_as_csv(agg_metric, fname_output, fname_in=fname_data, append=append_csv)
File "/home/GRAMES.POLYMTL.CA/p101317/code/spinalcordtoolbox/spinalcordtoolbox/aggregate_slicewise.py", line 570, in save_as_csv
agg_metric_key = [v for i, (k, v) in enumerate(agg_metric.items())][0]
IndexError: list index out of range
Is this the cause of the issue?
Even more weirdly, when re-running the exact same command on the same data, it completes:
(base) p101317@joplin:~/lydia/results_20240702_140359/data_processed/sub-LD214/dwi$ sct_extract_metric -i sub-LD214_chunk-1_DWI_moco_FA.nii.gz -f label_sub-LD214_chunk-1_DWI_moco/atlas -l 32,33 -combine 1 -vert 2:12 -vertfile label_sub-LD214_chunk-1_DWI_moco/template/PAM50_levels.nii.gz -perlevel 1 -method map -o /home/GRAMES.POLYMTL.CA/p101317/lydia/results_20240702_140359/results/DWI_FA_32-33.csv -append 1
--
Spinal Cord Toolbox (git-jca/4527-register-template-step0-517cc66596db50a310ddc0bdf8985fbbe54405a4*)
sct_extract_metric -i sub-LD214_chunk-1_DWI_moco_FA.nii.gz -f label_sub-LD214_chunk-1_DWI_moco/atlas -l 32,33 -combine 1 -vert 2:12 -vertfile label_sub-LD214_chunk-1_DWI_moco/template/PAM50_levels.nii.gz -perlevel 1 -method map -o /home/GRAMES.POLYMTL.CA/p101317/lydia/results_20240702_140359/results/DWI_FA_32-33.csv -append 1
--
Load metric image...
Estimation for label: 32,33
Done! To view results, type:
xdg-open /home/GRAMES.POLYMTL.CA/p101317/lydia/results_20240702_140359/results/DWI_FA_32-33.csv
Note that vertebral labeling is completely off for this subject, so hopefully the issue is related to that:
I'll re-run the whole pipeline, only on subjects with correct vertebral labeling.
Re-running without this subject, the pipeline completed without error. We can close then.
Version: e3cc60adec6aff45e8f9b716aaa58fd8860effbd