You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeepSlice is a python library, published by [the McMullan Lab Group](https://researchers.mq.edu.au/en/persons/simon-mcmullan), which automatically aligns mouse histology with the allen brain atlas common coordinate framework.
21
+
It is the Masters project of [Harry Carey](https://github.com/PolarBean/). The alignments are viewable, and refinable, using the [QuickNII](https://www.nitrc.org/projects/quicknii "QuickNII") software package.
22
+
DeepSlice requires no preprocessing and works on any stain, however we have found it performs best on brightfield images.
23
+
At present one limitation is that it only works on Coronally cut sections, we will release an update in the future for sagittal and horizontally cut histology.
24
+

25
+
DeepSlice automates the process of identifying exactly where in the brain a section lies, it can accomodate non-orthogonal cutting planes and will produce an image specific annotation for each section in your brain.
26
+
## Web Application
27
+
If you would like to use DeepSlice but don't need your own personal installation, check out [**DeepSlice Flask**](https://www.DeepSlice.com.au), a fully functional web application which will allow you to upload your dataset and download the aligned results. The web interface was developed by [Michael Pegios](https://github.com/ThermoDev/).
28
+
## [Installation: How to install DeepSlice](#installation)
29
+
30
+
## [Usage: How to align using DeepSlice](#basic-usage)
31
+
## [For a jupyter notebook example check out](examples/example_notebooks/DeepSlice_example.ipynb)
32
+
33
+
**Happy Aligning :)**
34
+
35
+
36
+
<br>
37
+
38
+
39
+
<a name='Installation'></a>
40
+
<h1> Installation </h1>
41
+
<!-- This h2 must be bold -->
42
+
43
+
<h2 style="font-weight: bold; text-decoration: underline"> From PIP </h2>
44
+
This is the easy and recommended way to install DeepSlice.
45
+
46
+
```bash
47
+
pip install DeepSlice
48
+
```
49
+
And you're ready to go! 🚀
50
+
51
+
<h2 style="font-weight: bold; text-decoration: underline"> From Source </h2>
52
+
53
+
**First** To use DeepSlice you must have python3.7 installed. In order to easily install all the dependancies we recommend using [Anaconda](https://www.anaconda.com/products/individual "Anaconda Installation Files").
54
+
55
+
56
+
**Second** Once anaconda is installed, cd into your cloned DeepSlice directory, then cd into the 'conda_environments' directory, and use our premade environment files to setup your system.
57
+
```
58
+
cd DeepSlice/conda_environments
59
+
```
60
+
* **CPU Installation** For most users we recommend using the DS-CPU.yaml installation file. this will install all the dependencies required to run DeepSlice on your CPU.
61
+
Do this with the command:
62
+
63
+
conda env create -f DS-CPU.yml
64
+
65
+
66
+
* **GPU Installation** If you wish to run DeepSlice on a huge number of images, and have access to an nvidia GPU then please use the DS-GPU.yaml installation file.
67
+
68
+
conda env create -f DS-GPU.yml
69
+
70
+
**Finished :)** You are now ready to run DeepSlice. Just activate the environment using
71
+
```python
72
+
conda activate DS-CPU
73
+
```
74
+
or
75
+
```python
76
+
conda activate DS-GPU
77
+
```
78
+
If you run into any problems create a github issue and I will help you solve it.
79
+
80
+
<br>
81
+
82
+
<a name='BasicUsage'></a>
83
+
# Basic Usage
84
+
## On start
85
+
After cloning our repo and navigating into the directory open an ipython session and import our package.
86
+
```python
87
+
from DeepSlice import DSModel
88
+
```
89
+
Next, specify the species you would like to use and initiate the model.
90
+
```python
91
+
species = 'mouse' #available species are 'mouse' and 'rat'
92
+
93
+
Model = DSModel(species)
94
+
```
95
+
96
+
---
97
+
**Important**
98
+
99
+
* Sections in a folder must all be from the same brain
100
+
101
+
* DeepSlice uses all the sections you select to inform its prediction of section angle. Thus it is important that you do not include sections which lie outside of the Allen Brain Atlas. This include extremely rostral olfactory bulb and caudal medulla. **If you include these sections in your selected folder it will reduce the quality of all the predictions**.
102
+
103
+
* The sections do not need to be in any kind of order.
104
+
105
+
* The model downsamples images to 299x299, you do not need to worry about this but be aware that there is no benefit from using higher resolutions.
106
+
107
+
------
108
+
109
+
## Predictions
110
+
111
+
Now your model is ready to use, just direct it towards the folder containing the images you would like to align.
112
+
<br/> eg:
113
+
```bash
114
+
115
+
├── your_brain_folder
116
+
│ ├── brain_slice_1.png
117
+
│ ├── brain_slice_2.png
118
+
│ ├── brain_slice_3.png
119
+
```
120
+
In this parent directory there should be only one sub folder, in this example this is "your_brain_folder".
121
+
<br />To align these images using DeepSlice simply call
122
+
```python
123
+
folderpath = 'examples/example_brain/GLTa/'
124
+
#here you run the model on your folder
125
+
#try with and without ensemble to find the model which best works for you
126
+
#if you have section numbers included in the filename as _sXXX specify this :)
Copy file name to clipboardExpand all lines: README.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,11 @@ The alignments are viewable, and refinable, using the [QuickNII](https://www.nit
4
4
DeepSlice requires no preprocessing and works on any stain, however we have found it performs best on brightfield images.
5
5
At present one limitation is that it only works on Coronally cut sections, we will release an update in the future for sagittal and horizontally cut histology.
6
6

7
-
DeepSlice automates the process of identifying exactly where in the brain a section lies, it can accomodate non-orthogonal cutting planes and will produce an image specific annotation for each section in your brain.
7
+
DeepSlice automates the process of identifying exactly where in the brain a section lies, it can accomodate non-orthogonal cutting planes and will produce an image specific annotation for each section in your brain.
8
+
9
+
## Workflow
10
+
DeepSlice is fully integrated with the <ahref="https://quint-workflow.readthedocs.io/en/latest/QUINTintro.html" >QUINT workflow.</a> Quint helps you register, segment and quantify brain wide datasets!
11
+
8
12
## Web Application
9
13
If you would like to use DeepSlice but don't need your own personal installation, check out [**DeepSlice Flask**](https://www.DeepSlice.com.au), a fully functional web application which will allow you to upload your dataset and download the aligned results. The web interface was developed by [Michael Pegios](https://github.com/ThermoDev/).
10
14
## [Installation: How to install DeepSlice](#installation)
0 commit comments