Skip to content
Open
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
12 changes: 6 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
__pycache__
*.pyc
.ipynb_checkpoints/
segwrap.egg-info/
site/
.DS_Store
__pycache__
*.pyc
.ipynb_checkpoints/
segwrap.egg-info/
site/
.vscode/
32 changes: 16 additions & 16 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation with MkDocs
mkdocs:
configuration: mkdocs.yml

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation with MkDocs
mkdocs:
configuration: mkdocs.yml
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
50 changes: 25 additions & 25 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
BSD 3-Clause License

Copyright © 2020, Florian Mueller
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
BSD 3-Clause License
Copyright © 2020, Florian Mueller
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 changes: 23 additions & 23 deletions docs/analysis-general-behavior.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# General behavior

Here, we describe some general concepts that are shared by most plugins.

## Recursive search for data

Some plugins will perform by default a recursive search for data, for others this is an option.

A recursive search means simply that not only the provided folder will be searched for files fitting the specified criteria, but also all subfolders.

## Specify folder to save results

Several possibilities are provided to specify the folder to save the results of the different workflows. Here, the general options are described, if
a plugin deviates from this default behavior it will be described in the respective plugin.

When asked to define a folder to save results, you can:

1. Directly define a **full path** where the results should be stored. If the folder doesn't exist, it will be created.
2. Define a folder with a **text replacement**. This option can be useful if many folders are processed, e.g. when a recursive search is performed.

* Such a replacement operation is indicated with a string in the format `str_orig>>str_new`,
where 'str_orig' is the orginal string, `str_new` is the new string.
* For instance, using the string `acquisition>>analysis` implies that in the folder name
# General behavior
Here, we describe some general concepts that are shared by most plugins.
## Recursive search for data
Some plugins will perform by default a recursive search for data, for others this is an option.
A recursive search means simply that not only the provided folder will be searched for files fitting the specified criteria, but also all subfolders.
## Specify folder to save results
Several possibilities are provided to specify the folder to save the results of the different workflows. Here, the general options are described, if
a plugin deviates from this default behavior it will be described in the respective plugin.
When asked to define a folder to save results, you can:
1. Directly define a **full path** where the results should be stored. If the folder doesn't exist, it will be created.
2. Define a folder with a **text replacement**. This option can be useful if many folders are processed, e.g. when a recursive search is performed.
* Such a replacement operation is indicated with a string in the format `str_orig>>str_new`,
where 'str_orig' is the orginal string, `str_new` is the new string.
* For instance, using the string `acquisition>>analysis` implies that in the folder name
`D:\example_data\acquisition`, `acquisition` will be replaced with `analysis`, yielding `D:\example_data\analysis`.
54 changes: 27 additions & 27 deletions docs/analysis-overview.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
## ImJoy plugins
Most of the workflows are implemented as **ImJoy plugins**, with a simple interface to
specify the different workflow parameters. We describe in a dedicated [sections] how to [**use**](imjoy-overview.md) and [**install**](imjoy-installation.md) the **Plugin engine** to run these plugins.

Once a plugin is installed, it will be available for later use in the ImJoy **workspace `fq-segmentation`** as explained [here](imjoy-overview.md#opening-a-workspace).

!!! abstract "Quick summary for how to connect ImJoy to Jupyter engine"
1. Open **anaconda terminal**.
2. **Activate environment**: `conda activate fq-segmentation`
3. **Start Jupyter engine**: `imjoy --jupyter`
4. **Connect** ImJoy to Jupyter Engine with 🚀 button.

We also provide **Jupyter notebooks** for these workflows, which we recommend only for more experienced Python users.

## Typical workflows
For most purposes, the segmentation will consist of two steps. Each of these steps is described in a
dedicated section. In this section you can also find a recommended workflow, which allows you to also
process the test data.

1. **Pre-processing** of the data: segmentation is performed on 2D images. If your images are 3D, you have to either split them, or project them into 2D images. This can be done with the [pre-processing workflow](analysis-preprocessing.md).
2. **Actual segmentation** of your images. We provide different plugins to [**segment**](analysis-segmentation.md). one type of structure, e.g. nuclei or cells, or two, e.g. cells and nuclei.

Each **workflow** is documented in a dedicated section. We provide

* **Installation links**.
* Detailed explanations of the different **parameters**.
* A **Recommended workflow** for how to set the parameters following the recommended data organization.
## ImJoy plugins
Most of the workflows are implemented as **ImJoy plugins**, with a simple interface to
specify the different workflow parameters. We describe in a dedicated [sections] how to [**use**](imjoy-overview.md) and [**install**](imjoy-installation.md) the **Plugin engine** to run these plugins.
Once a plugin is installed, it will be available for later use in the ImJoy **workspace `fq-segmentation`** as explained [here](imjoy-overview.md#opening-a-workspace).
!!! abstract "Quick summary for how to connect ImJoy to Jupyter engine"
1. Open **anaconda terminal**.
2. **Activate environment**: `conda activate fq-segmentation`
3. **Start Jupyter engine**: `imjoy --jupyter`
4. **Connect** ImJoy to Jupyter Engine with 🚀 button.
We also provide **Jupyter notebooks** for these workflows, which we recommend only for more experienced Python users.
## Typical workflows
For most purposes, the segmentation will consist of two steps. Each of these steps is described in a
dedicated section. In this section you can also find a recommended workflow, which allows you to also
process the test data.
1. **Pre-processing** of the data: segmentation is performed on 2D images. If your images are 3D, you have to either split them, or project them into 2D images. This can be done with the [pre-processing workflow](analysis-preprocessing.md).
2. **Actual segmentation** of your images. We provide different plugins to [**segment**](analysis-segmentation.md). one type of structure, e.g. nuclei or cells, or two, e.g. cells and nuclei.
Each **workflow** is documented in a dedicated section. We provide
* **Installation links**.
* Detailed explanations of the different **parameters**.
* A **Recommended workflow** for how to set the parameters following the recommended data organization.
106 changes: 53 additions & 53 deletions docs/analysis-preprocessing.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@

# Preprocessing of 3D images

Segmentation is performed on **2D images**. This plugin allows to obtain 2D images from 3D images either by
a projection or by saving each z-plane separately. These images are typically stored in a separate folder.
2D images by applying a projection, and these images are typically stored in a separate folder.

Install ImJoy plugin `PreProcess` <a href="https://imjoy.io/#/app?w=fq-segmentation&plugin=fish-quant/fq-segmentation:PreProcess@stable&upgrade=1" target="_blank">** from here.**</a>

## Recommended workflow

The default settings of the plugins allow to quickly perform the recommended workflow. You only have
to paste your data folder.

1. 3D images are stored in a folder `acquisition`
2. In the pre-processing step, the folder to save data is obtained with

1. the text replacement `acquisition>>analysis`.
2. Images are stored in a new subfolder `segmentation-input`

With these options, the images will be saved in a folder `acquisition\segmentation-input`

## Running the plugin

1. Before running the plugin, you have to specify a few parameters. Note that you have to perform this
projection for each channel-type. This allows to use different projection methods for a channel. This can be set in the plugin interface, avaible after clicking on the arrow down next to the plugin name.

![imjoy-preprocess](img/imjoy-preprocess-ui.png){: style="width:300px"}

Here the following parameters can be set.

Option | Type | Default | Description
---------------- | ---- | ----------- | -----------
`Path DATA` | str | | Full path to folder containing data to be segmented.
`Path SAVE` | str | acquisition>>analysis | Several options exist. See dedicated section here [below](analysis-general-behavior.md#specify-folder-to-save-your-data) for more details.
`Subfolder` | str | segmentation-input | Sub-folder where results should be saved (if defined)
`Channel string` | str | dapi | Unique string to identify channel that should be processed.
`Img extension` | str | .tif | Extensions of images to be loaded.
`Projection type` | str | mean | Different projection types: `max`, `mean`, `indiv`. The option `indiv` implies that a z-stack is split into individual slices, stored in subfolder for each image.
`Search recursive` | bool | false | Should provided folder be search [**recursively**](analysis-general-behavior.md#recursive-search-for-data) for images (true/false).


2. Pressing the button `PreProcess` will **start the pre-processing**. Progress
can be monitored in the plugin log, available by pressing on the `i` next to the plugin name.

3. **Results** will be saved in the specified folder. For each image a json file with
basic properties of the file, and an image with the same name as the original one will be saved.






# Preprocessing of 3D images
Segmentation is performed on **2D images**. This plugin allows to obtain 2D images from 3D images either by
a projection or by saving each z-plane separately. These images are typically stored in a separate folder.
2D images by applying a projection, and these images are typically stored in a separate folder.
Install ImJoy plugin `PreProcess` <a href="https://imjoy.io/#/app?w=fq-segmentation&plugin=fish-quant/fq-segmentation:PreProcess@stable&upgrade=1" target="_blank">** from here.**</a>
## Recommended workflow
The default settings of the plugins allow to quickly perform the recommended workflow. You only have
to paste your data folder.
1. 3D images are stored in a folder `acquisition`
2. In the pre-processing step, the folder to save data is obtained with
1. the text replacement `acquisition>>analysis`.
2. Images are stored in a new subfolder `segmentation-input`
With these options, the images will be saved in a folder `acquisition\segmentation-input`
## Running the plugin
1. Before running the plugin, you have to specify a few parameters. Note that you have to perform this
projection for each channel-type. This allows to use different projection methods for a channel. This can be set in the plugin interface, avaible after clicking on the arrow down next to the plugin name.
![imjoy-preprocess](img/imjoy-preprocess-ui.png){: style="width:300px"}
Here the following parameters can be set.
Option | Type | Default | Description
---------------- | ---- | ----------- | -----------
`Path DATA` | str | | Full path to folder containing data to be segmented.
`Path SAVE` | str | acquisition>>analysis | Several options exist. See dedicated section here [below](analysis-general-behavior.md#specify-folder-to-save-your-data) for more details.
`Subfolder` | str | segmentation-input | Sub-folder where results should be saved (if defined)
`Channel string` | str | dapi | Unique string to identify channel that should be processed.
`Img extension` | str | .tif | Extensions of images to be loaded.
`Projection type` | str | mean | Different projection types: `max`, `mean`, `indiv`. The option `indiv` implies that a z-stack is split into individual slices, stored in subfolder for each image.
`Search recursive` | bool | false | Should provided folder be search [**recursively**](analysis-general-behavior.md#recursive-search-for-data) for images (true/false).
2. Pressing the button `PreProcess` will **start the pre-processing**. Progress
can be monitored in the plugin log, available by pressing on the `i` next to the plugin name.
3. **Results** will be saved in the specified folder. For each image a json file with
basic properties of the file, and an image with the same name as the original one will be saved.
Loading