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

spm spatial preproc error on select BIDS dataset subjects #27

Open
valeriejill opened this issue Oct 26, 2023 · 0 comments
Open

spm spatial preproc error on select BIDS dataset subjects #27

valeriejill opened this issue Oct 26, 2023 · 0 comments

Comments

@valeriejill
Copy link

Hi there!!

I recently installed a singularity sif container with the SPM bids app using the "latest" docker tag (singularity build /Volumes/Hera/Projects/corticalmyelin_development/software/spm-latest.sif docker://bids/spm:latest, https://hub.docker.com/layers/bids/spm/latest/images/sha256-cb77a4589bd6a3fb4cf79c76781e8a0cd92ce045ee1373679ddc431afb2a0a16?context=explore).

I have a BIDS dataset with ~160 subjects, many of which have multiple sessions of data. I'm aiming to use the SPM segmentation workflow to bias-correct 7T MP2RAGE UNI and R1 images. Both types of images are located in participant's sub-$sub/ses-$ses/anat folders, with the names sub-$sub_ses-$ses_acq-UNIDENT1_T1w.nii.gz and sub-$sub_ses-$ses_T1map.nii.gz.

I've modified the example pipeline_participant.m configuration file for my singularity run call. I am testing a range of parameters, but an example configuration is below. (To run this on the T1map, I change 'type', 'T1map').

vox_anat = [1 1 1];

anat = spm_BIDS(BIDS,'data', 'modality','anat', 'type','T1w');
if isempty(anat), error('Cannot find T1-weighted image.'); end

clear matlabbatch

% UNICORT Correction via SPM Segmentation
%------------------------------------------------------------------
matlabbatch{1}.spm.spatial.preproc.channel.vols  = cellstr(anat);
matlabbatch{1}.spm.spatial.preproc.channel.biasreg  = 0.01;
matlabbatch{1}.spm.spatial.preproc.channel.biasfwhm  = 30;
matlabbatch{1}.spm.spatial.preproc.channel.write  = [1 1];
matlabbatch{1}.spm.spatial.preproc.warp.mrf = 1;
matlabbatch{1}.spm.spatial.preproc.warp.cleanup = 1;
matlabbatch{1}.spm.spatial.preproc.warp.reg = [0 0.001 0.5 0.05 0.2];
matlabbatch{1}.spm.spatial.preproc.warp.affreg = 'mni';
matlabbatch{1}.spm.spatial.preproc.warp.fwhm = 0;
matlabbatch{1}.spm.spatial.preproc.warp.samp = 3;
matlabbatch{1}.spm.spatial.preproc.warp.write = [0 0];


[~,prov] = spm_jobman('run',matlabbatch);

When I launch this with singularity run, it runs and completes successfully on some subjects but fails on others with the error:

Execution failed: /opt/spm12/spm_BIDS_App.m
The logical indices contain a true value outside of the array bounds.
Error in spm (line 1147)
Error in spm_standalone (line 115)

There is not a difference (that I can deduce) in file organization, acquisition, session number, etc. between subjects that run successfully and those that exit with this error. I have also tried modifying the config file to just specify the channel.vols and channel.write lines (no other params), as well as including 'subjects' or 'sessions' or a specific sub-session combo in the config anat line, and running the container without specifying a config file, and the subjects it works with versus fails on does not change.

Any thoughts on how I may debug this? Thank you so much for the help!!! I extremely appreciate any input or guidance.

Best,
Valerie

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

No branches or pull requests

1 participant