Skip to content
This repository has been archived by the owner on Oct 6, 2021. It is now read-only.

Commit

Permalink
bump (#27)
Browse files Browse the repository at this point in the history
* points to brainrender

* update testing

* refactor

* refactor

* badges

* notes

* initial inj finder commit (#11)

* formatting with black

* add .DS_store to gitignore

* typo

* update imports

* update imports

* deal with no obj path given

* error typo

* move utils too imlib

* remove amap imports

* optional logging to file

* tidy

* registration moved to imlib

* keep largest object

* reduce RAM usage

* remove unnecessary logging args

* adds lesion and track estimation and generic tools

* add missing dir support for cell export

* add missing dir support for cell export

* reduce mem requirements

* remove old code

* remove old code

* refactor scaling

* fix failing heatmap test

* update docs

* ensure output directory exists

* make pixel sizes mandatory

* make pixel sizes mandatory (#17)

* move functionality to imlib

* remove hard coded smoothing

* Refactor (#19)

* make pixel sizes mandatory

* move functionality to imlib

* remove hard coded smoothing

* update docs

* Injectionsite (#20)

* refactors code from SL to import from neuro and imlib only

* moves amap_vis to neuro and removes amap and cellfinder dependencies;

* format with black

* amap_vis

* bump

* remove cellfinder dependency

* cli entry point for fibre track segmentation

* refactor seg tools

* start manual seg

* remove hardocoding in manual region segmentation

* refactor paths

* bump

* update docs

* update docs

* update docs

* update docs

* support multiple objects

* color objects

* bump

* update reqs

* improve rendering of flat objects

* bump

* prevent saving unnecessary common volume

* allow ROIs to be edited

* label regions

* bump

* bump

Co-authored-by: Federico Claudi <[email protected]>
Co-authored-by: stephen <[email protected]>
  • Loading branch information
3 people authored Apr 22, 2020
1 parent 2e02dd2 commit 33573d5
Show file tree
Hide file tree
Showing 20 changed files with 382 additions and 463 deletions.
19 changes: 12 additions & 7 deletions doc_build/main/user_guide/tools/manual_segmentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -51,25 +49,32 @@ take a few minutes) and then display the image in a
<img src="https://raw.githubusercontent.com/SainsburyWellcomeCentre/neuro/master/resources/manual_segmentation_window.png" alt="manual_seg_window" width="700"/>

##### 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
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.
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -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
19 changes: 12 additions & 7 deletions docs/_sources/main/user_guide/tools/manual_segmentation.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -51,25 +49,32 @@ take a few minutes) and then display the image in a
<img src="https://raw.githubusercontent.com/SainsburyWellcomeCentre/neuro/master/resources/manual_segmentation_window.png" alt="manual_seg_window" width="700"/>

##### 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
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.
2 changes: 1 addition & 1 deletion docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
*/
Expand Down
7 changes: 4 additions & 3 deletions docs/_static/doctools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
*/
Expand Down Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/language_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
*/
Expand Down
25 changes: 17 additions & 8 deletions docs/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
*/
Expand Down Expand Up @@ -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;
},

Expand Down Expand Up @@ -245,6 +250,8 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
// dirhtml builder
var dirname = item[0] + '/';
Expand All @@ -253,23 +260,25 @@ var Search = {
} else if (dirname == 'index/') {
dirname = '';
}
listItem.append($('<a/>').attr('href',
DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
highlightstring + item[2]).html(item[1]));
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + dirname;
linkUrl = requestUrl;

} else {
// normal html builders
listItem.append($('<a/>').attr('href',
item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
highlightstring + item[2]).html(item[1]));
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
}
listItem.append($('<a/>').attr('href',
linkUrl +
highlightstring + item[2]).html(item[1]));
if (item[3]) {
listItem.append($('<span> (' + item[3] + ')</span>'));
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX,
$.ajax({url: requestUrl,
dataType: "text",
complete: function(jqxhr, textstatus) {
var data = jqxhr.responseText;
Expand Down
19 changes: 6 additions & 13 deletions docs/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@


<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>

<script type="text/javascript" src="_static/js/theme.js"></script>

Expand Down Expand Up @@ -79,15 +79,8 @@



<ul>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/cells_to_brainrender.html">Converting cells from cellfinder to brainrender format</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/heatmap.html">Heatmap generation</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/manual_segmentation.html">Manual segmentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="main/dev/CONTRIBUTING.html">Contributing</a></li>
</ul>

<!-- Local TOC -->
<div class="local-toc"></div>


</div>
Expand Down
36 changes: 15 additions & 21 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@


<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>

<script type="text/javascript" src="_static/js/theme.js"></script>

Expand All @@ -35,7 +35,7 @@
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Converting cells from cellfinder to brainrender format" href="main/user_guide/tools/cells_to_brainrender.html" />
<link rel="next" title="&lt;no title&gt;" href="main/user_guide/tools/cells_to_brainrender.html" />
</head>

<body class="wy-body-for-nav">
Expand Down Expand Up @@ -79,15 +79,17 @@



<ul>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/cells_to_brainrender.html">Converting cells from cellfinder to brainrender format</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/heatmap.html">Heatmap generation</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/manual_segmentation.html">Manual segmentation</a></li>
<!-- Local TOC -->
<div class="local-toc"><ul>
<li><a class="reference internal" href="#">neuro</a><ul>
<li><a class="reference internal" href="#introduction">Introduction:</a></li>
<li><a class="reference internal" href="#installation">Installation:</a></li>
<li><a class="reference internal" href="#tools">Tools</a></li>
<li><a class="reference internal" href="#developers">Developers</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="main/dev/CONTRIBUTING.html">Contributing</a></li>
</li>
</ul>

</div>


</div>
Expand Down Expand Up @@ -165,19 +167,11 @@ <h2>Installation:<a class="headerlink" href="#installation" title="Permalink to
<div class="section" id="tools">
<h2>Tools<a class="headerlink" href="#tools" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/cells_to_brainrender.html">Converting cells from cellfinder to brainrender format</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/heatmap.html">Heatmap generation</a></li>
<li class="toctree-l1"><a class="reference internal" href="main/user_guide/tools/manual_segmentation.html">Manual segmentation</a></li>
</ul>
</div>
</div>
<div class="section" id="developers">
<h2>Developers<a class="headerlink" href="#developers" title="Permalink to this headline"></a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="main/dev/CONTRIBUTING.html">Contributing</a></li>
</ul>
</div>
</div>
</div>
Expand All @@ -190,7 +184,7 @@ <h2>Developers<a class="headerlink" href="#developers" title="Permalink to this

<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">

<a href="main/user_guide/tools/cells_to_brainrender.html" class="btn btn-neutral float-right" title="Converting cells from cellfinder to brainrender format" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="main/user_guide/tools/cells_to_brainrender.html" class="btn btn-neutral float-right" title="&lt;no title&gt;" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>


</div>
Expand Down
Loading

0 comments on commit 33573d5

Please sign in to comment.