Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Subpages

Child pages
depth1
allChildrentrue
style
sortAndReverse
first0

Install WSL

Use latest release of Ubuntu

(May not be needed) Set default user to be root (make life simpler with permissions): Start PowerShell => C: => ubuntu config --default-user root (details)

Open linux shell - Ubuntu app in Windows

Install conda

Code Block
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh

You have to view then agree to terms, then run install responding to various questions

Install ANTs

Code Block
conda create -n antsenv -c conda-forge ants -y   # create env and install ANTs
conda activate antsenv

Note: all sessions need to start with “conda activate antsenv” to access ANTs

Install FSL in same environment

In Ubuntu shell

Code Block
  # Go into ANTs environment
conda activate antsenv                 # <- your ANTs env is now on $PATH
  # Download the installer
wget -O fslinstaller.py https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/releases/fslinstaller.py
  # Run the installation
python3 fslinstaller.py --conda --prefix "$CONDA_PREFIX"

Important! When it asks: Where do you want to install FSL? [/usr/local/fsl/]:

type $CONDA_PREFIX/fsl

image-20250503-204001.pngImage Added

Now we need to set the initailization to point to fsl (in this “antsenv” environment)

Code Block
conda activate antsenv

cat > "$CONDA_PREFIX/etc/conda/activate.d/fsl.sh" <<'EOF'
export FSLDIR="${CONDA_PREFIX}/fsl"
source "${FSLDIR}/etc/fslconf/fsl.sh" >/dev/null
EOF

# ---------- deactivate ----------
cat > "$CONDA_PREFIX/etc/conda/deactivate.d/fsl.sh" <<'EOF'
# remove FSL from PATH and tidy
if command -v pathremove &>/dev/null; then
    pathremove "${FSLDIR}/bin"
fi
unset FSLDIR
EOF

These folders will be created (no need to create them):

Code Block
(antsenv) root@REDWSONFAC26495:~# mkdir ~/rats_mri_project/
(antsenv) root@REDWSONFAC26495:~# cd rats_mri_project/
(antsenv) root@REDWSONFAC26495:~/rats_mri_project# mkdir template
(antsenv) root@REDWSONFAC26495:~/rats_mri_project# mkdir priors
(antsenv) root@REDWSONFAC26495:~/rats_mri_project# mkdir subjects
(antsenv) root@REDWSONFAC26495:~/rats_mri_project# mkdir outputs
image-20250422-212331.png