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

Failure to Inherit Unbiased Template #376

Open
JS650 opened this issue Jun 24, 2024 · 0 comments
Open

Failure to Inherit Unbiased Template #376

JS650 opened this issue Jun 24, 2024 · 0 comments

Comments

@JS650
Copy link

JS650 commented Jun 24, 2024

Describe the bug
When running the preprocessing stage of the RABIES pipeline, inheriting an unbiased template (using the --inherit_unbiased_template flag) fails if the run used to generate the template did not include a mask file (i.e., --commonspace_reg masking=false,brain_extraction=false,template_registration=SyN,fast_commonspace=false).

Describe RABIES call
RABIES command:

singularity run \\
--bind $RABIES_DIR/input \\
--bind $RABIES_DIR/preproc5_1 \\
--bind $RABIES_DIR/preproc_unbiastemp_1 \\
$RABIES_DIR/rabies.sif --exclusion_ids $RABIES_DIR/preproc5_1/scans_to_exclude.txt -p MultiProc --local_threads 8 preprocess $RABIES_DIR/input $RABIES_DIR/preproc5_1 --bids_filter $RABIES_DIR/preproc5_1/BIDS_FILTER.json --commonspace_resampling 0.2x0.2x0.2 --inherit_unbiased_template $RABIES_DIR/preproc_unbiastemp_1 --bold2anat_coreg masking=true,brain_extraction=false,registration=SyN

Attach log file
rabies_preprocess.log

Attach QC_report
No QC_report is generated. Bug occurs during the setup stage of preprocessing.

Additional context
The specific error encountered is as follows (note this is not printed to the log file):

Traceback (most recent call last):
  File "/opt/conda/bin/rabies", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/home/mambauser/RABIES/scripts/rabies", line 3, in <module>
    execute_workflow()
  File "/home/mambauser/RABIES/rabies/run_main.py", line 51, in execute_workflow
    workflow = preprocess(opts, log)
  File "/home/mambauser/RABIES/rabies/run_main.py", line 243, in preprocess
    workflow = init_main_wf(opts.bids_dir, opts.output_dir, opts)
  File "/home/mambauser/RABIES/rabies/preprocess_pkg/main_wf.py", line 235, in init_main_wf
    opts, inherit_dict = inherit_unbiased_files(opts.inherit_unbiased_template, opts)
  File "/home/mambauser/RABIES/rabies/preprocess_pkg/commonspace_reg.py", line 785, in inherit_unbiased_files
    if not os.path.isfile(inherit_dict[key]):
  File "/opt/conda/lib/python3.9/genericpath.py", line 30, in isfile
    st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not _Undefined
``

The problem is that using an inherited unbiased template relies on there being an associated mask file generated. If this isn't specified (using --commonspace_reg masking=*true*...), there will be no path for the mask variable and this error will arise. 
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

1 participant