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

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

Open
weberam2 opened this issue Feb 18, 2021 · 4 comments
Open

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

weberam2 opened this issue Feb 18, 2021 · 4 comments

Comments

@weberam2
Copy link

weberam2 commented Feb 18, 2021

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...

@nuttaon
Copy link

nuttaon commented Apr 16, 2021

Hi,

I got the exact same error but in only some datasets. Most of the other ones work fine (same scanners/parameters/data_index). The program did give out .NR.nii.gz and matrix figs (2) but nothing else. I wonder if the .NR.nii.gz was completed?

FYI, Line 244 is a part of the framewise_displacement.

Please advise.

@Chihhao-Lien
Copy link

Chihhao-Lien commented Jun 3, 2021

Hi,

I also get the same error with my .nii files which have 290 time points

IndexError: index 290 is out of bounds for axis 0 with size 290

Does anyone know how to fix with this error? or It's OK and we can use the result for the next step?

@nuttaon
Copy link

nuttaon commented Jun 3, 2021

Hi,

I also get the same error with my .nii files which have 290 time points

IndexError: index 290 is out of bounds for axis 0 with size 290

Does anyone know how to fix with this error? or It's OK and we can use the result for the next step?

After looked at the script, I think it might be a bug in the plotting for the framewise_displacement. I still use the output for further analysis.

@Chihhao-Lien
Copy link

Hi,
I also get the same error with my .nii files which have 290 time points
IndexError: index 290 is out of bounds for axis 0 with size 290
Does anyone know how to fix with this error? or It's OK and we can use the result for the next step?

After looked at the script, I think it might be a bug in the plotting for the framewise_displacement. I still use the output for further analysis.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants