How to compare two rest fmri images, one having adhd and the other control?

Given two sets of rest state fmri images, one set has adhd and the other is control. The following t-test returns all 0’s for the p_values. Is this because the two images are rest state images ? How to find the difference between the images in such cases ?

from scipy import stats

smooth_img_class1=image.smooth_img(fmri_class_1.func_preproc[0], fwhm=3).get_data()
smooth_img_class2=image.smooth_img(fmri_class_2.func_preproc[0], fwhm=3).get_data()
_, p_values=stats.ttest_ind(smooth_img_class1, smooth_img_class2, axis=-1)

The p_values are all null. It is important to note that the smooth_img_class objectss are also all 0’s.
What is missing in this ?

Thanks for the help.

Are there NaNs in the input data before smoothing?

1 Like

I do not see nan. But after smoothing, the smooth_img_class1 and smooth_img_class2 arrays are all zeros! I tried changing the fwhm values to no avail.

Could you check your input data ?
I could not reproduce with ADHD datasets in nilearn (fetch_adhd)

1 Like

@KamalakerD Thank you. Sure. I think my question broadly is whether this example here: http://nilearn.github.io/auto_examples/04_manipulating_images/plot_roi_extraction.html#sphx-glr-auto-examples-04-manipulating-images-plot-roi-extraction-py can be applied to rest fmri (from control subjects and adhd subjects) also ?Or if there is another test (other than the t-test) to find the most intense voxels in rest state frmi.

The notion of ‘most instense voxels’ has little meaning in resting state. You need to use a linear decomposition method, as in the following example:
nilearn.github.io/auto_examples/03_connectivity/plot_extract_regions_dictlearning_maps.html

1 Like

If I want to compare the changes in connectivity from time 1 to time 2?

1 Like