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

🐛 The listed resource is not in the resource pool: diffphase_dwell #1686

Open
1 task
shnizzedy opened this issue Feb 18, 2022 · 3 comments · Fixed by #1746
Open
1 task

🐛 The listed resource is not in the resource pool: diffphase_dwell #1686

shnizzedy opened this issue Feb 18, 2022 · 3 comments · Fixed by #1746
Labels

Comments

@shnizzedy
Copy link
Member

Describe the bug

With a BIDS directory or data configuration structured like

- anat:
    T1w:
    T2w:
  creds_path:
  fmap:
    diffmag:
  func:
  site_id:
  subject_id:
  unique_id

i.e., with fmap.diffmag but no fmap.diffphase,

keywords = ['diffphase', 'diffmag']
if key in keywords:
diff = True
if orig_key == "epi_AP" or orig_key == "epi_PA":
blip = True
if diff:
calc_delta_ratio = pe.Node(Function(
input_names=['dwell_time',
'echo_time_one',
'echo_time_two',
'echo_time_three'],
output_names=['deltaTE',
'dwell_asym_ratio'],
function=calc_deltaTE_and_asym_ratio),
name='diff_distcor_calc_delta')
node, out_file = rpool.get('diffphase_dwell')[
"['diffphase_dwell:fmap_dwell_ingress']"]['data'] # <--- there will only be one pipe_idx
will raise an execption like

Traceback (most recent call last):
  File "/code/run.py", line 762, in <module>
    run_main()
  File "/code/run.py", line 743, in run_main
    test_config=(1 if args.analysis_level == "test_config" else 0)
  File "/code/CPAC/pipeline/cpac_runner.py", line 565, in run
    raise e
  File "/code/CPAC/pipeline/cpac_runner.py", line 562, in run
    p_name, plugin, plugin_args, test_config)
  File "/code/CPAC/pipeline/cpac_pipeline.py", line 424, in run_workflow
    subject_id, sub_dict, c, p_name, num_ants_cores
  File "/code/CPAC/pipeline/cpac_pipeline.py", line 1090, in build_workflow
    wf, rpool = initiate_rpool(wf, cfg, sub_dict)
  File "/code/CPAC/pipeline/engine.py", line 1904, in initiate_rpool
    part_id, ses_id)
  File "/code/CPAC/pipeline/engine.py", line 1495, in ingress_raw_func_data
    data_paths['creds_path'], ses_id)
  File "/code/CPAC/utils/datasource.py", line 451, in ingress_func_metadata
    node, out_file = rpool.get('diffphase_dwell')[
  File "/code/CPAC/pipeline/engine.py", line 254, in get
    raise LookupError(lookup_message)
LookupError: 

[!] C-PAC says: The listed resource is not in the resource pool:
diffphase_dwell

Developer Note: This may be due to a mismatch between the node block's docstring 'input' field and a strat_pool.get_data() call within the block function.
(keys in resource pool are dict_keys(['T1w', 'T2w', 'subject', 'bold', 'scan', 'scan_params', 'diffmag', 'diffmag_scan_params', 'diffmag_TE', 'diffmag_dwell', 'diffmag_pedir']))

To reproduce

Try to run a pipeline with fmap.diffmag but no fmap.diffphase

Expected behavior

[!] C-PAC says: The listed resource is not in the resource pool:
diffphase_dwell

is only raised if diffphase is needed for the pipeline

Acceptance criteria

  • [!] C-PAC says: The listed resource is not in the resource pool: diffphase_dwell is only raised if diffphase is needed for the pipeline

Screenshots

No response

C-PAC version

v1.8.3 & v1.8.2

Container platform

Docker

Docker and/or Singularity version(s)

Docker version 18.06.1-ce, build e68fc7a

Additional context

This issue was discovered with an anatomical-only run on a BIDS directory

@shnizzedy shnizzedy changed the title 🐛 [User-reported Bug] 🐛 The listed resource is not in the resource pool: diffphase_dwell Feb 18, 2022
@diegoaper
Copy link
Contributor

Hello! I tried to run only T1w and BOLD images but the BIDS directory also has an fmap sub-directory. I got this same error, I believe its when running CPAC with no data config file it'll extract all the information including the fmap folder. If there was a flag to only pull information from the anat and func folders I think it would solve the issue when creating the data config file.

@diegoaper
Copy link
Contributor

Work-around: Create the data config file and remove all the sections of fmap that are not desired. Then remove the sequence parameters of func to allow the preprocessing of only anat and func even when there are other images in the same directory.

@shnizzedy
Copy link
Member Author

Example fmap tree:

fmap/
├── sub-NDARAA075AMK_ses-HBNsiteSI_magnitude1.json
├── sub-NDARAA075AMK_ses-HBNsiteSI_magnitude1.nii.gz
├── sub-NDARAA075AMK_ses-HBNsiteSI_magnitude2.json
├── sub-NDARAA075AMK_ses-HBNsiteSI_magnitude2.nii.gz
├── sub-NDARAA075AMK_ses-HBNsiteSI_phasediff.json
└── sub-NDARAA075AMK_ses-HBNsiteSI_phasediff.nii.gz

@shnizzedy shnizzedy linked a pull request Jun 14, 2022 that will close this issue
9 tasks
@shnizzedy shnizzedy added the RBC https://github.com/PennLINC/RBC label Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants