Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Documentation

on:
push:

permissions:
contents: write

concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: false

env:
FORCE_COLOR: 1

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v6

- name: Install dependencies
run: uv sync --group doc

- name: Install just
uses: extractions/setup-just@v3

- name: Restore TorchIO cached data
id: cache-torchio-data-restore
uses: actions/cache/restore@v4
with:
path: ~/.cache/torchio
key: ${{ runner.os }}-torchio-data

- name: Build docs
run: just build-docs

- name: Save TorchIO cached data
if: steps.cache-torchio-data-restore.outputs.cache-hit != 'true'
id: cache-torchio-data-save
uses: actions/cache@v4
with:
path: ~/.cache/torchio
key: ${{ steps.cache-torchio-data-restore.outputs.cache-primary-key }}

# Uploade to smokeshow if not on main branch
- name: Upload docs to smokeshow
if: github.ref != 'refs/heads/main'
run: |
rm ./docs/build/html/_images/*.gif
rm ./docs/build/html/_images/*.png
uvx smokeshow upload ./docs/build/html

# Upload to GitHub Pages if on main branch
- name: Upload artifacts using actions/upload-pages-artifact
if: github.ref == 'refs/heads/main'
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/build/html

deploy:
if: github.ref == 'refs/heads/main'

needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

runs-on: ubuntu-latest

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions docs/source/data/image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ structure.


.. autoclass:: ScalarImage
:members:

.. autoclass:: LabelMap

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dev = [
"pre-commit-uv==4.1.4",
]
doc = [
"distinctipy==1.3.4",
"einops==0.8.0",
"furo==2024.8.6",
"matplotlib==3.9.4",
Expand Down
3 changes: 0 additions & 3 deletions src/torchio/transforms/preprocessing/spatial/to_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,3 @@ class ToCanonical(ToOrientation):

.. _NiBabel docs about image orientation: https://nipy.org/nibabel/image_orientation.html
"""

def __init__(self, **kwargs):
super().__init__('RAS', **kwargs)
Loading