Skip to content

Conversation

@Remi-Gau
Copy link
Contributor

@Remi-Gau Remi-Gau commented Apr 3, 2021

Other changes:

change the option to skip GLM QA:

  • it is now opt.glm.QA.do

it is possible to decide where the GLM output will go by using opt.dir.stats. The default is now:

  • cpp_spm-stats

here is what the output structure could look like

demos/spm_face_rep/
├── cfg
├── inputs
│   └── source
├── models
│   ├── model-defaultFacerepetition_smdl.json
│   ├── model-faceRepetitionResolution15_smdl.json
│   ├── model-faceRepetitionResolution1_smdl.json
│   ├── model-faceRepetitionResolution2_smdl.json
│   └── model-faceRepetition_smdl.json
└── outputs
    ├── derivatives
    │   ├── cpp_spm
    │   │   ├── JOBS
    │   │   │   └── facerepetition
    │   │   │       └── sub-01
    │   │   └── sub-01
    │   │       ├── anat
    │   │       ├── figures
    │   │       ├── func
    │   │       └── stats     <---------- still possible to keep the stats with the preprocessing by using `opt.dir.stats = opt.derivatesDir`
    │   │           └── task-facerepetition_space-MNI_FWHM-6
    │   ├── cpp_spm-res1   <--------- different preprocessing have to be kept in different subfolders
    │   │   ├── JOBS
    │   │   │   └── facerepetition
    │   │   │       └── sub-01
    │   │   └── sub-01
    │   │       ├── anat
    │   │       ├── figures
    │   │       └── func
    │   ├── cpp_spm-res1.5
    │   │   ├── JOBS
    │   │   │   └── facerepetition
    │   │   │       └── sub-01
    │   │   └── sub-01
    │   │       ├── anat
    │   │       ├── figures
    │   │       └── func
    │   ├── cpp_spm-res2
    │   │   ├── JOBS
    │   │   │   └── facerepetition
    │   │   │       └── sub-01
    │   │   └── sub-01
    │   │       ├── anat
    │   │       ├── figures
    │   │       └── func
    │   └── cpp_spm-stats   <----- all the stats can be centralized
    │       ├── JOBS
    │       │   └── facerepetition
    │       │       └── sub-01
    │       └── sub-01
    │           └── stats
    │               ├── task-facerepetition_space-MNI_FWHM-6_desc-resamplingResolution1
    │               ├── task-facerepetition_space-MNI_FWHM-6_desc-resamplingResolution15
    │               └── task-facerepetition_space-MNI_FWHM-6_desc-resamplingResolution2
    └── raw

@codecov
Copy link

codecov bot commented Apr 3, 2021

Codecov Report

Merging #340 (d3f0a1b) into dev (c6b1b96) will decrease coverage by 1.98%.
The diff coverage is 12.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #340      +/-   ##
==========================================
- Coverage   63.33%   61.35%   -1.99%     
==========================================
  Files         111      114       +3     
  Lines        1762     1832      +70     
==========================================
+ Hits         1116     1124       +8     
- Misses        646      708      +62     
Impacted Files Coverage Δ
src/batches/setBatchEstimateModel.m 0.00% <0.00%> (ø)
src/group_level/getRFXdir.m 100.00% <ø> (ø)
src/templates/bidsTemplateWorkflow.m 0.00% <0.00%> (ø)
src/workflows/bidsCreateROI.m 0.00% <0.00%> (ø)
src/workflows/bidsFFX.m 0.00% <0.00%> (ø)
src/workflows/bidsRFX.m 0.00% <0.00%> (ø)
src/workflows/bidsRoiBasedGLM.m 0.00% <0.00%> (ø)
src/subject_level/getFFXdir.m 87.50% <66.66%> (-12.50%) ⬇️
src/defaults/checkOptions.m 100.00% <100.00%> (ø)
src/setStatsDir.m 100.00% <100.00%> (ø)
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c6b1b96...d3f0a1b. Read the comment docs.

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Apr 3, 2021

@marcobarilari
@CerenB

maybe the options mentioned above might be of interest to you.

@Remi-Gau Remi-Gau linked an issue Apr 3, 2021 that may be closed by this pull request
Copy link
Collaborator

@CerenB CerenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I left some questions to get confirmation from you. And I was wondering this structure of the folders will be applied to the whole-brain analysis, it is not only for ROIs, right?
e.g. if I opt to use no ROIs, and change the resolution in the analysis, I can re-run the spatial preprocessing script and the pipeline would create a new folder (actually new folder structure)


bidsCreateROI(opt);

opt.glm.roibased.do = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this option is set to false, would it do the whole brain analysis with different resolution spatial preprocessing?

opt.model.file = newModel;

spm_jsonwrite(newModel, content, struct('indent', ' '));

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only for this function to create names (in order to do so, we need to create different model.json files) for different resolution? so that spatial preprocssing folders would be different?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is only to create a different GLM folder name.

This is a bit "ugly" because everything in those json is the same: but I was trying to find a way to create different folder names that would not involve adding another option to the pile and would instead reuse something we already have to create GLM folder names.

Does that make sense?

Another option could have been to have a different cpp_spm-stats folder for each resolution but then all the stats would not be centralized.

I think there is only so much data curation that can be automatized.

'stats', ...
glmDirName);

if opt.glm.roibased.do
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's pretty much it: one of the few thing this flag does is append a suffix to the GLM folder.

This way in this case you can use the same model json for both whole brain and roi based analysis

@@ -0,0 +1,115 @@
% (C) Copyright 2021 CPP BIDS SPM-pipeline developers

function bidsRoiBasedGLM(opt)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is for running GLM on only ROIs, right? instead of whole brain. Here is a irrelevant question!
I usually do not prefer roi-based GLM, and go with whole brain. Then extract the betas from a given ROI. Do you know which functions could be useful for extracting betas in a given ROI in cpp-spm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spm_summarize ?

Copy link
Contributor Author

@Remi-Gau Remi-Gau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And I was wondering this structure of the folders will be applied to the whole-brain analysis, it is not only for ROIs, right?

Yes that's correct

@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Apr 7, 2021

I was just thinking.

Maybe we should add some "child protection": if opt.glm.roibased.do is true then bidsFFX should NOT run and bidsRoiBasedGLM should.

And then the other way around when set to false.

What do you think?

Maybe we should throw an error with a message saying what the expected option setting should be for each workflow to run.

@Remi-Gau Remi-Gau linked an issue Apr 7, 2021 that may be closed by this pull request
@Remi-Gau
Copy link
Contributor Author

Remi-Gau commented Apr 7, 2021

One thing that will need to be done in another PR is the ability to compute contrasts from the bids model and the content of the options.

At the moment the roi based workflow only does it assuming for all "events" taken together.

@Remi-Gau Remi-Gau merged commit 6010230 into cpp-lln-lab:dev Apr 7, 2021
@Remi-Gau Remi-Gau deleted the remi-roi_based_glm branch April 7, 2021 16:12
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

Successfully merging this pull request may close these issues.

Add template file to create new workflows organize output of FFX and RFX in separate derivatives folder

2 participants