fMRIprep preprocessing pipeline error

Hello Everyone, I am very new to neuroimaging, right now I am trying to analyse fmri data using fmriprep single subject workflow but when I try to excute init_single_subject_wf I constantly get that there is no layout error as well as NoBOLD images found and task.All workflows require BOLD images. I am anable to find the answer. Can anyone help me?

Have you ran the BIDS-validator on your dataset to see if it is BIDS compliant? fMRIPrep expects data to be organized and named in a very specific way (BIDS Structure) so if data deviates from that organization then it may not find it. Also how are you running fMRIPrep and what is your full command?

Yes I ran the BIDS validator and fmriprep worked just fine when I ran it with the help of container. I took data of only one subject’s functional_bold_.nii.gz file and gave it as an input
from fmriprep.workflows.tests import mock_config
from fmriprep import config
from fmriprep.workflows.base import init_func_preproc_wf
from niworkflows.func.util import init_bold_reference_wf
with mock_config():
bold_file = os.path.join(datapath,‘func/sub-02_task-flanker_run-1_bold.nii.gz’)#config.execution.bids_dir /‘sub-01’/‘func’/‘sub-01_task-flanker_run-1_bold.nii.gz’
wf = init_func_preproc_wf(str(bold_file))

This is my code, Am I doing it wrong?

I was referring to the command you used to call fmriprep. May you provide that please?

Thanks,
Steven

sorry I didn’t use anything like that , I just wrote these codes.

You should follow the instructions on the fMRIprep website. Installation — fmriprep version documentation

FMRIprep should ultimately look like a command line call, not a python script as you have it. The best method for you may depend on your operating system. What operating system are you using?

Actually I have run the fmriprep using docker commands already but I wanted to break down the program and try to program each and every preprocessing step myself, these codes are from fmriprep github page. I am using Macbook

If you want to get your hands dirty on the processing steps, you should look at the individual software packages (like FSL, ANTs etc). Just running the individual fmriprep steps, which is not design to be run line by line, won’t help you understand what is happening very well.

Yeah I think your right. I was unable move further with that approach so I stopped it. Thank you for your suggestions. It was really helpful