Skip to content

Commit 34c19c3

Browse files
author
github-doc-action[bot]
committed
deploy: 9d502c9
1 parent 047710c commit 34c19c3

File tree

131 files changed

+3531
-2186
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+3531
-2186
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
git hook setup / CD
2+
===================
3+
4+
The FastSurfer team has developed a pre-commit hook script to help implement
5+
[Continuous Development and Testing](https://en.wikipedia.org/wiki/Continuous_testing).
6+
This CI/CD expands on github workflows executing them locally. They require a local
7+
[uv installation](https://docs.astral.sh/uv/getting-started/installation/) as described for FastSurfer's
8+
[Native installation](../overview/INSTALL.md#native-ubuntu-2004-or-ubuntu-2204).
9+
10+
Pre-commit Hook
11+
---------------
12+
13+
The pre-commit hook script will:
14+
1. Check for trailing white spaces in files
15+
2. Run ruff to verify python code formatting is valid
16+
3. Run codespell to check the spelling
17+
4. Run sphinx-build to rebuild the documentation into `FastSurfer/doc-build`
18+
Here, one important caveat for documentation editors is that sphinx-build may fail if the documentation file
19+
structure is changed, without first cleaning the autosummary/autodoc-generated files. To do this, delete the following
20+
directory `FastSurfer/doc/api/generated`.
21+
22+
### Installation
23+
To install the pre-commit hook, in the FastSurfer directory call
24+
```bash
25+
ln -s ../../tools/git-hooks/pre-commit .git/hooks/pre-commit
26+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Code of Conduct
2+
---------------
3+
4+
.. include:: ../../CODE_OF_CONDUCT.md
5+
:parser: fix_links.parser
6+
:relative-docs: .
7+
:relative-images:
8+
:start-line: 1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Contribution Guide
2+
------------------
3+
4+
.. include:: ../../CONTRIBUTING.md
5+
:parser: fix_links.parser
6+
:relative-docs: .
7+
:relative-images:
8+
:start-line: 1
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Contributor Guide
2+
=================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
GIT-HOOKS.md
8+
code_of_conduct
9+
contributing
10+
11+
This section of the documentation contains information for developers to set up FastSurfer for development.
12+
13+
For development, a native installation is recommended.
14+
15+
.. note::
16+
FastSurfer is very actively being developed and may currently change and update interfaces without warning.
17+
Our policy is to "mostly" keep interfaces fixed between major versions, but we have not implemented a deprecation
18+
policy yet.

dev/_sources/index.rst.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root `toctree` directive.
55
6+
Modified and updated by the David Kügler of the FastSurfer Team.
7+
68
.. image:: images/teaser.png
79
:alt: FastSurfer Teaser Image
810
:align: center
@@ -23,4 +25,5 @@
2325

2426
overview/index
2527
scripts/index
28+
developer/index
2629
api/index

dev/_sources/overview/CODE_OF_CONDUCT.md.txt

Lines changed: 0 additions & 78 deletions
This file was deleted.

dev/_sources/overview/CONTRIBUTING.md.txt

Lines changed: 0 additions & 106 deletions
This file was deleted.

dev/_sources/overview/EDITING.md.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ However, for your convenience, we allow manual edits in various stages of the Fa
55
These editing options include approaches that are inherited from FreeSurfer as well as some FastSurfer-specific editing options.
66

77
The provided editing options may be changed or extended in the future, also depending on requests from the community.
8-
Furthermore, we invite users to [contribute](CONTRIBUTING.md) such changes and/or datasets of paired MRI images and edited files to improve FastSurfer's neural networks.
8+
Furthermore, we invite users to [contribute](../../CONTRIBUTING.md) such changes and/or datasets of paired MRI images and edited files to improve FastSurfer's neural networks.
99

1010
## What are Edits?
1111

dev/_sources/overview/INSTALL.md.txt

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,23 @@ You also need a working version of python3.10 (we do not support other versions)
6969

7070
If you are using pip, make sure pip is updated as older versions will fail.
7171

72-
#### 2. Conda for python
72+
#### 2. uv for python
7373

74-
We recommend to install conda as your python environment. If you don't have conda on your system, an admin needs to install it:
74+
We recommend to install uv as your python environment and package manager. [uv](https://docs.astral.sh/uv/) is a very
75+
fast package manager, which makes managing different environments even easier. See
76+
[uv's documentation](https://docs.astral.sh/uv/getting-started/installation/) for more information on installation such
77+
as [autocompletion info](https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion).
7578

7679
```bash
77-
FORGE_VERSION=25.9.1-0 # find the recent miniforge version at https://github.com/conda-forge/miniforge/releases
78-
wget --no-check-certificate -qO ~/miniforge.sh https://github.com/conda-forge/miniforge/releases/download/${FORGE_VERSION}/Miniforge3-${FORGE_VERSION}-Linux-x86_64.sh
79-
chmod +x ~/miniforge.sh
80-
sudo ~/miniforge.sh -b -p /opt/miniforge && \
81-
rm ~/miniforge.sh
80+
wget -qO- https://astral.sh/uv/install.sh | sh
8281
```
8382

8483
#### 3. FastSurfer
8584
Get FastSurfer from GitHub. Here you can decide if you want to install the current experimental "dev" version (which can be broken) or the "stable" branch (that has been tested thoroughly):
8685

8786
```bash
87+
cd /path/to/install
88+
# FastSurfer will get cloned to /path/to/install/FastSurfer
8889
git clone --branch stable https://github.com/Deep-MI/FastSurfer.git
8990
cd FastSurfer
9091
```
@@ -94,26 +95,40 @@ cd FastSurfer
9495
Create a new environment and install FastSurfer dependencies:
9596

9697
```bash
97-
conda env create -f ./env/fastsurfer.yml
98-
conda activate fastsurfer
98+
# make sure you are in the FastSurfer directory!
99+
# create a .venv environment directory inside /path/to/install/FastSurfer with the FastSurfer dependencies
100+
# the minimum required python version is 3.10
101+
uv venv --python python3.12
102+
# download and install packages for the fastsurfer environment (implicitly read from requirements.txt)
103+
uv pip sync pyproject.toml
104+
```
105+
`uv` will also try to find the correct backend for your hardware, but you can manually specify the backend for testing:
106+
purposes:
107+
```bash
108+
# make sure you are in the FastSurfer directory!
109+
uv pip sync pyproject.toml --torch-backend cpu
110+
```
111+
You can now activate the FastSurfer environment with
112+
```bash
113+
source .venv/bin/activate
99114
```
100115

101-
If you do not have an NVIDIA GPU, you can create appropriate ymls on the fly with `python ./tools/Docker/install_env.py -m $MODE -i ./env/FastSurfer.yml -o ./fastsurfer_$MODE.yml`. Here `$MODE` can be for example `cpu`, see also `python ./tools/Docker/install_env.py --help` for other options like rocm or cuda versions. Finally, replace `./env/fastsurfer.yml` with your custom environment file `./fastsurfer_$MODE.yml`.
102-
If you only want to run the surface pipeline, use `./env/fastsurfer_reconsurf.yml`.
103-
104-
Next, add the fastsurfer directory to the python path (make sure you have changed into it already):
116+
Next, add the fastsurfer directory to the python path:
105117
```bash
118+
# make sure you are in the FastSurfer directory!
106119
export PYTHONPATH="${PYTHONPATH}:$PWD"
107120
```
108121

109122
This will need to be done every time you want to run FastSurfer, or you need to add this line to your `~/.bashrc` if you are using bash, for example:
110123
```bash
111-
echo "export PYTHONPATH=\"\${PYTHONPATH}:$PWD\"" >> ~/.bashrc
124+
# make sure you are in the FastSurfer directory!
125+
echo "export PYTHONPATH=\"\${PYTHONPATH}:$(pwd)\"" >> ~/.bashrc
112126
```
113127

114128
You can also download all network checkpoint files (this should be done if you are installing for multiple users):
115129
```bash
116-
python3 FastSurferCNN/download_checkpoints.py --all
130+
# make sure you are in the FastSurfer directory!
131+
python FastSurferCNN/download_checkpoints.py --all
117132
```
118133

119134
Once all dependencies are installed, you are ready to run the FastSurfer segmentation-only (!!) pipeline by calling ```./run_fastsurfer.sh --seg_only ....``` , see [Example 3](EXAMPLES.md#example-3-native-fastsurfer-on-subjectx-with-parallel-processing-of-hemis) for command line flags.
@@ -177,15 +192,15 @@ To install brew and then python3.10, execute the following in a Terminal:
177192
brew install [email protected]
178193
```
179194

180-
### 2. FastSurfer package
195+
#### 2. FastSurfer package
181196
From version 2.5 onward, FastSurfer ships a macOS installer package, which you can download from
182197
[github](https://github.com/Deep-MI/FastSurfer/releases/).
183198
There are package installers for both the Apple M-chip architecture (`arm64`) and for legacy Intel chips (`x86_64`).
184199
To install, double-click the installer and follow the installer instructions.
185200

186201
After installation, you can find the FastSurfer applet, its source code, and selected FreeSurfer executables in the `/Applications` folder.
187202

188-
### 3. Launching FastSurfer
203+
#### 3. Launching FastSurfer
189204

190205
To launch a configured FastSurfer terminal session, start the FastSurfer applet from Applications.
191206

dev/_sources/overview/index.rst.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ User Guide
1616
EDITING.md
1717
LONG.md
1818
SECURITY.md
19-
CODE_OF_CONDUCT.md
20-
CONTRIBUTING.md
2119
license

0 commit comments

Comments
 (0)