Skip to content

Rules: Naming Conventions

Agah edited this page Mar 16, 2018 · 3 revisions

Class names:

Since the last qMRLab Hackathon, class names are composed of lowercase characters (e.g., vfa_t1, inversion_recovery, mt_sat, noise_level).

Although underscore can be considered to have a systematic separation for qmt methods (e.g. qmt_spgr, qmt_sirfse), it does not hold true for all models (e.g. mwf, inversion_recovery). Unless a systematic "separation by underscore" convention is defined:

i) Mimic previous names if your new model belongs to an existent family (e.g. qmt_newmt)

ii) If not, just simply use follow intuition.

Method/Function names:

Start with a lower case character, then follow CamelCase (e.g. getValue, downloadData)

There are exceptions to this. If function name starts with "qmr" then:
qMR + lowercase + CamelCase (e.g. qMRgenBatch, qMRlistModel etc.)

Avoid using white space at all times!

This rule holds true for class, function/method and variable naming.
False: myelin imaging
Correct: myelin_imaging

Sample Data names:

qMRLab makes use of automatically generated batch scripts for several purposes. These scripts are designed to fetch data from our online storage on OSF, based on the names described in MRIinputs property of the data e.g.:

MRIinputs = {'VFAData','B1map','Mask'};

When the property is assigned as given above, batch generation will download the data and look for the presence of files described by these names and two formats (*.nii and *.mat). In this regard, file names should respect one of the following options:

i) All files are in *.mat format

  • VFAData.mat
  • B1map.mat
  • Mask.mat

ii) All files are in *.nii format

  • VFAData.nii
  • B1map.nii
  • Mask.nii

iii) Heterogeneous file formats

  • VFAData.mat
  • B1map.mat
  • Mask.nii

If (iii) is the case, please ensure that when loaded by load_nii_data function, loaded image maps on *.mat images as intended.

Variable names:

Specific: