Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/miss_hit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
pip3 install miss_hit
pip3 install -r requirements.txt

- name: Miss_hit code quality
- name: MISS_HIT Code style
run: |
mh_metric . --ci
mh_style --process-slx

- name: Miss_hit code style
- name: MISS_HIT Metrics
run: |
mh_style .
mh_metric --ci

- name: MISS_HIT Bug finder
run: |
mh_lint
2 changes: 1 addition & 1 deletion demos/sourceDataProcessing/batchSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
% defaceAnat(optSource); COMING SOON

% GZip the volumes in a raw folder
bidsGZipRawFolder(optSource, 0)
bidsGZipRawFolder(optSource, 0);
2 changes: 1 addition & 1 deletion demos/sourceDataProcessing/getOptionSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

% Set the folder where sequences folders exist
optSource.sourceDir = '/Users/barilari/Desktop/DICOM_UCL_leuven/renamed/sub-pilot001/ses-002/MRI';

optSource.dataDir = '/Users/barilari/Desktop/DICOM_UCL_leuven/raw';

% List of the sequences that you want to skip (folder name pattern)
Expand Down
6 changes: 3 additions & 3 deletions demos/spm_face_rep/face_rep_convert2BIDS.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function face_rep_convert2BIDS()
['sub-01_task-' strrep(task_name, ' ', '') '_bold.mat']));

%% And everything else
create_events_tsv_file(WD, task_name, repetition_time)
create_events_tsv_file(WD, task_name, repetition_time);
create_readme(WD);
create_changelog(WD);
create_datasetdescription(WD, opt);
Expand All @@ -62,7 +62,7 @@ function face_rep_convert2BIDS()
end

function create_events_tsv_file(WD, task_name, repetition_time)

% TODO
% add the lag between presentations of each item necessary for the parametric
% analysis.
Expand All @@ -86,7 +86,7 @@ function create_events_tsv_file(WD, task_name, repetition_time)
[onset_column, idx] = sort(onset_column);
duration_column = duration_column(idx);
trial_type_column = trial_type_column(idx, :);

onset_column = repetition_time * onset_column;

tsv_content = struct( ...
Expand Down
2 changes: 1 addition & 1 deletion demos/spm_face_rep/face_rep_run.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@
bidsFFX('specifyAndEstimate', opt, FWHM);
bidsFFX('contrasts', opt, FWHM);

%TODO
% TODO
bidsResults(opt, FWHM);
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Sphinx
sphinxcontrib-matlabdomain
sphinxcontrib-napoleon
sphinx_rtd_theme
miss_hit
miss_hit==0.9.15
4 changes: 2 additions & 2 deletions src/QA/anatomicalQA.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ function anatomicalQA(opt)
% :param opt: Options chosen for the analysis. See ``checkOptions()``.
% :type opt: structure
%

if isOctave()
warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.')
warning('\nanatomicalQA is not yet supported on Octave. This step will be skipped.');
end

% if input has no opt, load the opt.mat file
Expand Down
10 changes: 5 additions & 5 deletions src/QA/functionalQA.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ function functionalQA(opt)
% resliced to the dimension of the functional with ``bidsResliceTpmToFunc()``

if isOctave()
warning('\nfunctionalQA is not yet supported on Octave. This step will be skipped.')
warning('\nfunctionalQA is not yet supported on Octave. This step will be skipped.');
end

% if input has no opt, load the opt.mat file
if nargin < 1
opt = [];
Expand Down Expand Up @@ -123,10 +123,10 @@ function functionalQA(opt)
createDataDictionary(subFuncDataDir, fileName, size(confounds, 2));

% create carpet plot
% horrible hack to prevent the "abrupt" way spmup_volumecorr crashes

% horrible hack to prevent the "abrupt" way spmup_volumecorr crashes
% if nansum is not there
if exist('nansum','file') == 2
if exist('nansum', 'file') == 2
spmup_timeseriesplot(funcImage, TPMs(1, :), TPMs(2, :), TPMs(3, :), ...
'motion', 'on', ...
'nuisances', 'on', ...
Expand Down
6 changes: 3 additions & 3 deletions src/batches/setBatchComputeVDM.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
%
% :param matlabbatch: list of SPM batches
% :type matlabbatch: structure
% :param fmapType:
% :type fmapType:
% :param fmapType:
% :type fmapType:
% :param refImage: Reference image
% :type refImage:
% :type refImage:
%
% :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job
%
Expand Down
1 change: 0 additions & 1 deletion src/batches/setBatchReslice.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
% :returns: - :matlabbatch: (structure) The matlabbatch ready to run the spm job
%


printBatchName('reslicing');

if ischar(referenceImg)
Expand Down
10 changes: 5 additions & 5 deletions src/batches/setBatchSaveCoregistrationMatrix.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
%
% matlabbatch = setBatchSaveCoregistrationMatrix(matlabbatch, BIDS, subID, opt)
%
% :param matlabbatch:
% :param matlabbatch:
% :type matlabbatch: structure
% :param BIDS: BIDS layout returned by ``getData``.
% :type BIDS: structure
% :param subID:
% :param subID:
% :type subID:
% :param opt:
% :param opt:
% :type opt: Options chosen for the analysis. See ``checkOptions()``.
%
% :returns: - :matlabbatch:
%
% :returns: - :matlabbatch:
%

printBatchName('saving coregistration matrix');
Expand Down
12 changes: 6 additions & 6 deletions src/batches/setBatchSmoothConImages.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
%
% matlabbatch = setBatchSmoothConImages(group, funcFWHM, conFWHM, opt)
%
% :param group:
% :type group:
% :param funcFWHM:
% :param group:
% :type group:
% :param funcFWHM:
% :type funcFWHM:
% :param conFWHM:
% :param conFWHM:
% :type conFWHM:
% :param opt: Options chosen for the analysis. See ``checkOptions()``.
% :type opt:
%
% :type opt:
%
% :returns: - :matlabbatch:
%

Expand Down
2 changes: 1 addition & 1 deletion src/defaults/createDefaultModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
% opt = checkOptions(opt);
%
% [~, opt, BIDS] = getData(opt);
%
%
% createDefaultModel(BIDS, opt);
%

Expand Down
4 changes: 2 additions & 2 deletions src/defaults/createEmptyModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

function content = createEmptyModel()
%
% Creates the content of a basic model.json file for GLM analysis with
% some default options like high pass filter cut-off
% Creates the content of a basic model.json file for GLM analysis with
% some default options like high pass filter cut-off
% and the type of autocorrelation correction.
%
% USAGE::
Expand Down
12 changes: 6 additions & 6 deletions src/fieldmaps/getMetadataFromIntendedForFunc.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
fragments = bids.internal.parse_filename(filename);

funcMetadata = bids.query(BIDS, 'metadata', ...
'modality', 'func', ...
'type', fragments.type, ...
'sub', fragments.sub, ...
'ses', fragments.ses, ...
'run', fragments.run, ...
'acq', fragments.acq);
'modality', 'func', ...
'type', fragments.type, ...
'sub', fragments.sub, ...
'ses', fragments.ses, ...
'run', fragments.run, ...
'acq', fragments.acq);

end

Expand Down
16 changes: 8 additions & 8 deletions src/fieldmaps/getVdmFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
end

modalities = bids.query(BIDS, 'modalities', ...
'sub', fragments.sub, ...
'ses', fragments.ses);
'sub', fragments.sub, ...
'ses', fragments.ses);

if opt.useFieldmaps && any(ismember('fmap', modalities))
% We loop through the field maps and find the one that is intended for this
Expand All @@ -37,14 +37,14 @@
% We break the loop when the file has been found

fmapFiles = bids.query(BIDS, 'data', ...
'modality', 'fmap', ...
'sub', fragments.sub, ...
'ses', fragments.ses);
'modality', 'fmap', ...
'sub', fragments.sub, ...
'ses', fragments.ses);

fmapMetadata = bids.query(BIDS, 'metadata', ...
'modality', 'fmap', ...
'sub', fragments.sub, ...
'ses', fragments.ses);
'modality', 'fmap', ...
'sub', fragments.sub, ...
'ses', fragments.ses);

for iFile = 1:size(fmapFiles, 1)

Expand Down
10 changes: 5 additions & 5 deletions src/getData.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@
switch type
case 'bold'
metadata = bids.query(BIDS, 'metadata', ...
'task', opt.taskName, ...
'sub', subjects{1}, ...
'type', type);
'task', opt.taskName, ...
'sub', subjects{1}, ...
'type', type);
case 'T1w'
metadata = bids.query(BIDS, 'metadata', ...
'sub', subjects{1}, ...
'type', type);
'sub', subjects{1}, ...
'type', type);
end

if iscell(metadata)
Expand Down
22 changes: 11 additions & 11 deletions src/getInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
case 'sessions'

sessions = bids.query(BIDS, 'sessions', ...
'sub', subID, ...
'task', opt.taskName);
'sub', subID, ...
'task', opt.taskName);
nbSessions = size(sessions, 2);
if nbSessions == 0
nbSessions = 1;
Expand All @@ -56,10 +56,10 @@
session = varargin{1};

runs = bids.query(BIDS, 'runs', ...
'sub', subID, ...
'task', opt.taskName, ...
'ses', session, ...
'type', 'bold');
'sub', subID, ...
'task', opt.taskName, ...
'ses', session, ...
'type', 'bold');
nbRuns = size(runs, 2); % Get the number of runs

if nbRuns == 0
Expand All @@ -74,11 +74,11 @@
[session, run, type] = deal(varargin{:});

varargout = bids.query(BIDS, 'data', ...
'sub', subID, ...
'run', run, ...
'ses', session, ...
'task', opt.taskName, ...
'type', type);
'sub', subID, ...
'run', run, ...
'ses', session, ...
'task', opt.taskName, ...
'type', type);

otherwise
error('Not sure what info you want me to get.');
Expand Down
2 changes: 1 addition & 1 deletion src/setDerivativesDir.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
% :param opt: Options chosen for the analysis. See ``checkOptions()``.
% :type opt: structure
%
% :returns:
% :returns:
% - :opt: structure or json filename containing the options. See
% ``checkOptions()`` and ``loadAndCheckOptions()``.
%
Expand Down
6 changes: 3 additions & 3 deletions src/subject_level/convertOnsetTsvToMat.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
end

% assign all the tsv information to a variable called conds.
conds = t.trial_type;
conds = t.trial_type;

% identify where the conditions to include that are specificed
% in the run step of the model file
% identify where the conditions to include that are specificed
% in the run step of the model file
model = spm_jsonread(opt.model.file);

for runIdx = 1:numel(model.Steps)
Expand Down
14 changes: 7 additions & 7 deletions src/utils/validationInputFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,29 @@
% :param dir: Directory where the search will be conducted.
% :type dir: string
% :param fileName: file name pattern. Can be a regular expression except for
% the starting ``^`` and ending ``$``. For example:
% ``'sub-.*_ses-.*_task-.*_bold.nii'``.
% the starting ``^`` and ending ``$``. For example:
% ``'sub-.*_ses-.*_task-.*_bold.nii'``.
% :type fileName: string
% :param prefix: prefix to be added to the filename pattern. This can also be
% a regular expression (ish). For example ,f looking for the files that
% start with ``c1`` or ``c2`` or ``c3``, the prefix can be
% ``c[123]``.
% :type prefix: string
%
% :returns:
% :returns:
%
% :files: (string array) returns the fullpath file list of all the
% files matching the required pattern.
%
%
%
%
% See also: ``spm_select``.
%
%
% Example:
% %
% %
% % tissueProbaMaps = validationInputFile(anatDataDir, anatImage, 'c[12]');
%
%
%

if nargin < 3
prefix = '';
Expand Down
2 changes: 1 addition & 1 deletion src/workflows/bidsFFX.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function bidsFFX(action, opt, funcFWHM)
end

[BIDS, opt, group] = setUpWorkflow(opt, 'subject level GLM');

if isempty(opt.model.file)
opt = createDefaultModel(BIDS, opt);
end
Expand Down
Loading