-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Labels
bug 🐛Something isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Operating system
- Linux
- Mac
- Windows
Operating system version
- Mac OS Version 13 "Ventura" 13.7.5
SPM 12 version
- 7771
- 7487
- 7219
Platform
- MATLAB
- Octave
Platform version
- MATLAB 2019b
- Octave 4.2.2
bidspm version
v3.1.0
bidspm branch / commit number
No response
Expected Behavior
I'm running bidspm to get subject-level GLMs in individual space, re-using code that worked perfectly for IXI549Space after a year and bidspm doesn't find RepetitionTime in .json files anymore even though everything is BIDSified and stored on GIN and it worked previously.
BIDS stats model
{
"Name": "MVPA_6_betas",
"BIDSModelVersion": "1.0.0",
"Description": "model for MVPA of words, pseudowords and control aggregated within each RUN (1 beta/run)",
"Input": {
"task": [
"MultimodalReadSpeech"
],
"space": [
"individual"
]
},
"Nodes": [
{
"Level": "Run",
"Name": "univ_summary",
"GroupBy": [
"run", "subject"
],
"Model": {
"X": [
"trial_type.block_read_word",
"trial_type.block_read_pseudoword",
"trial_type.block_read_control",
"trial_type.block_speech_word",
"trial_type.block_speech_pseudoword",
"trial_type.block_speech_control",
"trial_type.cue",
"trial_type.target",
"trial_type.response",
"trans_?",
"rot_?",
"*outlier*"
],
"HRF": {
"Variables": [
"trial_type.block_read_word",
"trial_type.block_read_pseudoword",
"trial_type.block_read_control",
"trial_type.block_speech_word",
"trial_type.block_speech_pseudoword",
"trial_type.block_speech_control",
"trial_type.cue",
"trial_type.target",
"trial_type.response"
],
"Model": "spm"
},
"Type": "glm",
"Options": {
"HighPassFilterCutoffHz": 0.0078,
"Mask": ""
},
"Software": {
"SPM": {
"SerialCorrelation": "FAST"
}
}
},
"DummyContrasts": {
"Test": "t",
"Contrasts": [
"trial_type.block_read_word",
"trial_type.block_read_pseudoword",
"trial_type.block_read_control",
"trial_type.block_speech_word",
"trial_type.block_speech_pseudoword",
"trial_type.block_speech_control"
]
},
"Contrasts": [
{
"Name": "read_word_pseudo_gt_control",
"ConditionList": [
"trial_type.block_read_word",
"trial_type.block_read_pseudoword",
"trial_type.block_read_control"
],
"Weights": [
0.5,
0.5,
-1
],
"Test": "t"
},
{
"Name": "speech_word_pseudo_gt_control",
"ConditionList": [
"trial_type.block_speech_word",
"trial_type.block_speech_pseudoword",
"trial_type.block_speech_control"
],
"Weights": [
0.5,
0.5,
-1
],
"Test": "t"
}]
},
{
"Level": "Subject",
"Name": "subject_level",
"GroupBy": [
"contrast",
"subject"
],
"Model": {
"X": [
1
],
"Type": "glm"
},
"DummyContrasts": {
"Test": "t"
}
},
{
"Level": "Dataset",
"Name": "within_group",
"Description": "one sample t-test for each group",
"GroupBy": [
"contrast",
"group"
],
"Model": {
"Type": "glm",
"X": [
1
]
},
"DummyContrasts": {
"Test": "t"
}
}
]
}Current Behavior & Error message
[13:06:00] bidspm - INFO
bidspm already initialized
[13:06:00] bidspm - INFO
Validating bids dataset:
/Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/src/bidspm-stats/../../../inputs/raw
Require bids-validator from https://github.com/bids-standard/bids-validator
zsh:1: command not found: validate_model
Warning:
BIDS stats models could not be validated.
To silence this warning install bsmschema:
pip install bsmschema
> In errorHandling (line 61)
In validate (line 42)
In cliStats (line 14)
In bidspm>executeAction (line 86)
In bidspm (line 26)
In run_univ_sub_glm_Task_ReadingSpeechMultimodal_native (line 35)
In run (line 91)
[13:06:00] bidspm - INFO
bidspm already initialized
[13:06:01] bidspm - INFO saveOptions
Options saved in: /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/outputs/derivatives/options/options_task-MultimodalReadSpeech_2025-09-04T13-06.json
Warning:
Could not find a corresponding Node with
Name: "dataset"; Level: ""
Available nodes:
- Name: "univ_summary"; Level: "Run"
- Name: "subject_level"; Level: "Subject"
- Name: "within_group"; Level: "Dataset"
> In bids.internal.error_handling (line 60)
In bids/Model/get_nodes (line 354)
In getDummyContrastsList (line 24)
In boilerplate (line 137)
In cliStats (line 58)
In bidspm>executeAction (line 86)
In bidspm (line 26)
In run_univ_sub_glm_Task_ReadingSpeechMultimodal_native (line 35)
In run (line 91)
Warning: Could not find key 'designType'
> In get_key (line 74)
In renderer (line 159)
In octache (line 79)
In boilerplate (line 185)
In cliStats (line 58)
In bidspm>executeAction (line 86)
In bidspm (line 26)
In run_univ_sub_glm_Task_ReadingSpeechMultimodal_native (line 35)
In run (line 91)
[13:06:01] bidspm - INFO getData
FOR TASK(s): MultimodalReadSpeech
Indexing dataset:
/Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/outputs/derivatives/bidspm-preproc
Indexing subject: sub-blind01 [....]
Indexing dataset:
/Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/inputs/raw
Indexing subject: sub-blind01 [...]
[13:06:04] bidspm - INFO getData
WILL WORK ON SUBJECTS
- blind01
[13:06:04] bidspm - INFO printWorkflowName
WORKFLOW: SUBJECT LEVEL GLM
[13:06:04] bidspm - INFO bidsFFX
PROCESSING NODE: univ_summary
[13:06:04] bidspm - INFO printProcessingSubject
PROCESSING SUBJECT No.: 1 SUBJECT LABEL : blind01
[13:06:04] bidspm - DEBUG printBatchName
BUILDING JOB: specify subject level fmri model
Warning:
[13:06:05] bidspm - WARNING setBatchSubjectLevelGLMSpec
Slice timing information was missing for at least one run,
or was inconsistent across runs.
Will be using the number of slices as the number of bins
for temporal upsampling before convolution.
If your data was processed with fMRIprep < 20.2.4, this is expected.
> In errorHandling (line 61)
In logger (line 90)
In setBatchSubjectLevelGLMSpec>returnSliceOrder (line 245)
In setBatchSubjectLevelGLMSpec (line 46)
In bidsFFX>setAction (line 244)
In bidsFFX (line 113)
In cliStats>runEstimate (line 110)
In cliStats (line 82)
In bidspm>executeAction (line 86)
In bidspm (line 26)
In run_univ_sub_glm_Task_ReadingSpeechMultimodal_native (line 35)
In run (line 91)
[13:06:05] bidspm - INFO
[13:06:05] bidspm - ERROR getAndCheckRepetitionTime
No repetition time found for filter:
- desc: {smth6}
- extension: {.nii.*}
- modality: {func}
- prefix: {}
- space: {individual}
- sub: {^blind01$}
- suffix: {bold}
- task: {MultimodalReadSpeech}
- target: {RepetitionTime}
Error getAndCheckRepetitionTime:noRepetitionTimeFound occurred:
- Error in errorHandling
line 57 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/messages/errorHandling.m
- Error in logger
line 70 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/messages/logger.m
- Error in getAndCheckRepetitionTime
line 63 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/bids/getAndCheckRepetitionTime.m
- Error in setBatchSubjectLevelGLMSpec
line 49 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/batches/stats/setBatchSubjectLevelGLMSpec.m
- Error in setAction
line 244 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/workflows/stats/bidsFFX.m
- Error in bidsFFX
line 113 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/workflows/stats/bidsFFX.m
- Error in runEstimate
line 110 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/cli/cliStats.m
- Error in cliStats
line 82 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/src/cli/cliStats.m
- Error in executeAction
line 86 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/bidspm.m
- Error in bidspm
line 26 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/lib/bidspm/bidspm.m
- Error in run_univ_sub_glm_Task_ReadingSpeechMultimodal_native
line 35 in /Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/src/bidspm-stats/run_univ_sub_glm_Task_ReadingSpeechMultimodal_native.m
- Error in run
line 91 in /Applications/MATLAB_R2019b.app/toolbox/matlab/lang/run.m
ERROR LOG SAVED:
/Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/outputs/derivatives/error_logs/error_2025-09-04T13-06.log
Use it when opening an issue:
https://github.com/cpp-lln-lab/bidspm/issues/new/choose.
Error using errorHandling (line 57)
[13:06:05] bidspm - ERROR getAndCheckRepetitionTime
No repetition time found for filter:
- desc: {smth6}
- extension: {.nii.*}
- modality: {func}
- prefix: {}
- space: {individual}
- sub: {^blind01$}
- suffix: {bold}
- task: {MultimodalReadSpeech}
- target: {RepetitionTime}\n
Error in logger (line 70)
errorHandling(filename, id, logMsg, false);
Error in getAndCheckRepetitionTime (line 63)
logger('ERROR', msg, 'filename', mfilename(), 'id', id);
Error in setBatchSubjectLevelGLMSpec (line 49)
TR = getAndCheckRepetitionTime(BIDS, filter);
Error in bidsFFX>setAction (line 244)
matlabbatch = setBatchSubjectLevelGLMSpec(matlabbatch, BIDS, opt, subLabel);
Error in bidsFFX (line 113)
matlabbatch = setAction('specify', matlabbatch, BIDS, opt, subLabel);
Error in cliStats>runEstimate (line 110)
bidsFFX('specifyAndEstimate', opt);
Error in cliStats (line 82)
runEstimate(isSubjectLevel, opt, nodeName);
Error in bidspm>executeAction (line 86)
cliStats(varargin{2:end});
Error in bidspm (line 26)
returnCode = executeAction(action, varargin{:});
Error in run_univ_sub_glm_Task_ReadingSpeechMultimodal_native (line 35)
bidspm(bids_dir, output_dir, 'subject', ...
Error in run (line 91)
evalin('caller', strcat(script, ';'));
Anything else?
Running the script with following code:
%%% Script for statistical univariate analysis with bidspm()
%%% to run, needs bidspm() installed and path added and saved.
clear;
clc;
%% initialize bidspm() for this matlab session
%bidspm in code/lib/bidspm
addpath(fullfile(pwd, '..','..','lib', 'bidspm'));
bidspm();
%% set up BIDS folders and path
%this_dir = fileparts(mfilename('fullpath'));
this_dir=('/Volumes/Slim_Reaper/Projects/analyses_MultimodalLanguageMVPA/code/src/bidspm-stats');
root_dir = fullfile(this_dir, '..', '..', '..');
output_dir = fullfile(root_dir, 'outputs','derivatives');
preproc_dir = fullfile(root_dir, 'outputs','derivatives', 'bidspm-preproc');
bids_dir = fullfile(root_dir, 'inputs','raw');
%% define sub and number of betas
%subject_label = {''}; % or 'sighted' for full sighted group or '' for EVERYONE
subject_label = {'blind01'}; %just for testing
%group = ;
model_file = fullfile(this_dir,'models', 'model-UNIV_individual_group_blocks_ReadSpeech.json');
%% subject level (use bold with 6 FWHM)
bidspm(bids_dir, output_dir, 'subject', ...
'participant_label', subject_label, ...
'action', 'stats', ...
'preproc_dir',preproc_dir,...
'model_file',model_file,...
'verbosity', 3, ...
'concatenate', false, ...
'space', {'individual'},...
'fwhm', 6);
only thing I changed from previous run was space, {individual} and space flag in the bids model.
Preproc was ran both for individual and IXI spaces and bold .jsons have the following structure:
sub-blind01_task-MultimodalReadSpeech_run-01_space-individual_desc-smth6_bold.json:
{
"Description": "RECOMMENDED",
"Sources": ["sub-blind01/sub-blind01_task-MultimodalReadSpeech_run-01_space-individual_desc-preproc_bold.nii"],
"RawSources": ["sub-blind01/sub-blind01_task-MultimodalReadSpeech_run-01_bold.nii.gz"],
"SpatialReference": [
["REQUIRED if no space entity or if non standard space RECOMMENDED otherwise"]
],
"SpmFilename": "s6sub-blind01_task-MultimodalReadSpeech_run-01_space-individual_desc-preproc_bold.nii"
}
In raw (which passes the as BIDS structure) the sub-blind01_task-MultimodalReadSpeech_run-01_bold.nii.gz has RepetitionTime field:
{
"Modality": "MR",
"MagneticFieldStrength": 3,
"ImagingFrequency": 123.218,
"Manufacturer": "Siemens",
"ManufacturersModelName": "TrioTim",
"InstitutionName": "Instytut Biologii Doswiadczalnej",
"InstitutionalDepartmentName": "Department",
"InstitutionAddress": "Pasteura 3,Warszawa,District,PL,02093",
"DeviceSerialNumber": "35454",
"StationName": "MRC35454",
"BodyPartExamined": "HEAD",
"PatientPosition": "HFS",
"ProcedureStepDescription": "HEAD 12ch^GPJM",
"SoftwareVersions": "syngo MR B17",
"MRAcquisitionType": "2D",
"SeriesDescription": "task-1back_loc_run-01",
"ProtocolName": "task-1back_loc_run-01",
"ScanningSequence": "EP",
"SequenceVariant": "SK",
"ScanOptions": "FS",
"SequenceName": "*epfid2d1_64",
"ImageType": [
"ORIGINAL",
"PRIMARY",
"M",
"ND",
"MOSAIC"
],
"NonlinearGradientCorrection": false,
"SeriesNumber": 6,
"AcquisitionTime": "15:37:19.160000",
"AcquisitionNumber": 1,
"SliceThickness": 3.5,
"SpacingBetweenSlices": 3.85,
"SAR": 0.19324,
"EchoTime": 0.03,
"RepetitionTime": 2,
"FlipAngle": 80,
"PartialFourier": 1,
"BaseResolution": 64,
"ShimSetting": [
7088,
-23630,
18821,
239,
-248,
170,
12,
0
],
"TxRefAmp": 405.41,
"PhaseResolution": 1,
"ReceiveCoilName": "HeadMatrix",
"CoilString": "t:HEA;HEP",
"PulseSequenceDetails": "%SiemensSeq%\\ep2d_bold",
"RefLinesPE": 24,
"CoilCombinationMethod": "Sum of Squares",
"MatrixCoilMode": "GRAPPA",
"PercentPhaseFOV": 100,
"PercentSampling": 100,
"PhaseEncodingSteps": 63,
"AcquisitionMatrixPE": 64,
"ReconMatrixPE": 64,
"BandwidthPerPixelPhaseEncode": 45.29,
"ParallelReductionFactorInPlane": 2,
"EffectiveEchoSpacing": 0.000344999,
"DerivedVendorReportedEchoSpacing": 0.000689998,
"TotalReadoutTime": 0.0217349,
"PixelBandwidth": 1776,
"DwellTime": 4.4e-06,
"PhaseEncodingDirection": "j-",
"SliceTiming": [
0,
0.0575,
0.115,
0.17,
0.2275,
0.285,
0.3425,
0.4,
0.4575,
0.515,
0.5725,
0.63,
0.6875,
0.745,
0.8025,
0.86,
0.9175,
0.975,
1.0325,
1.09,
1.145,
1.2025,
1.26,
1.3175,
1.375,
1.4325,
1.49,
1.5475,
1.605,
1.6625,
1.72,
1.7775,
1.835,
1.8925,
1.95
],
"ImageOrientationPatientDICOM": [
0.99365,
0.0953574,
0.0597246,
-0.0764572,
0.96166,
-0.263372
],
"ImageOrientationText": "Tra>Cor(-15.0)>Sag(4.7)",
"InPlanePhaseEncodingDirectionDICOM": "COL",
"ConversionSoftware": "dcm2niix",
"ConversionSoftwareVersion": "v1.0.20220720",
"Dcm2bidsVersion": "2.1.7",
"TaskName": "1back"
}
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working