Commit d92cec46 authored by Sean Fitzgibbon's avatar Sean Fitzgibbon
Browse files

Updated readme

parent 24d8f069
# SlideR :hamburger: : Slide Registration tools
Collection of registration tools for microscopy.
Built upon the Tensor Image Registration Library: https://git.fmrib.ox.ac.uk/ihuszar/tirl
## Dependencies
You will need to download and install miniconda to manage the python environment:
https://docs.conda.io/en/latest/miniconda.html
## Installation
First clone TIRL:
```shell
git clone https://git.fmrib.ox.ac.uk/ihuszar/tirl.git
```
Create a virtual environment for SlideR:
```shell
conda env create -n slider -f tirl/tirlenv.yml
conda activate slider
```
Install TIRL:
```shell
cd tirl
python setup.py install
cd ..
```
Install SlideR:
```shell
git clone https://git.fmrib.ox.ac.uk/seanf/slider.git
pip install -e slider
```
## Usage
### Register 2D-slide to 2D-slide
You can register a 2D-slide to a 2D-slide using the `SLIDE` subcommand of the `slider_app.py` app.
```shell
>> slider_app.py SLIDE -h
usage: slider_app.py SLIDE [-h] [--out <dir>] [--config <config.json>]
<moving> <moving-resolution> <fixed> <fixed-resolution>
Register 2D slide to 2D slide
positional arguments:
<moving> Moving slide image
<moving-resolution> Moving image resolution (mm)
<fixed> Fixed slide image
<fixed-resolution> Fixed image resolution (mm)
optional arguments:
-h, --help show this help message and exit
--out <dir> Output directory
--config <config.json> configuration file
```
For example:
```shell
slider_app.py SLIDE \
mr247MBP_c24_s20a.jp2 0.0004 \
mr247NeuN_c01_s19n.jp2 0.0004 \
--out=mr247_mbp_to_neun.reg
```
### Apply transform to image
Once registered, you can apply the transform to the native image using the `APPLYXFM` subcommand of the `slider_app.py` app.
```shell
>> slider_app.py APPLYXFM -h
usage: slider_app.py APPLYXFM [-h] [--inverse]
<moving> <moving-resolution> <fixed> <fixed-resolution> <reg-moving>
<reg-fixed> <resampled-img>
Apply transform to image.
positional arguments:
<moving> Moving slide image
<moving-resolution> Moving image resolution (mm)
<fixed> Fixed slide image
<fixed-resolution> Fixed image resolution (mm)
<reg-moving> Moving timg from registration directory
<reg-fixed> Fixed timg from registration directory (e.g. fixed4_nonlinear.timg)
<resampled-img> Name for resampled output image
optional arguments:
-h, --help show this help message and exit
--inverse Invert the transformation chain
```
For example:
```shell
slider_app.py APPLYXFM \
mr247MBP_c24_s20a.jp2 0.0004 \
mr247NeuN_c01_s19n.jp2 0.0004 \
mr247_mbp_to_neun.reg/moving.timg \
mr247_mbp_to_neun.reg/fixed4_nonlinear.timg \
m4247_mbp_to_neun.jp2
```
Or the inverse:
```
slider_app.py APPLYXFM \
mr247NeuN_c01_s19n.jp2 0.0004 \
mr247MBP_c24_s20a.jp2 0.0004 \
mr247_mbp_to_neun.reg/moving.timg \
mr247_mbp_to_neun.reg/fixed4_nonlinear.timg \
m4247_neun_to_mbp.jp2 \
--inverse
```
### Register chart to slide
You can register a Neurolucida chart file to a 2D-slide using the `CHART` subcommand of the `slider_app.py` app.
```shell
>> slider_app.py CHART -h
usage: slider_app.py CHART [-h] [--out <dir>] <chart> <slide> <slide-resolution>
Register charting to 2D slide
positional arguments:
<chart> Neurolucida chart file
<slide> Fixed slide
<slide-resolution> Slide image resolution (mm)
optional arguments:
-h, --help show this help message and exit
--out <dir> Output directory
```
For example:
```shell
slider_app.py CHART \
mr250NeuN_c14_s03.ASC \
mr250NeuN_c14_s03n.jp2 0.0004 \
--out=mr250_chart_to_neun.reg
```
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment