Charestlab / pyGLMdenoise

python implementation of GLMdenoise
6 stars 6 forks source link

Question regarding running the package #78

Open ShreyasFadnavis opened 2 years ago

ShreyasFadnavis commented 2 years ago

Hi @ilogue,

I am trying to run the code as follows, but am unable to do so. Here is a sample of how I am trying to do it:

from glmdenoise import GLMdenoise
from dipy.io.image import load_nifti
import pandas as pd

design = pd.read_csv("/fmri_Denoise/sub-01_ses-retest_func_sub-01_ses-retest_task-linebisection_events.tsv", sep='\t')
data, affine = load_nifti('/fmri_Denoise/sub-01_ses-retest_func_sub-01_ses-retest_task-covertverbgeneration_bold.nii.gz')

gd = GLMdenoise()
gd.fit(design, data, tr=2.0)
gd.plot_figures()

Is there something I am missing? I am using the data you mentioned in the README : https://openneuro.org/datasets/ds000114/versions/1.0.1

My guess is that I should not use pandas to load the tsv?

Thanks in advance!

JasperVanDenBosch commented 2 years ago

hi @ShreyasFadnavis,

the fit() method expects design and data to both be lists of runs, so change the penultimate line to:

gd.fit([design], [data], tr=2.0)

And it'll get further. However it then complains about a dimensions mismatch which probably has to do with the events file containing events (79) that are not represented in the data (64). This might not be an issue with your own data.

You're very much welcome to ask further questions here but I should warn that I am not actively maintaining this right now..