Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.01 KB

CONTRIBUTING.md

File metadata and controls

65 lines (46 loc) · 2.01 KB

Contributing guidelines

Feel free to open issues to report a bug and ask for improvements.

If you want to contribute, have a look at our contributing guidelines that are meant to guide you and help you get started. If something is not clear or you get stuck: it is more likely we did not do good enough a job at explaining things. So do not hesitate to open an issue, just to ask for clarification.

Style guidelines

We use camelCase to name functions and variables for the vast majority of the code in this repository.

Scripts names in general and as well functions related to the demos use a snake_case.

Constant are written in UPPERCASE.

Input arguments ordering

From more general to more specific

BIDS > opt > subject > session > run

  • BIDS (output from getData or bids.layout) restrict the set of possible analysis one can run to this BIDS data set
  • opt restricts this set even further
  • subject / session / run even more
% OK
varargout = getInfo(BIDS, opt, subLabel, info, varargin)

% not OK
varargout = getInfo(subLabel, BIDS, opt, info, varargin)

Output arguments ordering

Try to return them in order of importance first and in order of appearance otherwise.

Exceptions

If function creates or modifies a batch then matlabbatch is the first argin and first argout.

If a function performs an "action" to be chosen from a one of several strings (with a switch statement), this string comes as first argin or second if matlabbatch is first.

% OK
varargout = getInfo('filename', BIDS, opt, subID, varargin)
[matlabbatch, voxDim] = setBatchRealign(matlabbatch, [action = 'realign',] BIDS, opt, subID)

% not OK
% 'filename' is the name of the "action" or the info to get in this case
% batch and action should go first
varargout = getInfo(BIDS, opt, subID, 'filename', varargin)
[matlabbatch, voxDim] = setBatchRealign(BIDS, opt, subID, matlabbatch, [action = 'realign'])