Skip to content

Commit

Permalink
Merge branch '3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonclayden committed Mar 7, 2024
2 parents 5c95c5c + a1eab70 commit ddbcfe3
Show file tree
Hide file tree
Showing 65 changed files with 802 additions and 864 deletions.
60 changes: 54 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ defaults:
shell: bash

jobs:
# This workflow contains a single job called "check"
check:
# Main TractoR tests, on Linux only
integration-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -22,7 +22,7 @@ jobs:

steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -31,15 +31,19 @@ jobs:
with:
r-version: ${{ matrix.R }}

# igraph depends on glpk in the 2.0.x series, so this is required for deep testing
- name: Install upstream system dependencies
run: sudo apt-get install -y libglpk-dev

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: lib/R
key: ${{ runner.os }}-deps-${{ matrix.R }}-${{ hashFiles('lib/*/DESCRIPTION') }}

- if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
name: Install dependencies
- name: Install dependencies
if: ${{ steps.cache-deps.outputs.cache-hit != 'true' }}
run: make install-libs

- name: Install main packages
Expand All @@ -51,3 +55,47 @@ jobs:
- name: Generate debug test output
if: failure()
run: make dtest

# Standard R CMD check on tractor.base package (Linux and Windows)
base-check:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest ]
R: [ release, devel ]

runs-on: ${{ matrix.os }}

# No submodules needed in this case, as we'll install dependencies from CRAN
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: false

- name: Install and set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.R }}

- name: Parse and install dependencies
run: |
deps <- read.dcf(file.path("tractor.base","DESCRIPTION"), c("Depends","Imports","LinkingTo","Suggests","Enhances"))
deps <- na.omit(unlist(strsplit(deps, "\\s*,\\s*", perl=TRUE)))
deps <- setdiff(unique(sub("\\s*\\([^\\)]+\\)\\s*$", "", deps, perl=TRUE)), c("R", rownames(installed.packages())))
install.packages(deps)
shell: Rscript {0}

- name: Build package
run: R CMD build tractor.base

- name: Check package
run: R CMD check --no-manual tractor.base*tar.gz

# Upload the check directory as an artefact on failure
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-R${{ matrix.R }}-check
path: tractor.base.Rcheck
4 changes: 2 additions & 2 deletions COPYRIGHT.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
TractoR, its constituent R packages and command-line interface system, are copyright (C) 2005-2007 Jon Clayden, and (C) 2007-2023 University College London.
TractoR, its constituent R packages and command-line interface system, are copyright (C) 2005-2007 Jon Clayden, and (C) 2007-2024 University College London.

Copyright on all dependency packages (within the `lib` directory) is owned by their respective authors, as described in each package's `DESCRIPTION` file.

Standardised brain images in MNI space are copyright (C) 1993-2004 Louis Collins, McConnell Brain Imaging Centre, Montreal Neurological Institute, McGill University.

TractoR as a whole is licensed under the [GNU General Public Licence, version 2](http://www.gnu.org/licenses/gpl-2.0.html). Individual package licence terms are given in their respective `DESCRIPTION` files.
TractoR as a whole is licensed under the [GNU General Public Licence, version 2](http://www.gnu.org/licenses/gpl-2.0.html). Individual package licence terms are given in their respective `DESCRIPTION` and/or `LICENSE` files.

This copyright notice, or an equivalent one, must be retained in any redistribution of the software.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ install-libs: lib/.timestamp

check-and-install-libs: install-libs

lib/R/testthat:
@$(INSTALL) -c testthat
lib/R/tinytest:
@$(INSTALL) -c tinytest

lib/R/oro.nifti:
@$(INSTALL) -c oro.nifti
Expand Down Expand Up @@ -103,7 +103,7 @@ test:
dtest:
@cd tests && $(MAKE) debug-tests R=$(R)

utest: lib/R/testthat lib/R/oro.nifti lib/R/igraph
utest: lib/R/tinytest lib/R/oro.nifti lib/R/igraph
@$(ENV) TRACTOR_HOME=. bin/tractor -i -v0 tests/scripts/unit-test tractor.base
@$(ENV) TRACTOR_HOME=. bin/tractor -i -v0 tests/scripts/unit-test tractor.graph

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[![CI](https://github.com/tractor/tractor/actions/workflows/ci.yaml/badge.svg)](https://github.com/tractor/tractor/actions/workflows/ci.yaml) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.10010.svg)](http://dx.doi.org/10.5281/zenodo.10010)

TractoR is an [R-based](http://www.r-project.org) platform for medical image processing, tractography and graph analysis. It is focussed on handling magnetic resonance images, but many of its core functions are applicable to any kind of image. The package is full-stack free and open-source, as R is itself free software, and it is easy to extend and build upon. Downloads are available from the [project web site](http://www.tractor-mri.org.uk/downloads).
TractoR is an [R-based](http://www.r-project.org) platform for medical image processing, tractography and graph analysis. It is focussed on handling magnetic resonance images, but many of its core functions are applicable to any kind of image. The package is full-stack free and open-source, as R is itself free software, and it is easy to extend and build upon. Downloads are available from the [project web site](https://www.tractor-mri.org.uk/downloads).

## Overview

There are several sources of documentation available. For installation instructions, please see the `INSTALL.md` file. For general information on the package, its capabilities and conventions, please see the [TractoR paper](http://www.jstatsoft.org/v44/i08/) and/or the [project home page](http://www.tractor-mri.org.uk). The latter is mirrored in the TractoR distribution, and can be found at `share/doc/home.html`. Standard R documentation is available, function by function, for the core `tractor.base` package and all first- and third-party dependency packages (which are included in the main download).
There are several sources of documentation available. For installation instructions, please see the `INSTALL.md` file. For general information on the package, its capabilities and conventions, please see the [TractoR paper](https://www.jstatsoft.org/v44/i08/) and/or the [project home page](https://www.tractor-mri.org.uk). The latter is mirrored in the TractoR distribution, and can be found at `share/doc/home.html`. Standard R documentation is available, function by function, for the core `tractor.base` package and all first- and third-party dependency packages (which are included in the main download).

Please see below for information on

Expand Down Expand Up @@ -37,7 +37,7 @@ parc <- readImageFile("parcellation.nii.gz")
showImagesInViewer(t1, parc)
```

![Parcellation overlaid on brain](http://www.tractor-mri.org.uk/parcellation.png)
![Parcellation overlaid on brain](https://www.tractor-mri.org.uk/parcellation.png)

(with the `tractor.session` package loaded). Notice that both the numerical index and the name of the region currently under the crosshair is given in the info panel at the bottom right.

Expand All @@ -49,7 +49,7 @@ grad <- t1$copy()$map(function(x) dilate(x,k) - erode(x,k))
showImagesInViewer(grad)
```

![Morphological gradient of brain image](http://www.tractor-mri.org.uk/gradient.png)
![Morphological gradient of brain image](https://www.tractor-mri.org.uk/gradient.png)

Notice the use of the `map()` method, which can be used to replace the data in an image with the result of applying a function, in this case an anonymous function constructed within the call.

Expand Down Expand Up @@ -107,6 +107,6 @@ Running a particular script is a matter of typing `tractor`, followed by the scr
tractor graph-viz data/graph/diffusion ShowBrain:true
```

![Morphological gradient of brain image](http://www.tractor-mri.org.uk/graph.png)
![Morphological gradient of brain image](https://www.tractor-mri.org.uk/graph.png)

The examples in the previous section can be replicated in this way by using the `imageinfo` and `view` scripts. Try it! Further information on the `tractor` command is available from its `man` page, by typing `man tractor`.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
3.4.2

0 comments on commit ddbcfe3

Please sign in to comment.