Skip to content

Commit 3e58295

Browse files
committed
updated readMe to include QUINT
Former-commit-id: 61acfc8
1 parent 5b22dd0 commit 3e58295

File tree

3 files changed

+136
-3
lines changed

3 files changed

+136
-3
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ utilities/__pycache__/QuickNII_functions.cpython-37.pyc
1313
*.pyc
1414
DeepSlice/metadata/volumes/*.nii
1515
DeepSlice/metadata/weights/*.h5
16+
DeepSlice/metadata/weights/*.hdf5
1617
setup.py
1718
setup.cfg
1819
dist

Diff for: DeepSlice.egg-info/PKG-INFO

+130-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Metadata-Version: 2.1
22
Name: DeepSlice
3-
Version: 1.0.4
3+
Version: 1.0.5
44
Summary: A package to align histology to 3D brain atlases
55
Home-page: https://github.com/PolarBean/DeepSlice
6-
Download-URL: https://github.com/PolarBean/DeepSlice/archive/refs/tags/1.0.4.tar.gz
6+
Download-URL: https://github.com/PolarBean/DeepSlice/archive/refs/tags/1.0.5.tar.gz
77
Author: DeepSlice Team
88
Author-email: [email protected]
99
License: GPL-3.0
@@ -13,4 +13,132 @@ Classifier: Intended Audience :: Science/Research
1313
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
1414
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
1515
Classifier: Programming Language :: Python :: 3.7
16+
Description-Content-Type: text/markdown
1617
License-File: LICENSE
18+
19+
![Alt](docs/images/DeepSlice_github_banner.png "DeepSlice Banner")
20+
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+
![Alt](docs/images/process.PNG)
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 :)
127+
Model.predict(folderpath, ensemble=True, section_numbers=True)
128+
#If you would like to normalise the angles (you should)
129+
Model.propagate_angles()
130+
#To reorder your sections according to the section numbers
131+
Model.enforce_index_order()
132+
#alternatively if you know the precise spacing (ie; 1, 2, 4, indicates that section 3 has been left out of the series) Then you can use
133+
#Furthermore if you know the exact section thickness in microns this can be included instead of None
134+
Model.enforce_index_spacing(section_thickness = None)
135+
#now we save which will produce a json file which can be placed in the same directory as your images and then opened with QuickNII.
136+
Model.save_predictions(folderpath + 'MyResults')
137+
138+
139+
140+
```
141+
142+
143+
144+

Diff for: README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ The alignments are viewable, and refinable, using the [QuickNII](https://www.nit
44
DeepSlice requires no preprocessing and works on any stain, however we have found it performs best on brightfield images.
55
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.
66
![Alt](docs/images/process.PNG)
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 <a href="https://quint-workflow.readthedocs.io/en/latest/QUINTintro.html" >QUINT workflow.</a> Quint helps you register, segment and quantify brain wide datasets!
11+
812
## Web Application
913
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/).
1014
## [Installation: How to install DeepSlice](#installation)

0 commit comments

Comments
 (0)