Skip to content
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
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ __pycache__/

# unwanted results files
*.tif
*.tiff
napari_cellseg3d/_tests/res/*.csv
*.pth
*.db

# Distribution / packaging
.Python
Expand Down Expand Up @@ -97,4 +99,4 @@ venv/
/napari_cellseg3d/models/saved_weights/
/docs/res/logo/old_logo/
/reqs/
*.db

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ A napari plugin for 3D cell segmentation: training, inference, and data review.

## Installation

Note : we recommend using conda to create a new environment for the plugin.

conda create --name python=3.8 napari-cellseg3d
conda activate napari-cellseg3d

You can install `napari-cellseg3d` via [pip]:

pip install napari-cellseg3d
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down
61 changes: 43 additions & 18 deletions docs/res/code/interface.rst
Original file line number Diff line number Diff line change
@@ -1,50 +1,75 @@
interface.py
=============

Functions
Classes
-------------

open_url
Button
**************************************
.. autofunction:: napari_cellseg3d.interface::open_url
.. autoclass:: napari_cellseg3d.interface::Button
:members: __init__, visibility_condition

DropdownMenu
**************************************
.. autoclass:: napari_cellseg3d.interface::DropdownMenu
:members: __init__

make_scrollable
CheckBox
**************************************
.. autofunction:: napari_cellseg3d.interface::make_scrollable
.. autoclass:: napari_cellseg3d.interface::CheckBox
:members: __init__

AnisotropyWidgets
**************************************
.. autoclass:: napari_cellseg3d.interface::AnisotropyWidgets
:members: __init__, build, get_anisotropy_resolution_xyz, get_anisotropy_resolution_zyx, anisotropy_zoom_factor,is_enabled,toggle_permanent_visibility

make_group

FilePathWidget
**************************************
.. autofunction:: napari_cellseg3d.interface::make_group
.. autoclass:: napari_cellseg3d.interface::FilePathWidget
:members: __init__, build, get_text_field, get_button, check_ready, set_required, update_field_color, set_description

add_to_group
ScrollArea
**************************************
.. autofunction:: napari_cellseg3d.interface::add_to_group
.. autoclass:: napari_cellseg3d.interface::ScrollArea
:members: __init__, make_scrollable

make_container
DoubleIncrementCounter
**************************************
.. autofunction:: napari_cellseg3d.interface::make_container
.. autoclass:: napari_cellseg3d.interface::DoubleIncrementCounter
:members: __init__, set_precision, make_n

IntIncrementCounter
**************************************
.. autoclass:: napari_cellseg3d.interface::IntIncrementCounter
:members: __init__, make_n


make_button
Functions
-------------

open_url
**************************************
.. autofunction:: napari_cellseg3d.interface::make_button
.. autofunction:: napari_cellseg3d.interface::open_url


make_combobox
make_group
**************************************
.. autofunction:: napari_cellseg3d.interface::make_combobox
.. autofunction:: napari_cellseg3d.interface::make_group

make_checkbox
add_to_group
**************************************
.. autofunction:: napari_cellseg3d.interface::make_checkbox
.. autofunction:: napari_cellseg3d.interface::add_to_group

make_container
**************************************
.. autofunction:: napari_cellseg3d.interface::make_container

combine_blocks
**************************************
.. autofunction:: napari_cellseg3d.interface::combine_blocks


add_blank
**************************************
.. autofunction:: napari_cellseg3d.interface::add_blank
Expand Down
6 changes: 6 additions & 0 deletions docs/res/guides/convert_module_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ You can :
* Remove small objects :
You can specify a size threshold in pixels; all objects smaller than this size will be removed in the image.

* Resize anisotropic images :
Specifiy the resolution of your microscope to remove anisotropy from images.

.. important:: Does not work for instance labels currently.


.. figure:: ../images/converted_labels.png
:scale: 30 %
:align: center
Expand Down
6 changes: 6 additions & 0 deletions docs/res/guides/cropping_module_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ Folders can be stacks of either .png or .tif files, ideally numbered with the in
You can then choose the size of the cropped volume, which will be constant throughout the process; make sure it is correct beforehand.
Setting a larger size than the size of the image will cause issues.

You can also opt to correct the anisotropy if your image is anisotropic :
simply set the resolution to the one of your microscope.

.. important::
This will simply scale the image in the viewer, but saved images will **still be anisotropic.** To resize your image, see :doc:`convert_module_guide`

Once you are ready, you can press **Start** to start the review process.


Expand Down
6 changes: 6 additions & 0 deletions docs/res/guides/review_module_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Launching the review process
.. note::
Only single 3D **.tif** files or 2D stacks of several **.png** or **.tif** in a folder are currently supported.

* Anisotropic data :
This will scale the images to visually remove the anisotropy, so as to make review easier.

.. important::
Results will still be saved as anisotropic images. If you wish to resize your images, see the :doc:`convert_module_guide`

* CSV file name :
You can then provide a model name, which will be used to name the csv file recording the status of each slice.

Expand Down
Binary file added docs/res/logo/logo_alpha.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 13 additions & 15 deletions napari_cellseg3d/_tests/test_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@

def test_launch_review(make_napari_viewer):

view = make_napari_viewer()
widget = rev.Reviewer(view)
view = make_napari_viewer()
widget = rev.Reviewer(view)

# widget.filetype_choice.setCurrentIndex(0)
# widget.filetype_choice.setCurrentIndex(0)

im_path = os.path.dirname(os.path.realpath(__file__)) + "/res/test.tif"
im_path = os.path.dirname(os.path.realpath(__file__)) + "/res/test.tif"

widget.image_path = im_path
widget.label_path = im_path

print(widget.image_path)
print(widget.label_path)
print(widget.as_folder)
print(widget.filetype)
widget.run_review()
widget._viewer.close()

assert widget._viewer is not None
widget.image_path = im_path
widget.label_path = im_path

print(widget.image_path)
print(widget.label_path)
print(widget.as_folder)
print(widget.filetype)
widget.run_review()
widget._viewer.close()

assert widget._viewer is not None
Loading