DCAN-Labs / abcd-hcp-pipeline

bids application for processing functional MRI data, robust to scanner, acquisition and age variability.
https://hub.docker.com/r/dcanumn/abcd-hcp-pipeline
BSD 3-Clause "New" or "Revised" License
50 stars 19 forks source link

Error in executive summary #52

Closed richardbeare closed 2 years ago

richardbeare commented 2 years ago

Hi, I have the following error:

logs/ExecutiveSummary/ExecutiveSummary.err


Traceback (most recent call last):
  File "/opt/dcan-tools/executivesummary/summary_tools/layout_builder.py", line 1519, in <module>
    main()
  File "/opt/dcan-tools/executivesummary/summary_tools/layout_builder.py", line 1454, in main
    series_panel = write_series_panel_row(series_rows[:6])
  File "/opt/dcan-tools/executivesummary/summary_tools/layout_builder.py", line 728, in write_series_panel_row
    'nonlin_norm'  : list_of_img_paths[5]}
IndexError: list index out of range
An ERROR occurred in line 355 of file /opt/dcan-tools/executivesummary/summary_tools/executivesummary_wrapper.sh.

Tail of the .out:

./img/DVARS_and_FD_task-rest01.png
Making series panel for task-rest01
./img/DVARS_and_FD_task-enback101.png
Writing series panel but series type is unknown; program exiting...
./img/postreg_DVARS_and_FD_task-enback101.png
Writing series panel but series type is unknown; program exiting...
./img/rpb21jdr00011_task-enback101_in_t1.gif
Writing series panel but series type is unknown; program exiting...
./img/rpb21jdr00011_t1_in_task-enback101.gif
Writing series panel but series type is unknown; program exiting...
./img/task-enback101_sbref.png
Writing series panel but series type is unknown; program exiting...
Making series panel for Unknown
madisoth commented 2 years ago

Hi,

From those errors my best guess is that your error is related to this issue: https://github.com/DCAN-Labs/dcan_bold_processing/issues/5

The main issue is that the pipeline needs the run index suffix in filenames to have exactly two digits, (e.g. "task-rest01" or BIDS-style "task-rest_run-01", but not "task-enback101")

It should be addressed by https://github.com/DCAN-Labs/abcd-hcp-pipeline/pull/39, and there should be a new release of the pipeline with those changes within a few weeks.

If you're running via Docker/Singularity and want to try it sooner, I also have a build of that PR here: https://hub.docker.com/repository/docker/madisoth/abcd-hcp-pipeline (tag 10222021a)

That build uses the same version of DCAN-HCP (i.e. the pipeline code forked from HCP) as all previous release versions of abcd-hcp-pipeline, so there should be no differences in the image processing itself.

However, with the new build, output file and directory names won't be 100% consistent with output from older abcd-hcp-pipeline versions. So the safest option is to move/delete any old output and then rerun the pipeline from the start.

The other, time-saving option is to rerun from the FMRIVolume stage (--stage FMRIVolume), which should work if you delete just the files generated between FMRIVolume and ExecutiveSummary stages:

That should leave just T1w, T2w, and MNINonLinear (minus the Results subdir) under files/ which should avoid problems from leftover files from any previous pipeline run.

Let me know if that helps!

richardbeare commented 2 years ago

Hi, I've been doing further testing and continue to run into problems. I tweaked the bids configuration so that files are named:

sub-rpb21jdr00005_ses-01_task-enbacka_bold.json
sub-rpb21jdr00005_ses-01_task-enbacka_bold.nii.gz
sub-rpb21jdr00005_ses-01_task-enbackb_bold.json
sub-rpb21jdr00005_ses-01_task-enbackb_bold.nii.gz
sub-rpb21jdr00005_ses-01_task-rest_bold.json
sub-rpb21jdr00005_ses-01_task-rest_bold.nii.gz

so no numbers in the end of the task name.

Tail of the .out is:

Assembling series images to build panel...

task-rest01 image expected and not found in summary directory

./img/DVARS_and_FD_task-rest01.png
Making series panel for task-rest01
./img/DVARS_and_FD_task-enbacka01.png
Writing series panel but series type is unknown; program exiting...
./img/postreg_DVARS_and_FD_task-enbacka01.png
Writing series panel but series type is unknown; program exiting...
./img/rpb21jdr00005_task-enbacka01_in_t1.gif
Writing series panel but series type is unknown; program exiting...
./img/rpb21jdr00005_t1_in_task-enbacka01.gif
Writing series panel but series type is unknown; program exiting...
./img/task-enbacka01_sbref.png
Writing series panel but series type is unknown; program exiting...
Making series panel for Unknown

I haven't checked yet whether enback is hard coded somewhere. I haven't tested with the new versions mentioned above. This was a clean run after rerunning bids conversion to create new names.

Also note - I don't have any data derived from the eprime files available yet. Is that required?

ericfeczko commented 2 years ago

Hey Richard!

When you named the tasks "enbacka" and "enbackb" the BIDS app recognized those as different tasks as opposed to the same task but different sessions.

As @madisoth mentioned above, I think filename needs exactly two digits in order to run properly. So I think you should rename them to this:

sub-rpb21jdr00005_ses-01_task-enback_run-01_bold.json
sub-rpb21jdr00005_ses-01_task-enback_run-01_bold.nii.gz
sub-rpb21jdr00005_ses-01_task-enback_run-02_bold.json
sub-rpb21jdr00005_ses-01_task-enback_run-02_bold.nii.gz
sub-rpb21jdr00005_ses-01_task-rest_run-01_bold.json
sub-rpb21jdr00005_ses-01_task-rest_run-01_bold.nii.gz

Also, to answer your question, the ABCD-BIDS pipeline does not use the event files for anything, so you should be fine without them :)

Hope this helps!

richardbeare commented 2 years ago

Thanks - a couple of updates.

First - running as above with this container https://hub.docker.com/repository/docker/madisoth/abcd-hcp-pipeline (tag 10222021a) does work.

Second, the resting state seems to pass in the form above? And it has no digits, with the pipeline introducing its own. Is there a reason why the non resting state bold needs to be constructed of separate runs? What if there are different tasks? Am I thinking about this the right way? At this stage I don't have a problem with them being recognised as different tasks.

arueter1 commented 2 years ago

@ericfeczko @madisoth do you have any answers for @richardbeare's question above?

madisoth commented 2 years ago

Second, the resting state seems to pass in the form above? And it has no digits, with the pipeline introducing its own. Is there a reason why the non resting state bold needs to be constructed of separate runs? What if there are different tasks? Am I thinking about this the right way? At this stage I don't have a problem with them being recognised as different tasks.

In the 10222021a build and v0.1.0 release, the pipeline should no longer add those digits (please correct if I'm mistaken).

I believe in the past, it was done at least in part to accommodate the dcan_bold_processing "two-digit ending" assumption mentioned above ([https://github.com/DCAN-Labs/dcan_bold_processing/issues/5]()), and how it names the per-task concatenated timeseries output by stripping the run numbering from the input.

That said, with the current version any of the below should work for your BIDS input:

multiple tasks, 1 run each "task-enback1", "task-enback2" "task-enback1_run-01", "task-enback2_run-01" "task-enbackA", "task-enbackB" "task-enbackA_run-01", "task-enbackB_run-01"

1 task with multiple runs "task-enback_run-01", "task-enback_run-02"

arueter1 commented 2 years ago

@richardbeare I am goin to close this item as I think it is resolved, but please do feel free to reopen it if our responses aren't sufficient. Thank you!