Template_spec AttributeError

fmriprep
#1

Hello,
I’m new to data analysis through fmriprep and am trying to get it running after validating my BIDS directory using the BIDS validator website.

when running the following command:

fmriprep /Users/glhrsqwbyz/Desktop/Projects/fMRI_Cortical_Layers/BIDS_Pilot2 /Users/glhrsqwbyz/Desktop/Projects/fMRI_Cortical_Layers/BIDS_Pilot participant --fs-license-file /Applications/freesurfer/license.txt

I receive the following error:

Process Process-2:
Traceback (most recent call last):
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/site-packages/fmriprep/cli/run.py", line 608, in build_workflow
    work_dir=str(work_dir),
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 258, in init_fmriprep_wf
    use_syn=use_syn,
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 549, in init_single_subject_wf
    skull_strip_template=skull_strip_template,
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/site-packages/smriprep/workflows/anatomical.py", line 230, in init_anat_preproc_wf
    normalization_quality='precise' if not debug else 'testing')
  File "/Users/glhrsqwbyz/miniconda3/lib/python3.7/site-packages/niworkflows/anat/ants.py", line 180, in init_brain_extraction_wf
    template_spec['suffix'] = template_spec.get('suffix', bids_suffix)
AttributeError: 'str' object has no attribute 'get'

Tried to follow the process of creating the template_spec variable, but did get any insights regarding the problem.

would love it if anyone could help.

thanks!

#2

Can you update both fmriprep and templateflow and try again?

python -m pip install -U "fmriprep==1.4.1rc4" templateflow
1 Like
#3

Thank you! it worked, although it raises a new issue now:

Cannot run fMRIPrep. Missing dependencies:
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)
c3d_affine_tool (Interface: C3dAffineTool)

#4

That means you need to install the C3D conversion tool. What kind of system you are using?

#5

Thank you for the quick response.
I’m using Mac.

#6

I’m guessing this should do -> https://sourceforge.net/projects/c3d/files/c3d/1.0.0/

However, I believe the best option to avoid installation issues is using Docker.

2 Likes
#7

Well’ gave it a try. downloaded both the c3d file and tried setting the docker environment - both unsuccessful.
The “c3d_affine_tool (Interface: C3dAffineTool)” error still appears.
and as for the fmriprep-docker, a “command not found” error comes up (even though I followed the Docker installation instruction)…

#8

When you install fmriprep-docker, you need to be sure that it’s in your path. An alternative is:

python -m fmriprep_docker <args>

This will use Python to find the module and run it. Note the underscore here, as opposed to a hyphen.

1 Like
#9

That works!
Thank you