diff --git a/doc_build/main/user_guide/tools/manual_segmentation.md b/doc_build/main/user_guide/tools/manual_segmentation.md
index b7fe006..3d0c061 100644
--- a/doc_build/main/user_guide/tools/manual_segmentation.md
+++ b/doc_build/main/user_guide/tools/manual_segmentation.md
@@ -36,8 +36,6 @@ Run `manual_region_seg -h` to see all options.
`/home/analysis/cellfinder_output/registration/`)
##### The following options may also need to be used:
-* `--save-image` Store the resulting segmented region image (e.g. for
-inspecting in 2D. (default: False)
* `--preview` Preview the segmented regions in brainrender (default:False)
* `--debug` Debug mode. Will increase verbosity of logging and save all
intermediate files for diagnosis of software issues. (default: False)
@@ -51,17 +49,15 @@ take a few minutes) and then display the image in a
##### To segment regions:
-* Ensure that the "Regions" tab is selected (left hand side)
+* Ensure that the "new_region" tab is selected (left hand side)
+* Rename this region (by selecting the "new_region" text)
* Navigate to where you want to draw your region of interest.
* Use the scroll bar at the bottom (or left/right keys) to navigate
through the image stack
* Use the mouse scrollwheel to zoom in or out
* Drag with the mouse the pan the view
-* Select a label ID (by pressing the `+` button in the `label` row, top-left),
-the ID is not important, but `0` refers to no label, so you may as well start
-from 1.
-* Choose a brush size (also in top left box)
+* Choose a brush size (top left box)
* Activate painting mode (by selecting the paintbrush, top left). You can
go back to the navigation mode by selecting the magnifying glass.
* Colour in your region that you want to segment, ensuring that you make a
@@ -69,7 +65,16 @@ solid object.
* Selecting the `ndim` toggle in the top left will extend the brush size in
three dimensions (so it will colour in multiple layers).
+* To add a new region press `Control+N`
* Repeat above for each region you wish to segment.
+
* Press `Control+S` on your keyboard to save the regions. If you used the
`--preview flag`, once they are saved, they will be displayed in a brainrender
window.
+
+
+##### Editing regions:
+If you have already run `manual_region_seg`, and run it again, the segmented
+regions will be shown. You can edit them, and press `Control+S` to resave them.
+If you don't want to save any changes, press `Control+X` to exit. The regions
+ will still be previewed if you have selected that option.
\ No newline at end of file
diff --git a/docs/.buildinfo b/docs/.buildinfo
index eaba643..279e694 100644
--- a/docs/.buildinfo
+++ b/docs/.buildinfo
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
-config: ed007dbdf8172460ccc81a16ac8bf976
+config: 21f1b720085db93f2bf3fb4298a3bb15
tags: 645f666f9bcd5a90fca523b33c5a78b7
diff --git a/docs/_sources/main/user_guide/tools/manual_segmentation.md.txt b/docs/_sources/main/user_guide/tools/manual_segmentation.md.txt
index b7fe006..3d0c061 100644
--- a/docs/_sources/main/user_guide/tools/manual_segmentation.md.txt
+++ b/docs/_sources/main/user_guide/tools/manual_segmentation.md.txt
@@ -36,8 +36,6 @@ Run `manual_region_seg -h` to see all options.
`/home/analysis/cellfinder_output/registration/`)
##### The following options may also need to be used:
-* `--save-image` Store the resulting segmented region image (e.g. for
-inspecting in 2D. (default: False)
* `--preview` Preview the segmented regions in brainrender (default:False)
* `--debug` Debug mode. Will increase verbosity of logging and save all
intermediate files for diagnosis of software issues. (default: False)
@@ -51,17 +49,15 @@ take a few minutes) and then display the image in a
##### To segment regions:
-* Ensure that the "Regions" tab is selected (left hand side)
+* Ensure that the "new_region" tab is selected (left hand side)
+* Rename this region (by selecting the "new_region" text)
* Navigate to where you want to draw your region of interest.
* Use the scroll bar at the bottom (or left/right keys) to navigate
through the image stack
* Use the mouse scrollwheel to zoom in or out
* Drag with the mouse the pan the view
-* Select a label ID (by pressing the `+` button in the `label` row, top-left),
-the ID is not important, but `0` refers to no label, so you may as well start
-from 1.
-* Choose a brush size (also in top left box)
+* Choose a brush size (top left box)
* Activate painting mode (by selecting the paintbrush, top left). You can
go back to the navigation mode by selecting the magnifying glass.
* Colour in your region that you want to segment, ensuring that you make a
@@ -69,7 +65,16 @@ solid object.
* Selecting the `ndim` toggle in the top left will extend the brush size in
three dimensions (so it will colour in multiple layers).
+* To add a new region press `Control+N`
* Repeat above for each region you wish to segment.
+
* Press `Control+S` on your keyboard to save the regions. If you used the
`--preview flag`, once they are saved, they will be displayed in a brainrender
window.
+
+
+##### Editing regions:
+If you have already run `manual_region_seg`, and run it again, the segmented
+regions will be shown. You can edit them, and press `Control+S` to resave them.
+If you don't want to save any changes, press `Control+X` to exit. The regions
+ will still be previewed if you have selected that option.
\ No newline at end of file
diff --git a/docs/_static/basic.css b/docs/_static/basic.css
index b04360d..0119285 100644
--- a/docs/_static/basic.css
+++ b/docs/_static/basic.css
@@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js
index b33f87f..daccd20 100644
--- a/docs/_static/doctools.js
+++ b/docs/_static/doctools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -283,10 +283,11 @@ var Documentation = {
},
initOnKeyListeners: function() {
- $(document).keyup(function(event) {
+ $(document).keydown(function(event) {
var activeElementType = document.activeElement.tagName;
// don't navigate when in search box or textarea
- if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') {
+ if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT'
+ && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {
switch (event.keyCode) {
case 37: // left
var prevHref = $('link[rel="prev"]').prop('href');
diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js
index 4790c4d..2fa8c97 100644
--- a/docs/_static/documentation_options.js
+++ b/docs/_static/documentation_options.js
@@ -5,6 +5,7 @@ var DOCUMENTATION_OPTIONS = {
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
+ LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false
diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js
index 5266fb1..d2b4ee9 100644
--- a/docs/_static/language_data.js
+++ b/docs/_static/language_data.js
@@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js
index ad84587..ab56499 100644
--- a/docs/_static/searchtools.js
+++ b/docs/_static/searchtools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
- * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -63,6 +63,11 @@ var Search = {
htmlElement.innerHTML = htmlString;
$(htmlElement).find('.headerlink').remove();
docContent = $(htmlElement).find('[role=main]')[0];
+ if(docContent === undefined) {
+ console.warn("Content block not found. Sphinx search tries to obtain it " +
+ "via '[role=main]'. Could you check your theme or template.");
+ return "";
+ }
return docContent.textContent || docContent.innerText;
},
@@ -245,6 +250,8 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('
In all cases, please submit code to the main repository via a pull request.
+
#### Pull requests
+In all cases, please submit code to the main repository via a pull request.
Upon approval, please merge via “Squash and Merge” on Github to maintain a
clean commit history.
neuro uses Black to ensure a consistent
-code style. Please run black./-l79--target-versionpy37 before making
+
#### Formatting
+neuro uses [Black](https://github.com/python/black) to ensure a consistent
+code style. Please run black ./ -l 79 –target-version py37 before making
any commits. To prevent any errors, it is easier to add a formatting check
-as a pre-commit hook.
-E.g. on linux by adding this to your .git/hooks/pre-commit:
neuro uses pytest for testing. Please
-try to ensure that all functions are tested in tests/tests/unit_tests and
-all workflows/command-line tools are tested in tests/tests/unit_tests.
All commits & pull requests will be build by Travis.
-To ensure there are no issues, ensure that all tests run (pytest) and there
-are no formatting issues (black./-l79--target-versionpy37--check)
+as a [pre-commit hook](https://www.atlassian.com/git/tutorials/git-hooks).
+E.g. on linux by adding this to your .git/hooks/pre-commit:
+
+
black ./ -l 79 –target-version py37 –check || exit 1
+
+
#### Testing
+neuro uses [pytest](https://docs.pytest.org/en/latest/) for testing. Please
+try to ensure that all functions are tested in tests/tests/unit_tests and
+all workflows/command-line tools are tested in tests/tests/unit_tests.
+
#### Travis
+All commits & pull requests will be build by [Travis](https://travis-ci.com).
+To ensure there are no issues, ensure that all tests run (pytest) and there
+are no formatting issues (black ./ -l 79 –target-version py37 –check)
before pushing changes.
Travis will automatically release any tagged commit on the master branch.
+
#### Releases
+Travis will automatically release any tagged commit on the master branch.
Hence to release a new version of neuro, use either GitHub, or the git
CLI to tag the relevant commit and push to master.
neuro is (initially) designed as companion software to
-cellfinder and
-amap. These
-packages may depend on neuro and so the inverse should not be true. Any
+
[amap](https://github.com/SainsburyWellcomeCentre/amap-python). These
+packages may depend on neuro and so the inverse should not be true. Any
functionality in these packages necessary for neuro to work should be
extracted into another package such as
-imlib.
### Arguments
+Run points_to_brainrender -h to see all options.
+
#### Positional
+* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
+cells file to be converted
+* Output filename. Should end with ‘.h5’. If the containing directory doesn’t
+exist, it will be created.
+
#### The following options may also need to be used:
+* -x or –x-pixel-size Pixel spacing of the data that the cells are
+defined in, in the first dimension, specified in um. (Default: 10)
+* -y or –y-pixel-size Pixel spacing of the data that the cells are
+defined in, in the second dimension, specified in um. (Default: 10)
+* -z or –z-pixel-size Pixel spacing of the data that the cells are
+defined in, in the third dimension, specified in um. (Default: 10)
+* –max-z Maximum z extent of the atlas, specified in um. (Default: 13200)
+* –hdf-key HDF identifying key. If this has changed, it must be specified
+in the call to BrainRender.scene.Scene.add_cells_from_file()
+
### To visualise this file in BrainRender
+`python
+frombrainrender.sceneimportScene
+scene=Scene(jupyter=True)
+scene.add_cells_from_file("exported_cells.h5")
+scene.render()
+`
#### Positional arguments
+* [Cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)
+classified cells file (usually cell_classification.xml)
+* Output filename. Should end with ‘.nii’. If the containing directory doesn’t
+exist, it will be created.
+* Path to raw data (just a single channel). Used to find the shape of the
+raw image that the detected cell positions are defined in.
+* Registered atlas file from [amap](https://github.com/SainsburyWellcomeCentre)
#### Keyword arguments
+* -x or –x-pixel-size Pixel spacing of the data that the cells are
+defined in, in the first dimension, specified in um.
+* -y or –y-pixel-size Pixel spacing of the data that the cells are
+defined in, in the second dimension, specified in um.
+* -z or –z-pixel-size Pixel spacing of the data that the cells are
+defined in, in the third dimension, specified in um.
+
#### The following options may also need to be used:
+* –heatmap-bin Heatmap bin size (um of each edge of histogram cube)
+* –heatmap-smoothing Gaussian smoothing sigma, in um.
+* –no-mask-figs Don’t mask the figures (removing any areas outside the
+brain, from e.g. smoothing)
N.B. This tool depends (for now) on
-amap. Please
-run pipinstallamap and then amap_download before running this tool if
+[amap](https://github.com/SainsburyWellcomeCentre/amap). Please
+run `pip install amap` and then `amap_download` before running this tool if
you don’t already have cellfinder installed
Data must be registered to a standard atlas (currently only the
-Allen Reference Atlas is supported) using
-amap (or the amap
+
### Prerequisites
+Data must be registered to a standard atlas (currently only the
+[Allen Reference Atlas](http://mouse.brain-map.org/) is supported) using
+[amap](https://github.com/SainsburyWellcomeCentre/amap-python) (or the amap
based registration in
-cellfinder). Please
+[cellfinder](https://github.com/SainsburyWellcomeCentre/cellfinder)). Please
follow the instructions for these packages, and ensure that the channel that
-you want to segment is downsampled (e.g. using the --downsample flag in
+you want to segment is downsampled (e.g. using the –downsample flag in
amap).
#### Arguments
+Run manual_region_seg -h to see all options.
+
##### Positional arguments
+* Downsampled image to be segmented, as a string (e.g. “downsampled.nii”)
+* amap/cellfinder registration directory (e.g.
+/home/analysis/cellfinder_output/registration/)
+
##### The following options may also need to be used:
+* –preview Preview the segmented regions in brainrender (default:False)
+* –debug Debug mode. Will increase verbosity of logging and save all
+intermediate files for diagnosis of software issues. (default: False)
+
### napari GUI
+manual_region_seg will transform your image into standard space (this may
+take a few minutes) and then display the image in a
+[napari](https://github.com/napari/napari) viewer:
##### To segment regions:
+* Ensure that the “new_region” tab is selected (left hand side)
+* Rename this region (by selecting the “new_region” text)
+* Navigate to where you want to draw your region of interest.
+
+
+
Use the scroll bar at the bottom (or left/right keys) to navigate
go back to the navigation mode by selecting the magnifying glass.
+* Colour in your region that you want to segment, ensuring that you make a
+solid object.
+* Selecting the ndim toggle in the top left will extend the brush size in
+three dimensions (so it will colour in multiple layers).
-
Ensure that the “Regions” tab is selected (left hand side)
-
Navigate to where you want to draw your region of interest.
-
-
Use the scroll bar at the bottom (or left/right keys) to navigate
-through the image stack
-
Use the mouse scrollwheel to zoom in or out
-
Drag with the mouse the pan the view
-
-
-
Select a label ID (by pressing the + button in the label row, top-left),
-the ID is not important, but 0 refers to no label, so you may as well start
-from 1.
-
Choose a brush size (also in top left box)
-
Activate painting mode (by selecting the paintbrush, top left). You can
-go back to the navigation mode by selecting the magnifying glass.
-
Colour in your region that you want to segment, ensuring that you make a
-solid object.
-
Selecting the ndim toggle in the top left will extend the brush size in
-three dimensions (so it will colour in multiple layers).
+
To add a new region press Control+N
Repeat above for each region you wish to segment.
-
Press Control+S on your keyboard to save the regions. If you used the
---previewflag, once they are saved, they will be displayed in a brainrender
-window.
+
Press Control+S on your keyboard to save the regions. If you used the
-
-
-
-
+
+
–preview flag, once they are saved, they will be displayed in a brainrender
+window.
+
+
##### Editing regions:
+If you have already run manual_region_seg, and run it again, the segmented
+regions will be shown. You can edit them, and press Control+S to resave them.
+If you don’t want to save any changes, press Control+X to exit. The regions
+
+
will still be previewed if you have selected that option.