Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Inverted activation #274

Closed
bgagl opened this issue Oct 12, 2018 · 14 comments
Closed

Inverted activation #274

bgagl opened this issue Oct 12, 2018 · 14 comments

Comments

@bgagl
Copy link

bgagl commented Oct 12, 2018

Hi there,

I am encountering an issue where I ran out of options.

The results from nistats are exactly inverted to my expectation in multiple investigations. Most prominent is the negative activation for a button press condition in relation to baseline (no other button press condition in all of the experiment), using the left hand, in the right motor cortex. Please see https://www.dropbox.com/s/m9foi714gkjuvxn/catch_trails_baselinecontrast.png?dl=0

I used the following code for contrast coding and plotting

zmap = second_level_model.compute_contrast(first_level_contrast='CATCH')
plotting.plot_glass_brain(zmap, colorbar=True, threshold=norm.isf(0.001),
                          title='CATCH (unc p<0.001)',
                          plot_abs=False, display_mode='lyrz')

the fitted models had the following form

FirstLevelModel(drift_model='cosine', drift_order=1, fir_delays=[0],
        hrf_model='glover', mask=None, memory=Memory(cachedir=None),
        memory_level=1, min_onset=-24, minimize_memory=True, n_jobs=1,
        noise_model='ar1', period_cut=128, signal_scaling=True,
        slice_time_ref=0.0, smoothing_fwhm=8.0, standardize=False,
        subject_label='3IK02', t_r=2.25, target_affine=None,
        target_shape=None, verbose=0)

using the first_level_models_from_bids function.

In addition, I used fMRIprep for preprocessing and Dcm2niix to convert my dicoms to niftis.

Any suggestions where this might originate from?
Thanks in advance.
Best wishes,
Benjamin

@bthirion
Copy link
Member

I'm a bit afraid of the FIR model here: it typically does not capture well the hrf, especially because you're only using a 1-lag model.
First, unless there is one good reason to do otherwise, I would use the spm hrf.
The if you use a fir model, you probably want to use another, e.g. 4s.
Does it help ?

@bgagl
Copy link
Author

bgagl commented Oct 12, 2018

Thanks for the response

I ran also the following model

FirstLevelModel(drift_model='cosine', drift_order=1, fir_delays=[0],
        hrf_model='spm + derivative + dispersion', mask=None,
        memory=Memory(cachedir=None), memory_level=1, min_onset=-24,
        minimize_memory=True, n_jobs=1, noise_model='ar1', period_cut=128,
        signal_scaling=True, slice_time_ref=0.0, smoothing_fwhm=6.0,
        standardize=False, subject_label='3IK02', t_r=2.25,
        target_affine=None, target_shape=None, verbose=0)

No change in the result. Or did I get something wrong here?

@bthirion
Copy link
Member

Have you checked that the contrasts, especially those of the second-level analysis are well specified ?
You probably want to use plot_contrast_matrix.
You can also look at the individual maps to see if the inconsistency is at the first or second level.

@bgagl
Copy link
Author

bgagl commented Oct 15, 2018

It looks like the problem is there on the first level already (see participant 1-4 here https://www.dropbox.com/sh/b9j6kl5s9pa681x/AADa9qN0wdjCxJ9N2QatN2d_a?dl=0). In addition, there is a contrast matrix in the same folder. Looks ok to me.

here is the related code.


        model.fit(imgs, events, confounds)
        plot_design_matrix(model.design_matrices_[0])
        zmap = model.compute_contrast(['CATCH'])
        plotting.plot_glass_brain(zmap, colorbar=True, threshold=norm.isf(0.001),
                          title='CATCH (unc p<'+str(p)+')',
                          plot_abs=False, display_mode='lyrz') 
        plt.show()

Thanks, I hope this can give you a clue.

@bthirion
Copy link
Member

  • The CSF, WM and GM regressors seem to be flat. Are they 0 ? If yes, this is an issue: the GLM may not work well.
  • Also, I would remove the dispersion derivative.
  • Is there any contrast more meaningful than 'CATCH' alone ? Why not 'CATCH-CS' or 'CATH-PW' (sorry if this is meaningful) ? Such contrasts may better outline effects of interest.
  • Finally, I am wondering whether your data were mean-centered prior to GLM fitting. Is it the case ? (to know that, compute the mean bold image of the series, and look at the values of this mean image.)

@bgagl
Copy link
Author

bgagl commented Oct 16, 2018

Hi again,

1: CSF, WM and GM regressors are not flat. They look the following way

CSF	
624.4984561143067	
-17.494380287122837	
7.923268006008159	
-4.935548925359756	
-12.13352137921385	
-13.424219848350608	
-11.79559046162232	
-12.097822444297064	
-12.228997876790814	
-2.460461803678357	
...

I expect the first value scales the color coding in a way that the smaller differences cannot be seen well. Also removing these values changes a lot. E.g. baseline contrasts become either entirely negative or positive for all voxels.

2: removing dispersion derivative did not change a lot. See here: https://www.dropbox.com/s/180dob4k0lpc4pi/CATCH.png?dl=0

3: Here also a contrast of the trials with a button press against all others ('CATCH - (W+CS+PW) '): https://www.dropbox.com/s/azreoysibzfilk8/CATCH-ALL.png?dl=0
Also looks relativly similiar. With negative activation in motor related areas.

4: I checked the data in relation to the mean. Using the following code the mean was arround 130-140.

import nilearn as nli
ftmp = nli.image.load_img(models_run_imgs[1][1])
mean(ftmp.get_data()[:, :, :])

Thanks again.

@bgagl
Copy link
Author

bgagl commented Oct 17, 2018

Quick update, here is the complete notebook of the nistats analysis: https://www.dropbox.com/s/89yptesdhj4yti0/first_second_level_ext_LCM-W_PW_CS.html?dl=0

@bgagl
Copy link
Author

bgagl commented Oct 18, 2018

Quick update, here is the complete notebook of the nistats analysis now EXCLUDING the CSF, WM and GM regressors ... does not look good: https://www.dropbox.com/s/5fm4yhhvmcjhzfb/first_second_level_ext_LCM-W_PW_CS.html?dl=0

@bthirion
Copy link
Member

OK, will look at it today hopefully.
B

@bgagl
Copy link
Author

bgagl commented Oct 18, 2018

Thanks, that would be great.

@bthirion
Copy link
Member

Sorry, I've been distracted by a bunch of things. Here are a few comments:

  • I find the design matrix for subject "AFN02" fishy: there is no event occurring at the beginning... Are you sure that the onset times a re right ?

  • you have to upgrade nistats (see install page),as you are not using the latest version.

  • there is a problem with subjects OVS14 ADA07 ALA20 ASA05 EBN14 GJA23 RVA30 SKK20 YBA08 AKA01 and BWC24

  • In general, the values after the first-level analysis that are output are pretty packed around zero. This is strange. Are their some artefact in the data that would decrease the amount of explained variance ?

  • Even under chance, you shoud; obtain more extreme values. Have you checked the brain mask that you are using ?

  • if possible I would use 'CATCH-something else' instead of 'CATCH' depending on the conditions you have. It may remove some weird individual effect

  • At least for the bad subjects, I would try to fit separately run1 and run2, and see if one of them is particularly problematic. It might be worth rejecting data if you find some kind of corruption.

  • the second-level results are a mess, but this probably comes from wrong first level analyses
    HTH

1 similar comment
@bthirion
Copy link
Member

Sorry, I've been distracted by a bunch of things. Here are a few comments:

  • I find the design matrix for subject "AFN02" fishy: there is no event occurring at the beginning... Are you sure that the onset times a re right ?

  • you have to upgrade nistats (see install page),as you are not using the latest version.

  • there is a problem with subjects OVS14 ADA07 ALA20 ASA05 EBN14 GJA23 RVA30 SKK20 YBA08 AKA01 and BWC24

  • In general, the values after the first-level analysis that are output are pretty packed around zero. This is strange. Are their some artefact in the data that would decrease the amount of explained variance ?

  • Even under chance, you shoud; obtain more extreme values. Have you checked the brain mask that you are using ?

  • if possible I would use 'CATCH-something else' instead of 'CATCH' depending on the conditions you have. It may remove some weird individual effect

  • At least for the bad subjects, I would try to fit separately run1 and run2, and see if one of them is particularly problematic. It might be worth rejecting data if you find some kind of corruption.

  • the second-level results are a mess, but this probably comes from wrong first level analyses
    HTH

@bgagl
Copy link
Author

bgagl commented Oct 29, 2018

Hi there, thanks for the last comment, this lead to identification of an error prior to stats. Fist checks and analyses look good.

Once more thanks for the great help ! I am becoming a big fan of nistats

@bthirion
Copy link
Member

Thx !
Please close the issue if you think it's fine.
Best,

@bgagl bgagl closed this as completed Oct 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants