Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

final link-fixing/rename to brainglobe-segmentation #98

Merged
merged 2 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# brainreg-segment
# brainglobe-segmentation


brainreg-segment is a companion to [brainreg](../brainreg/index) allowing manual segmentation of regions/objects
brainglobe-segmentation is a companion to [brainreg](../brainreg/index) allowing manual segmentation of regions/objects
within the brain (e.g. injection sites, probes etc.) allowing for automated analysis of brain region distribution,
and visualisation (e.g. in [brainrender](../brainrender/index)).

## Installation

brainreg-segment comes bundled with brainreg, so see the [brainreg installation instructions](../brainreg/installation).
brainreg-segment can be installed on its own (see below), but you will need to register your data with brainreg first.
brainglobe-segmentation comes bundled with brainreg's optional `napari` dependency, so see the [brainreg installation instructions](../brainreg/installation).
brainglobe-segmentation can be installed on its own (see below), but you will need to register your data with brainreg first.

### Standalone installation

If you don't want to install brainreg, brainreg-segment can be installed on its own. brainreg-segment is
If you don't want to install brainreg, brainglobe-segmentation can be installed on its own. brainglobe-segmentation is
distributed as a plugin for [napari](https://napari.org/), so first follow the
[napari installation instructions](https://napari.org/). You can then install `brainreg-segment` from the
[napari installation instructions](https://napari.org/). You can then install `brainglobe-segmentation` from the
napari plugin menu.

![Installing from the napari plugin menu](images/install_plugin.png)

Alternatively, the plugin can be installed into a Python environment with `pip install brainreg-segment`.
Alternatively, the plugin can be installed into a Python environment with `pip install brainglobe-segmentation`.


## User guide
Expand All @@ -34,7 +34,7 @@ user-guide/analysing-external-segmentation

## Citation

If you find brainreg-segment useful and use it in your research, please let us know and also cite the paper:
If you find brainglobe-segmentation (formerly brainreg-segment) useful and use it in your research, please let us know and also cite the paper:

> Tyson, A. L., Vélez-Fort, M., Rousseau, C. V., Cossell, L., Tsitoura, C., Lenzi, S. C., Obenhaus, H. A., Claudi, F., Branco, T., Margrie, T. W. (2022). Accurate determination of marker location within whole-brain microscopy images. Scientific Reports, 12, 867 [doi.org/10.1038/s41598-021-04676-9](https://doi.org/10.1038/s41598-021-04676-9)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ Plugins exist to segment
many features common to biomedical images, and their results can be incorporated with BrainGlobe to analyse
the distribution of features of interest within the context of an anatomical atlas.

To be compatible with `brainreg-segment`, the third-party napari plugin must be able to take a 3D image layer as
To be compatible with `brainglobe-segmentation`, the third-party napari plugin must be able to take a 3D image layer as
input and return one of:
- A 3D labels layer with either a 2 or 3D region labeled (e.g., segmenting bulk axonal projections)
- A 3D points layer with a series of points corresponding to a trajectory through 3D space

:::{hint}
It is possible to segment structures outside the `brainreg-segment` plugin and import them in later (e.g., by
saving to a `.tiff` and reloading). However, it is simpler to load the data using `brainreg-segment` and then segment
It is possible to segment structures outside the `brainglobe-segmentation` plugin and import them in later (e.g., by
saving to a `.tiff` and reloading). However, it is simpler to load the data using `brainglobe-segmentation` and then segment
it using a third-party plugin. This ensures that the coordinate spaces you are using are consistent.
:::

Expand All @@ -25,7 +25,7 @@ it using a third-party plugin. This ensures that the coordinate spaces you are u
- Open napari
- Install the napari plugin you require to segment your data. To find out which plugins are available, see the
[napari hub](https://www.napari-hub.org/).
- [Load your data using the `brainreg-segment` plugin](/documentation/brainreg-segment/user-guide/index)
- [Load your data using the `brainglobe-segmentation` plugin](/documentation/brainglobe-segmentation/user-guide/index)
- Use the plugin to segment your feature of interest. Ensure it returns a 3D labels or points layer.

:::{hint}
Expand All @@ -48,8 +48,8 @@ At this point you could load a layer segmented previously and saved to disk
![Highlighting a specific layer](../images/layerlist.png)

- Click either the `Add track from selected layer` or `Add region from selected layer` button as applicable. This will
add the region/points from the layer to the `brainreg-segment` analysis list (in the same way as if it had been
analysed manually within `brainreg-segment`).
add the region/points from the layer to the `brainglobe-segmentation` analysis list (in the same way as if it had been
analysed manually within `brainglobe-segmentation`).
- Follow the instructions for either:
- [1D track analysis](segmenting-1d-tracks)
- [2/3D region analysis](segmenting-3d-structures)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ downsampled (e.g., using the `--downsample` flag in brainreg).
# Usage

To load the software, firstly open napari (typically by typing `napari` into your command window). You can then
load `brainreg-segment` by navigating to `Plugins` -> `Add Dock Widget` and selecting `brainreg-segment`.
load `brainglobe-segmentation` by navigating to `Plugins` -> `Add Dock Widget` and selecting `brainglobe-segmentation`.

The plugin will then open, with some options for loading data:

![brainreg interface](../images/brainreg-segment.webp)
![brainreg interface](../images/brainglobe-segmentation.webp)

## **To load your data**

Expand Down
5 changes: 3 additions & 2 deletions docs/source/documentation/brainreg/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Whichever interface you use, the results will be identical.
:::{admonition} Installing the napari plugin
:class: dropdown
* [Make sure you have napari installed](https://napari.org/stable/tutorials/fundamentals/installation.html)
* Install the brainreg-napari plugin from within napari (`Plugins` -> `Install/Uninstall Package(s)`, choosing `brainreg-napari`).)
* Install the brainreg napari plugin from within napari (`Plugins` -> `Install/Uninstall Package(s)`, choosing `brainreg`).)

:::{note}
If you are using macOS, you will need to install the plugin using the
command line (`conda install -c conda-forge brainreg-napari`)
command line (`conda install -c conda-forge brainreg`)
:::

:::{admonition} Installing the command line tool
Expand Down Expand Up @@ -49,6 +49,7 @@ Remember to activate your conda environment before doing anything
```

### Using conda (recommended)
This includes the napari plugin.

```bash
conda install -c conda-forge brainreg
Expand Down
4 changes: 2 additions & 2 deletions docs/source/documentation/brainreg/user-guide/output-files.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Output files

brainreg will create a number of output files. Many of these are for use with other software (e.g., brainreg-segment
brainreg will create a number of output files. Many of these are for use with other software (e.g., brainglobe-segmentation
and cellfinder), but they may be useful for your own software.

:::{note}
Expand All @@ -9,7 +9,7 @@ N.B. This is not an exhaustive list, as brainreg has many options which may crea

* `boundaries.tiff` - A 3D tiff image of the atlas boundaries, transformed to the space of the raw data.
* `brainreg_DATE_TIME.log` - A log file detailing the registration process. Useful for debugging and raising issues.
* `brainreg.json` - A record of all the input parameters, used by other software, e.g. brainreg-segment.
* `brainreg.json` - A record of all the input parameters, used by other software, e.g. brainglobe-segmentation.
* `deformation_field_0.tiff` - A 3D tiff describing the deformation from raw data space to atlas space, in the first
dimension (based on the supplied orientation and voxel sizes).
* `deformation_field_1.tiff` - Deformation in the second dimension.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ setting-up/index
bg-atlasapi/index
bg-space/index
brainreg/index
brainreg-segment/index
brainglobe-segmentation/index
brainrender/index
cellfinder/index
morphapi/index
Expand Down
2 changes: 1 addition & 1 deletion docs/source/publications.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Publications

Brainreg & brainreg-segment:
Brainreg & brainglobe-segmentation (formerly brainreg-segment):
> Tyson, A. L., Vélez-Fort, M., Rousseau, C. V., Cossell, L., Tsitoura, C., Lenzi, S. C., Obenhaus, H. A., Claudi, F., Branco, T., Margrie, T. W. (2022) “Accurate determination of marker location within whole-brain microscopy images" Scientific Reports, [doi.org/10.1038/s41598-021-04676-9](https://doi.org/10.1038/s41598-021-04676-9)

3D cell detection:
Expand Down
10 changes: 5 additions & 5 deletions docs/source/tutorials/silicon-probe-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ micromanipulator, and the probe tip lowered to touch the surface of the brain (e
This position is recorded as position “zero”. The probe is then introduced in the brain at a speed of \~10μm
per second to the desired penetration depth (in our case 1750μm; **Fig. 1**, centre).

![Figure 1.](./images/brainreg-segment-fig1.webp)
![Figure 1.](./images/brainglobe-segmentation-fig1.webp)
**Figure 1.**

:::{note}
Expand Down Expand Up @@ -80,11 +80,11 @@ trace the probe track.
Make sure your conda environment is still activated!
:::

To open the graphical user interface, open napari and then load the `brainreg-segment` plugin (see
[User guide](/documentation/brainreg-segment/user-guide/index)).
To open the graphical user interface, open napari and then load the `brainglobe-segmentation` plugin (see
[User guide](/documentation/brainglobe-segmentation/user-guide/index)).

The `brainreg-segment`graphical user interface opens and shows a set of tools.You can then load your brainreg output
directory, and follow the main brainreg-segment instructions [here](/documentation/brainreg-segment/user-guide/segmenting-1d-tracks) for
The `brainglobe-segmentation`graphical user interface opens and shows a set of tools.You can then load your brainreg output
directory, and follow the main brainglobe-segmentation instructions [here](/documentation/brainglobe-segmentation/user-guide/segmenting-1d-tracks) for
segmenting a 1D track. Setting `Spline points` will determine how many times along the length of the track that
the brain region is sampled at. This can be used to determine the brain region for each recording site on your probe.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorials/tracing-tracking.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ the Otsu[^1] thresholding method from `napari-simpleitk-image-processing` an exa
To use Otsu's method from the `napari-simpleitk-image-processing` plugin, follow these steps:

- Open napari
- [Load your data using the `brainreg-segment` plugin](/documentation/brainreg-segment/user-guide/index)
- [Load your data using the `brainglobe-segmentation` plugin](/documentation/brainglobe-segmentation/user-guide/index)
- Choose the Otsu thresholding option from the plugin menu:

<img src="./images/choose-otsu.png" width="450">

- Select the image layer to be thresholded and click `run`. This will automatically segment your image using Otsu's
algorithm. This will create a new labels layer.
- Follow the instructions for [2/3D region analysis](/documentation/brainreg-segment/user-guide/segmenting-3d-structures)
- Follow the instructions for [2/3D region analysis](/documentation/brainglobe-segmentation/user-guide/segmenting-3d-structures)
to analyse the distribution of the thresholded voxels.

**Instructions by** [**Sara Mederos**](https://www.sainsburywellcome.org/web/people/sara-mederos).