Open JacMatu opened 9 months ago
OK I can indeed reproduce the bug.
The question is what is the expected anat only preprocessing pipeline for several sessions of anat.
Assuming one T1w per session (to keep things simple), we coregister all T1w to that of the first session, then we average them, then we preprocess that single image.
Assuming one T1w per session (to keep things simple), we coregister all T1w to that of the first session, then we preprocess that each image from each session.
The second one is easier to do for now. The question is which one do you need?
I defo need the second one, Marco pointed out that the bias corrections should be done independently for each session since the noise distribution might be session-specific, so even in case of averaging an image across multiple sessions it might be better to first preprocess them individually and then average the corrected products.
If you will include the realignment I will change my scripts to just average them. One thing that I didn't test is I switched the degree of interpolation to max (7th degree) for more precision (& more computational time) - which might be better for high-res studies.
I might also be nice to include in the anatomical preproc only batch, since there are typically fewer images to realign (in opposition to bazillion frames of func acquisitions).
In realign and unwarp batch it was the field (instead of default 3) matlabbatch{1}.spm.spatial.realignunwarp.uwroptions.rinterp = 7;
What do you think?
One thing that I didn't test is I switched the degree of interpolation to max (7th degree) for more precision (& more computational time) - which might be better for high-res studies.
In realign and unwarp batch it was the field (instead of default 3) matlabbatch{1}.spm.spatial.realignunwarp.uwroptions.rinterp = 7;
OK for this I would let users modify it by adding an spm_my_default.m
file in the matlab path
Here is the one used by BIDSPM: https://github.com/cpp-lln-lab/bidspm/blob/main/src/defaults/spm_my_defaults.m
This allows you to edit the default values by SPM in the batches without having to hard code it in your script.
I might also be nice to include in the anatomical preproc only batch, since there are typically fewer images to realign (in opposition to bazillion frames of func acquisitions).
I may end up doing this if I can refactor it out of the current preprocessing.
I defo need the second one, Marco pointed out that the bias corrections should be done independently for each session since the noise distribution might be session-specific, so even in case of averaging an image across multiple sessions it might be better to first preprocess them individually and then average the corrected products.
Fair enough, will start with this then.
Is there an existing issue for this?
Operating system
Operating system version
SPM 12 version
Platform
Platform version
bidspm version
v3.0.0
bidspm branch / commit number
No response
Expected Behavior
Using preprocessing with 'anat_only' = true with data from multiple sessions (varrying across subjects) to end up in preprocessing done for each session instead of just the first one from query.
When I query for specific session preproc happens for it (e.g. ses-02 or 03, but when I grab 02, 03 and 04 it only happens for 02.)
Anything else?
matlabbatch (job) is built for one session only.