Skip to content

Software versioning

Versions have multiple fields, usually separated by dots ., sometimes hypens -, underscores _ or the plus sign +, though it is less common and their support is not universal. Fields usually takes on a number, but can also contain other alphanumeric characters.

A semantic version follows the pattern MAJOR.MINOR.PATCH. Fields are hierarchically mandatory :

  • MINOR field cannot be defined without a MAJOR.
  • PATCH field needs both others.

Additionally, a LABEL can be suffixed to the version :

  • MAJOR.MINOR.PATCH-PRERELEASE : a pre-release version, where PRERELEASE is an alphanumeric string.
  • MAJOR.MINOR.PATCH+BUILD : a build version, where BUILD is an alphanumeric string.
  • MAJOR.MINOR.PATCH-PRERELEASE+BUILD : a PRERELEASE version based on a specific BUILD, with both alphanumeric strings.

Below is a list of useful commands to extract valid semantic versions from common neuroimaging software :

Terminal window
antsRegistration --version \| grep "Version" \| sed -E 's/.*: v?([0-9.a-zA-Z-]+).*/\\1/'
Terminal window
$FASTSURFER_HOME/run_fastsurfer.sh --version
Terminal window
mri_convert -version | grep "freesurfer" | sed -E 's/.* ([0-9.]+).*/\\1/'
Terminal window
flirt -version 2>&1 | sed -E 's/.*version ([0-9.]+).*/\\1/'
Terminal window
convert -version | grep "Version:" | sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/'
Terminal window
mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/'
Terminal window
convert_nii2dcm.py -v
scilpy < 2.2.0
pip list --disable-pip-version-check --no-python-version-warning | grep scilpy | tr -s ' ' | cut -d' ' -f2
scilpy >= 2.2.0
uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2