Skip to content

IndexError: index 240 is out of bounds for axis 0 with size 240 #37

Description

@weberam2

Hi!
Just wondering what I'm doing wrong here.

I run:
run_denoise.py sub-01_ses-01_task-rest_space-MNI152NLin2009cAsym_desc-preproc_bold.nii.gz sub-01_ses-01_task-rest_desc-confounds_timeseries.tsv denoise --col_names a_comp_cor_00 a_comp_cor_01 a_comp_cor_02 a_comp_cor_03 a_comp_cor_04 a_comp_cor_05 framewise_displacement trans_x trans_y trans_z rot_x rot_y rot_z

I get this output:

/home/weberam2/.local/lib/python3.8/site-packages/nilearn/glm/init.py:55: FutureWarning: The nilearn.glm module is experimental. It may change in any future release of Nilearn.
warn('The nilearn.glm module is experimental. '
'# of TRs: 240'
Filling in 1 NaN value for framewise_displacement
'# of Confound Regressors: 13 [SELECTED regressors in CSV]'
No High-pass Filter Applied
Saving output file...
Output directory: denoise/sub-01_ses-01_task-rest_space-MNI152NLin2009cAsym_desc-preproc_bold_NR_figures
Traceback (most recent call last):
File "/home/weberam2/Scripts/denoiser/run_denoise.py", line 462, in
denoise(img_file, tsv_file, out_path, col_names, hp_filter, lp_filter, out_figure_path)
File "/home/weberam2/Scripts/denoiser/run_denoise.py", line 244, in denoise
sc_idx[thr_idx][curr_idx] = True
IndexError: index 240 is out of bounds for axis 0 with size 240

The number of timepoints is indeed 240 for the .nii.gz file.
There are 241 rows in the .tsv file (as the first row is the column titles)
There are some n/a values in the first row... I wonder if this is where I'm getting the error...

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