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

[DC61] Pipeline reproduction (SPM - deriv) #157

Open
9 tasks
mgaubert opened this issue Feb 12, 2024 · 8 comments
Open
9 tasks

[DC61] Pipeline reproduction (SPM - deriv) #157

mgaubert opened this issue Feb 12, 2024 · 8 comments
Assignees
Labels
🧠 hackathon To assess during the hackathon deriv SPM 🏁 status: ready for dev Ready for work

Comments

@mgaubert
Copy link

mgaubert commented Feb 12, 2024

Softwares

Software: SPM

Input data

derivatives (fMRIprep)

Additional context

see description below

List of tasks

Please tick the boxes below once the corresponding task is finished. 👍

  • 👌 A maintainer of the project approved the issue, by assigning a 🏁status: ready for dev label to it.
  • 🌳 Create a branch on your fork to start the reproduction.
  • 🌅 Create a file team_{team_id}.py inside the narps_open/pipelines/ directory. You can use a file inside narps_open/pipelines/templates as a template if needed.
  • 📥 Create a pull request as soon as you completed the previous task.
  • 🧠 Write the code for the pipeline, using Nipype and the file architecture described in docs/pipelines.md.
  • 📘 Make sure your code is documented enough.
  • 🐍 Make sure your code is explicit and conforms with PEP8.
  • 🔬 Create tests for your pipeline. You can use files in tests/pipelines/test_team_* as examples.
  • 🔬 Make sure your code passes all the tests you created (see docs/testing.md).

NARPS team description : DC61

General

(currently private, will be made public once we receive confirmation
from the NARPS team that our results can be made public).
Note: We focused on the part of the preregistered analysis that used SPM, as we did not
have sufficient time to also run analyses in FSL and AFNI.

  • regions_definition : We used the Harvard/Oxford atlases available in FSL:
    • vmPFC or “Frontal Medial Cortex” corresponds to area 25 in
      HarvardOxford-cort-maxprob-thr0-2mm.
    • ventral striatum or “nucleus accumbens” corresponds to areas 11 and 21 in
      HarvardOxford-sub-maxprob-thr0-2mm.
    • amygdala corresponds to areas 10 and 20 in HarvardOxford-sub-maxprob-thr0-2mm.
  • softwares : SPM12 (7219) for all the neuroimaging analysis (smoothing + statistical analysis). ;
    For preprocessing we used the fmriprep data provided.
    To decide on exclusion based on motion, we used a jupyter notebook (jupyter-core 4.4.0)
    with Python 3.6.7, matplotlib 3.0.3, pandas 0.24.1, and nilearn 0.5.0, nibabel 2.3.3.
    To make our final conclusions for the 9 hypothesis, we used a Jupyter notebook (same
    version) with additional package: numpy 1.16.2 and visually inspected the detections using
    mricron version ‘2MAY2016’.
  • general_comments : We believe that the template’s itemisation of FDR methods is poorly aligned with the
    usage in SPM and other packages. While the template offered:
    False Discovery Rate.
    Benjamini & Hochberg FDR (typical).
    Positive FDR.
    Local FDR.
    Cluster-level FDR.
    In SPM the default is Benjamini & Hochberg FDR on peaks; to our knowledge positive
    FDR is not used much in imaging, though local FDR is implemented in some FSL ICA
    methods.
    We would recommend:
    False Discovery Rate
    Voxel-wise Benjamini & Hochberg (BH) FDR (typical outside SPM)
    Peak-wise BH FDR (default in SPM)
    Cluster-level BH FDR (only available in SPM)
    Local FDR (note method used to model null and alternative distributions)
    Positive FDR (note method used to estimate proportion of null hypotheses)

Exclusions

  • n_participants : 105
  • exclusions_details : First, one member of the team visually inspected each run (108 subjects x 4 runs) and
    checked the following points for any problematic issue: Registration to template, Brainmask,
    Anatomical-functional registration, Signal dropout in the prefrontal cortex in the functional
    image. No issues were identified at this stage.
    Second, we excluded all runs that presented a framewise displacement greater than 2mm
    (i.e. 1 voxel), this led to the exclusion of: sub013_run-04; sub-016_run-01 run-03 and
    run-04; sub-018 (all runs); sub-022_run-02; sub-026_run-01 and run-04; sub-030 (all runs);
    sub-036_run-02; sub-037_run-03; sub-068_run-02; sub-088_run-02, run-03 and run-04;
    sub-089_run-03; sub-093_run-04; sub-100_run-02 and run-04; sub-106_run-03 and run-04;
    sub-110_run-01, run-03 and run-04; sub-116 (all runs); sub-120_run-02.

Preprocessing

  • used_fmriprep_data : Yes
  • preprocessing_order : N/A (we used fmriprep)
  • brain_extraction : N/A (we used fmriprep)
  • segmentation : N/A (we used fmriprep)
  • slice_time_correction : N/A (we used fmriprep)
  • motion_correction : N/A (we used fmriprep)
  • motion :
  • gradient_distortion_correction : N/A (we used fmriprep)
  • intra_subject_coreg : N/A (we used fmriprep)
  • distortion_correction : N/A (we used fmriprep)
  • inter_subject_reg : N/A (we used fmriprep)
  • intensity_correction : N/A (we used fmriprep)
  • intensity_normalization : N/A (we used fmriprep)
  • noise_removal : N/A (we used fmriprep)
  • volume_censoring : No volume censoring.
  • spatial_smoothing : We performed spatial smoothing using SPM12 (7219) with a Gaussian kernel with a
    full-width-at-half-maximum of 5mm. Smoothing was done in the MNI space (i.e. on the
    _bold_space-MNI152NLin2009cAsym_preproc.nii.gz files provided by fmriprep).
  • preprocessing_comments : NA

Analysis

  • data_submitted_to_model : We submitted the smoothed functional images for each non-excluded {subject, run} pair to
    the statistical modelling (cf. list of excluded runs above).
  • spatial_region_modeled : We performed a full brain analysis and used implicit masking available in SPM to define the
    analysis masks.
  • independent_vars_first_level : Independent variables at the first level. Predictors we defined as follows (all variables in double quote come from corresponding events.tsv in BIDS):
    • ‘gamble’ with onsets: “onset” and duration: “duration”
    • ‘gain_param’ (parametric modulation) with onsets: “onset”, duration: “duration”, and height: “gain”
    • ‘loss_param’ (parametric modulation) with onsets: “onset”, duration: “duration”, and height: “loss”
    • ‘RT_param’ (parametric modulation) with onsets: “onset”, duration: “duration”, and height: “RT”
      HRF basis: SPM default, canonical only.
      Drift modelling: SPM default
      Motion regressors
    • 24 motion parameters: X, Y, Z, RotX, RotY, RotZ and for each the derivative, square and squared derivative.
      No orthogonalisation. In our preregistration we had indicated that we would orthogonalise:
      ‘gain_param’ with respect to ‘gamble’, ‘loss_param’ with respect to ‘gamble’ and
      ‘RT_param’ with respect to ‘gamble’. To the best of our knowledge, it is not possible within
      the SPM batch system to specify our target orthogonalisation. We therefore disabled SPM's
      orthogonalisation. We believe that the results would have been the same if we had manage
      to orthogonalise ‘gain_param’ with respect to ‘gamble’, ‘loss_param’ with respect to
      ‘gamble’ and ‘RT_param’ with respect to ‘gamble’ as those orthogonalizations do not affect
      our effects of interest, i.e. the gain effect as variation about the mean response, controlling
      for loss and response time effects, and likewise the loss effect controlling for gain and
      response time.
  • RT_modeling : pm
  • movement_modeling : 1
  • independent_vars_higher_level : Separately for the gain and loss conditions, we entered the corresponding subject-level contrast maps (‘gain_param’ and ‘loss_param’ respectively) into a group model with the following predictors:
    • ‘gain_param_indiff’ or ‘loss_param_indiff’: ‘1’ for files from subjects in equal indifference group, 0 otherwise.
    • ‘gain_param_range’ or ‘loss_param_range’: ‘1’ for files from subjects in equal range group, 0 otherwise.
      No covariates, no other between subject effects. No repeated measures.
  • model_type : Mass univariate.
  • model_settings : First-level: Fixed effects, differences in run-specific variance accounted for with a global
    factor. Drift model: discrete cosine basis with cut off of 128 seconds (SPM default).
    Autocorrelation: Approximate AR(1), run-specific, globally pooled (SPM default).
    Second-level: Ordinary least squares with group-specific variance accounted for with a global
    factor. No repeated measures.
  • inference_contrast_effect : First level contrasts:
    • ‘gain_param’: 0.25gain_param_run01 + 0.25gain_param_run02 + 0.25gain_param_run03 + 0.25gain_param_run04
    • ‘loss_param’: 0.25loss_param_run01 + 0.25loss_param_run02 + 0.25loss_param_run03 + 0.25loss_param_run04
      For subjects for which runs were excluded the weighted sum was computed only over
      the included runs and the weight of 0.25 was replaced by 1/NUM_OF_RUNS where
      NUM_OF_RUNS is the number of runs that were kept for that subject.
      Second level contrasts for the gain analysis :
    • ‘gain_param_indiff’: T-contrast of parametric effect of gain in the equal indifference group ○ [1 0] i.e. 1*gain_param_indiff
    • ‘gain_param_range’: T-contrast of parametric effect of gain in the equal range group ○ [0 1] i.e. 1*gain_param_range
      Second level contrasts for the loss analysis :
    • ‘loss_param_indiff’: F-contrast of parametric effect of loss in the equal indifference group ○ [1 0] i.e. 1*loss_param_indiff
    • ‘loss_param_range’: F-contrast of parametric effect of loss in the equal range group ○ [0 1] i.e. 1*loss_param_range
    • ‘loss_range_vs_indiff’: Greater response to losses for equal range vs. indifference range: ○ [-1 1] i.e. loss_param_range-loss_param_indiff
  • search_region : Whole brain.
  • statistic_type : Voxelwise statistic.
  • pval_computation : Standard parametric inference.
  • multiple_testing_correction : Voxelwise BH FDR-corrected p<0.05 voxelwise (SPM defaults updated with stats.topoFDR
    = 0). To implement a two-sided test for the loss_param_indiff po and loss_param_range,
    inference was conducted on F-tests which were then split into positive effects
    (hypothesis 7 and 8) and negative effects (hypothesis 5 and 6).
  • comments_analysis : Our first, desired approach to this analysis was a clinical-trials, ROI-only primary
    outcome, producing a scalar statistic for each hypothesis. As the instructions were
    quite clear that a whole-brain thresholded map was required, we gave up on this
    approach.

Categorized for analysis

  • region_definition_vmpfc : atlas HOA
  • region_definition_striatum : atlas HOA
  • region_definition_amygdala : atlas HOA
  • analysis_SW : SPM
  • analysis_SW_with_version : SPM12
  • smoothing_coef : 5
  • testing : parametric
  • testing_thresh :
  • correction_method : FDR voxelwise
  • correction_thresh_ : p<0.05

Derived

  • n_participants : 105
  • excluded_participants : 018, 030, 116
  • func_fwhm : 5
  • con_fwhm :

Comments

  • excluded_from_narps_analysis : No
  • exclusion_comment : N/A
  • reproducibility : 3
  • reproducibility_comment :
@mgaubert mgaubert added the 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work label Feb 12, 2024
@bclenet bclenet added 🏁 status: ready for dev Ready for work and removed 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work labels Feb 12, 2024
@cmaumet cmaumet changed the title [DC61] Pipeline reproduction [DC61] Pipeline reproduction (SPM - deriv) Feb 13, 2024
@cmaumet
Copy link
Contributor

cmaumet commented Feb 13, 2024

@mgaubert: I am adding you as assignee on this issue just for the time of the hackathon so that we can more easily see which pipelines are awaiting contributors in https://github.com/orgs/Inria-Empenn/projects/1/views/1

@bclenet bclenet self-assigned this Apr 10, 2024
@bclenet bclenet mentioned this issue Apr 10, 2024
8 tasks
@bclenet
Copy link
Collaborator

bclenet commented Apr 10, 2024

Hi @cmaumet,

Here is a quick question about this analysis. In the inference_contrast_effect section, the description mentions:

Second level contrasts for the gain analysis :

  • ‘gain_param_indiff’: T-contrast of parametric effect of gain in the equal indifference group
    • [1 0] i.e. 1gain_param_indiff
  • ‘gain_param_range’: T-contrast of parametric effect of gain in the equal range group
    • [0 1] i.e. 1gain_param_range

Does this mean that we design a one sample t-test with two covariates, one for the equalRange, another for the equalIndifference group ? And we pass subject-level contrasts files from both groups as input ?

@cmaumet
Copy link
Contributor

cmaumet commented Apr 11, 2024

@bclenet: I confirm that I think you have the right answer to this!

@bclenet
Copy link
Collaborator

bclenet commented Apr 17, 2024

Hi @cmaumet,

Later in the description (also in the inference_contrast_effect section):

Second level contrasts for the loss analysis :

  • 'loss_param_indiff': F-contrast of parametric effect of loss in the equal indifference group
    • [1 0] i.e. 1loss_param_indiff
  • 'loss_param_range': F-contrast of parametric effect of loss in the equal range group
    • [0 1] i.e. 1loss_param_range

I assume they actually used F-contrasts here (probably not a typo), but could you please let me know how their setup in SPM is different from the one of a t-contrast ?

@cmaumet
Copy link
Contributor

cmaumet commented Apr 18, 2024

We looked at the collection on NV: https://neurovault.org/collections/4963/ and we confirmed that gain was a T-contrast and loss an F-contrast.

@bclenet bclenet added the 🧠 hackathon To assess during the hackathon label Dec 3, 2024
@bclenet
Copy link
Collaborator

bclenet commented Dec 19, 2024

There is currently an issue with group level analysis (contrast definition ?)

Running 'Contrast Manager'

SPM12: spm_contrasts.m                             09:44:02 - 19/12/2024
========================================================================
Contrasts folder                        :            ./contrast_estimate
0  1  0  <-  !invalid contrast
Failed  'Contrast Manager'
Error using ==> spm_run_con at 251
Error in contrast specification
In file "/opt/spm12-r7219/spm12_mcr/spm12/config/spm_run_con.m" (???), function "spm_run_con" at line 251.

The following modules did not run:
Failed: Contrast Manager

@cmaumet
Copy link
Contributor

cmaumet commented Dec 19, 2024

@bclenet in this instance it may help to look at the design matrix (to see how many regressors and what name they have) in order to understand why the contrat is "invalid".

@bclenet
Copy link
Collaborator

bclenet commented Dec 19, 2024

Thanks, I just commented this issue to keep track of the current development status.
It would be great to have a look to the contrast definition / design matrix indeed.
I think I need your help on this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧠 hackathon To assess during the hackathon deriv SPM 🏁 status: ready for dev Ready for work
Projects
Status: In progress
Development

No branches or pull requests

3 participants