Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Jul 27, 2023
1 parent 43173fe commit 59f1838
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 80 deletions.
93 changes: 13 additions & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@
[![ci](https://github.com/FNNDSC/pl-bestsurfreg-surface-resample/actions/workflows/ci.yml/badge.svg)](https://github.com/FNNDSC/pl-bestsurfreg-surface-resample/actions/workflows/ci.yml)

`pl-bestsurfreg-surface-resample` is a [_ChRIS_](https://chrisproject.org/)
_ds_ plugin which takes in ... as input files and
creates ... as output files.
_ds_ plugin which does surface registration using MNI/CIVET tools.
The inputs are MNI `.obj` surfaces of either the left or right brain hemisphere.
For each surface, the registered vertex-wise data is produced as a `.txt` file,
as well as the intermediate `.sm` registration map file.

## Abstract
In its default configuration, it uses the average 29 gestational age
fetal brain template of the [Im Lab](https://research.childrenshospital.org/neuroim/)
to register a mask of the medial cut.

...
![before](img/before.png)
![after](img/after.png)

Figure: (Left) mask does not cover medial cut. (Right) mask is registered to cover the medial cut.

## Installation

Expand All @@ -25,85 +32,11 @@ To get started with local command-line usage, use [Apptainer](https://apptainer.
(a.k.a. Singularity) to run `pl-bestsurfreg-surface-resample` as a container:

```shell
apptainer exec docker://fnndsc/pl-bestsurfreg-surface-resample bsr2 [--args values...] input/ output/
apptainer exec docker://fnndsc/pl-bestsurfreg-surface-resample bsrr [--args values...] input/ output/
```

To print its available options, run:

```shell
apptainer exec docker://fnndsc/pl-bestsurfreg-surface-resample bsr2 --help
```

## Examples

`bsr2` requires two positional arguments: a directory containing
input data, and a directory where to create output data.
First, create the input directory and move input data into it.

```shell
mkdir incoming/ outgoing/
mv some.dat other.dat incoming/
apptainer exec docker://fnndsc/pl-bestsurfreg-surface-resample:latest bsr2 [--args] incoming/ outgoing/
```

## Development

Instructions for developers.

### Building

Build a local container image:

```shell
docker build -t localhost/fnndsc/pl-bestsurfreg-surface-resample .
```

### Running

Mount the source code `bsr2.py` into a container to try out changes without rebuild.

```shell
docker run --rm -it --userns=host -u $(id -u):$(id -g) \
-v $PWD/bsr2.py:/usr/local/lib/python3.11/site-packages/bsr2.py:ro \
-v $PWD/in:/incoming:ro -v $PWD/out:/outgoing:rw -w /outgoing \
localhost/fnndsc/pl-bestsurfreg-surface-resample bsr2 /incoming /outgoing
```

### Testing

Run unit tests using `pytest`.
It's recommended to rebuild the image to ensure that sources are up-to-date.
Use the option `--build-arg extras_require=dev` to install extra dependencies for testing.

```shell
docker build -t localhost/fnndsc/pl-bestsurfreg-surface-resample:dev --build-arg extras_require=dev .
docker run --rm -it localhost/fnndsc/pl-bestsurfreg-surface-resample:dev pytest
apptainer exec docker://fnndsc/pl-bestsurfreg-surface-resample bsrr --help
```

## Release

Steps for release can be automated by [Github Actions](.github/workflows/ci.yml).
This section is about how to do those steps manually.

### Increase Version Number

Increase the version number in `setup.py` and commit this file.

### Push Container Image

Build and push an image tagged by the version. For example, for version `1.2.3`:

```
docker build -t docker.io/fnndsc/pl-bestsurfreg-surface-resample:1.2.3 .
docker push docker.io/fnndsc/pl-bestsurfreg-surface-resample:1.2.3
```

### Get JSON Representation

Run [`chris_plugin_info`](https://github.com/FNNDSC/chris_plugin#usage)
to produce a JSON description of this plugin, which can be uploaded to a _ChRIS Store_.

```shell
docker run --rm localhost/fnndsc/pl-bestsurfreg-surface-resample:dev chris_plugin_info > chris_plugin_info.json
```

Binary file added img/after.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 59f1838

Please sign in to comment.