Skip to content

How to use on a functional scan where "run" isn't specified #4

@sheyn-uw

Description

@sheyn-uw

This code seems super helpful - appreciate your work in it! Trying to run it on a task of mine that doesnt have a run specified in the naming conventions (there is only one)

When I run the script, I get

Traceback (most recent call last):
  File "denoise_fmriprep_output.py", line 235, in <module>
    curfunc.split('run-')[1].split('_')[0]  + '*' + '*space-MNI152NLin2009cAsym*brain*mask.nii*')[0]
IndexError: list index out of range

Presumably because there is no "run-" flags. When i tried to move through the script and edit/comment out any mentions of run, it still crashes, with an error I can't quite parse through.

Traceback (most recent call last):
  File "denoise_fmriprep_output.py", line 312, in <module>
    wmts = NiftiLabelsMasker(labels_img=tmpAROMAwm , detrend=False, standardize=False).fit_transform(tmpAROMA)
  File "/Volumes/conda/sheyn/envs/fmriprep_denoising/lib/python3.6/site-packages/nilearn/input_data/nifti_labels_masker.py", line 226, in fit_transform
    return self.fit().transform(imgs, confounds=confounds)
  File "/Volumes/conda/sheyn/envs/fmriprep_denoising/lib/python3.6/site-packages/nilearn/input_data/nifti_labels_masker.py", line 176, in fit
    self.labels_img_ = _utils.check_niimg_3d(self.labels_img)
  File "/Volumes/conda/sheyn/envs/fmriprep_denoising/lib/python3.6/site-packages/nilearn/_utils/niimg_conversions.py", line 316, in check_niimg_3d
    return check_niimg(niimg, ensure_ndim=3, dtype=dtype)
  File "/Volumes/conda/sheyn/envs/fmriprep_denoising/lib/python3.6/site-packages/nilearn/_utils/niimg_conversions.py", line 251, in check_niimg
    raise ValueError("File not found: '%s'" % niimg)
ValueError: File not found: './tmpdir/sub-1018_se/tmpAROMA_task-vext_wm.nii.gz'

Any easy thoughts/ideas? Or should I go through all my subjects and add the run flag into all the names/outputs

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions