Software versioning
Common software versioning patterns
Section titled “Common software versioning patterns”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 aMAJOR
.PATCH
field needs both others.
Additionally, a LABEL
can be suffixed to the version :
MAJOR
.
MINOR
.
PATCH
-PRERELEASE
: a pre-release version, wherePRERELEASE
is an alphanumeric string.MAJOR
.
MINOR
.
PATCH
+BUILD
: a build version, whereBUILD
is an alphanumeric string.MAJOR
.
MINOR
.
PATCH
-PRERELEASE+BUILD
: aPRERELEASE
version based on a specificBUILD
, with both alphanumeric strings.
Software version extraction
Section titled “Software version extraction”Below is a list of useful commands to extract valid semantic versions from common neuroimaging software :
antsRegistration --version \| grep "Version" \| sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/'
Fastsurfer
Section titled “Fastsurfer”$FASTSURFER_HOME/run_fastsurfer.sh --version
Freesurfer
Section titled “Freesurfer”mri_convert -version \| grep "freesurfer" \| sed -E 's/.* ([0-9.]+).*/\\1/'
flirt -version 2>&1 \| sed -E 's/.*version ([0-9.]+).*/\\1/'
ImageMagick
Section titled “ImageMagick”convert -version \| grep "Version:" \| sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/'
Mrtrix3
Section titled “Mrtrix3”mrinfo -version 2>&1 \| grep "== mrinfo" \| sed -E 's/== mrinfo ([0-9.]+).*/\\1/'
nii2dcm
Section titled “nii2dcm”convert_nii2dcm.py -v
Scilpy
Section titled “Scilpy”pip list --disable-pip-version-check --no-python-version-warning \| grep scilpy \| tr -s ' ' \| cut -d' ' -f2
uv pip list --disable-pip-version-check --no-python-version-warning \| grep scilpy \| tr -s ' ' \| cut -d' ' -f2