Skip to content

Instantly share code, notes, and snippets.

@0187773933
Last active November 26, 2024 16:45
Show Gist options
  • Save 0187773933/d67848eed6e08821922f43e652a5aca0 to your computer and use it in GitHub Desktop.
Save 0187773933/d67848eed6e08821922f43e652a5aca0 to your computer and use it in GitHub Desktop.
CoNNECT Docs Build Env Setup

Setup Python

git clone https://github.com/mattsherwood87/CoNNECT
cd CoNNECT/
/Users/morpheous/.pyenv/versions/3.9.19/bin/python3 -m venv venv
source venv/vin/activate
pip install httplib2 pymeshlab pymysql nipype pycondor sphinx pandas sphinx_adc_theme sphinx_rtd_theme sphinx-argparse setuptools sphinxcontrib-autoprogram
Install FSL

https://fsl.fmrib.ox.ac.uk/fsl/docs/#/install/macos

download fslinstaller.py

python fslinstaller.py
export FSLDIR=/Users/morpheous/TMP2/CoNNECTNew/CoNNECT/fsl
Install FreeSurfer

https://surfer.nmr.mgh.harvard.edu/fswiki/BuildGuide

https://surfer.nmr.mgh.harvard.edu/fswiki/BuildRequirements

git clone https://github.com/freesurfer/freesurfer.git
cd freesurfer
git remote add datasrc https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/repo/annex.git
git fetch datasrc
git-annex get .
brew upgrade gcc5 cmake tcsh libomp
curl https://surfer.nmr.mgh.harvard.edu/pub/data/fspackages/prebuilt/osx10.11-packages.tar.gz -o osx10.11-packages.tar.gz
tar -xzvf osx10.11-packages.tar.gz
cd packages/
python3 build_packages.py . --no-petsc --no-vtk
cd ..
cmake . -DCMAKE_INSTALL_PREFIX="/Users/morpheous/APPLICATIONS_2/freesurfer/build" -DFS_PACKAGES_DIR="/Users/morpheous/APPLICATIONS_2/freesurfer/packages" BUILD_GUIS=OFF
export FREESURFER_HOME="/usr/local/bin"

Add Backsupport for < 3.10

from typing import Union
  • edit copy_dirs.py
    • def copy_dirs(INDIR: Union[str, list], OUTDIR: str, *args, **kwargs):
  • and _mysql.py
    • in function defs : Union[str, list] = None

Build Docs

latex_elements = {
    'preamble': r'''
\usepackage{caption}
\renewcommand{\rmdefault}{cmr} % Use Computer Modern Roman as a fallback
\renewcommand{\sfdefault}{cmss} % Use Computer Modern Sans Serif
\renewcommand{\ttdefault}{cmtt} % Use Computer Modern Typewriter
    '''
}
brew install --cask mactex
sudo tlmgr update --self
sudo tlmgr update --all
sudo tlmgr install fontawesome5
sudo tlmgr install hypcap
export FSLDIR=/Users/morpheous/TMP2/CoNNECTNew/CoNNECT/fsl && \
export FREESURFER_HOME="/usr/local/bin" && \
export LATEXMKOPTS="-f -xelatex -interaction=nonstopmode" && \
sphinx-build -M html ./docs/source ../build/html -v && \
sphinx-build -M latexpdf ./docs/source ./build/latex -v && \
sphinx-build -b epub ./docs/source ./build/latex -v

Misc

sphinx-apidoc -o build/source helper_functions/
sphinx-build -b html build/source build/html
cp docs/source/conf.py build/source/
cp -r docs/source/links/ build/source/

https://github.com/rordenlab/dcm2niix

https://github.com/nipy/nipype

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment