From 90facac87ca274f3fbee59559a8b2831d5331ea8 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Fri, 21 Apr 2023 16:28:53 +0200 Subject: [PATCH 01/11] Update pyproject.toml - make itk and pyqt5 "optional dependency, as for m1 they cause issues! --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4ecb1b86..4950e754 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ requires-python = ">=3.8" dependencies = [ "numpy", - "napari[all]>=0.4.14", + "napari>=0.4.14", "QtPy", "opencv-python>=4.5.5", "dask-image>=0.6.0", @@ -19,7 +19,6 @@ dependencies = [ "imageio-ffmpeg>=0.4.5", "torch>=1.11", "monai[nibabel,einops]>=0.9.0", - "itk", "tqdm", "nibabel", "scikit-image", From 6e7c8daf2560fa6c0bbe431a4f355205eead9a98 Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Fri, 21 Apr 2023 16:45:05 +0200 Subject: [PATCH 02/11] conda file for m1 - then run: `conda install -c anaconda pyqt` in the env --- conda/cellseg3d_m1.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 conda/cellseg3d_m1.yml diff --git a/conda/cellseg3d_m1.yml b/conda/cellseg3d_m1.yml new file mode 100644 index 00000000..14bdd876 --- /dev/null +++ b/conda/cellseg3d_m1.yml @@ -0,0 +1,27 @@ +name: cellseg3d_m1 +channels: + - anaconda + - conda-forge + - defaults +dependencies: + - python=3.8 + - pip + - pip: + - numpy + - napari>=0.4.14 + - QtPy + - opencv-python>=4.5.5 + - dask-image>=0.6.0 + - scikit-image>=0.19.2 + - matplotlib>=3.4.1 + - tifffile>=2022.2.9 + - imageio-ffmpeg>=0.4.5 + - torch>=1.11 + - monai[nibabel,einops]>=0.9.0 + - tqdm + - nibabel + - scikit-image + - pillow + - tqdm + - matplotlib + - vispy>=0.9.6 \ No newline at end of file From 0126e671e58aade2f3067c4f09f969999d3b2cd8 Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sat, 22 Apr 2023 11:12:01 +0200 Subject: [PATCH 03/11] Added "Save location" tooltip --- napari_cellseg3d/code_plugins/plugin_base.py | 2 ++ napari_cellseg3d/code_plugins/plugin_crop.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/napari_cellseg3d/code_plugins/plugin_base.py b/napari_cellseg3d/code_plugins/plugin_base.py index 7c5fbaa5..5191e66f 100644 --- a/napari_cellseg3d/code_plugins/plugin_base.py +++ b/napari_cellseg3d/code_plugins/plugin_base.py @@ -118,6 +118,7 @@ def show_menu(_, event): def _build_io_panel(self): self.io_panel = ui.GroupedWidget("Data") + self.save_label = ui.make_label("Save location :", parent=self) # self.io_panel.setToolTip("IO Panel") @@ -130,6 +131,7 @@ def _build_io_panel(self): self.filetype_choice, self.image_filewidget, self.labels_filewidget, + self.save_label, self.results_filewidget, ], ) diff --git a/napari_cellseg3d/code_plugins/plugin_crop.py b/napari_cellseg3d/code_plugins/plugin_crop.py index 5f502978..97485bf4 100644 --- a/napari_cellseg3d/code_plugins/plugin_crop.py +++ b/napari_cellseg3d/code_plugins/plugin_crop.py @@ -440,8 +440,8 @@ def _add_crop_sliders( for i in range(len(crop_sizes)): if crop_sizes[i] > im1_stack.shape[i]: crop_sizes[i] = im1_stack.shape[i] - warnings.warn( - f"WARNING : Crop dimension in axis {i} was too large at {crop_sizes[i]}, it was set to {im1_stack.shape[i]}" + logger.warning( + f"Crop dimension in axis {i} was too large at {crop_sizes[i]}, it was set to {im1_stack.shape[i]}" ) cropx, cropy, cropz = crop_sizes From 160ff4be1e75e941cb26cf670dda52ab12346c8b Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sat, 22 Apr 2023 11:42:50 +0200 Subject: [PATCH 04/11] Packaging fixes - Remove dask and itk requirements - Comment duplicate sections in setup.cfg --- README.md | 19 ++- ...llseg3d_m1.yml => napari_cellseg3d_m1.yml} | 3 +- napari_cellseg3d/dev_scripts/convert.py | 6 +- napari_cellseg3d/dev_scripts/view_brain.py | 2 +- napari_cellseg3d/dev_scripts/view_sample.py | 2 +- napari_cellseg3d/utils.py | 16 ++- notebooks/full_plot.ipynb | 14 ++- pyproject.toml | 6 +- requirements.txt | 3 +- setup.cfg | 112 +++++++++--------- tox.ini | 2 +- 11 files changed, 110 insertions(+), 75 deletions(-) rename conda/{cellseg3d_m1.yml => napari_cellseg3d_m1.yml} (91%) diff --git a/README.md b/README.md index 0654ad41..feed1544 100644 --- a/README.md +++ b/README.md @@ -29,14 +29,14 @@ 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. +**Note** : we recommend using conda to create a new environment for the plugin. **M1 Mac users, please see below** conda create --name napari-cellseg3d python=3.8 conda activate napari-cellseg3d You can install `napari-cellseg3d` via [pip]: - pip install napari-cellseg3d + pip install napari-cellseg3d[all] OR directly via [napari-hub]: @@ -44,12 +44,25 @@ OR directly via [napari-hub]: then from the “Plugins” menu within the napari application, select “Install/Uninstall Package(s)...” - Copy `napari-cellseg3d` and paste it where it says “Install by name/url…” - Click “Install” +- Restart napari + +### M1 Mac users + +Create a new conda env using the provided conda/napari_cellseg3d_m1.yml file : + + conda env create -f conda/napari_cellseg3d_m1.yml + conda activate napari_cellseg3d_m1 + +Then install PyQt5 from conda separately : + + conda install -c anaconda PyQt5 + ## Documentation Available at https://AdaptiveMotorControlLab.github.io/CellSeg3d -You can also generate docs by running ``make html`` in the docs folder. +You can also generate docs by running ``make html`` in the docs/ folder. ## Usage diff --git a/conda/cellseg3d_m1.yml b/conda/napari_cellseg3d_m1.yml similarity index 91% rename from conda/cellseg3d_m1.yml rename to conda/napari_cellseg3d_m1.yml index 14bdd876..12ec9cf5 100644 --- a/conda/cellseg3d_m1.yml +++ b/conda/napari_cellseg3d_m1.yml @@ -1,4 +1,4 @@ -name: cellseg3d_m1 +name: napari_cellseg3d_m1 channels: - anaconda - conda-forge @@ -11,7 +11,6 @@ dependencies: - napari>=0.4.14 - QtPy - opencv-python>=4.5.5 - - dask-image>=0.6.0 - scikit-image>=0.19.2 - matplotlib>=3.4.1 - tifffile>=2022.2.9 diff --git a/napari_cellseg3d/dev_scripts/convert.py b/napari_cellseg3d/dev_scripts/convert.py index 129c16be..d772a1c2 100644 --- a/napari_cellseg3d/dev_scripts/convert.py +++ b/napari_cellseg3d/dev_scripts/convert.py @@ -2,7 +2,7 @@ import os import numpy as np -from dask_image.imread import imread +from tifffile import imread from tifffile import imwrite # input_seg_path = "C:/Users/Cyril/Desktop/Proj_bachelor/code/pytorch-test3dunet/cropped_visual/train/lab" @@ -19,8 +19,8 @@ filenames.append(os.path.basename(filename)) # print(os.path.basename(filename)) for file in paths: - img = imread(file) - image = img.compute() + image = imread(file) + # image = img.compute() image[image >= 1] = 1 image = image.astype(np.uint16) diff --git a/napari_cellseg3d/dev_scripts/view_brain.py b/napari_cellseg3d/dev_scripts/view_brain.py index e5879638..145d4e45 100644 --- a/napari_cellseg3d/dev_scripts/view_brain.py +++ b/napari_cellseg3d/dev_scripts/view_brain.py @@ -1,5 +1,5 @@ import napari -from dask_image.imread import imread +from tifffile import imread y = imread("/Users/maximevidal/Documents/3drawdata/wholebrain.tif") diff --git a/napari_cellseg3d/dev_scripts/view_sample.py b/napari_cellseg3d/dev_scripts/view_sample.py index 329944ac..8e87f85c 100644 --- a/napari_cellseg3d/dev_scripts/view_sample.py +++ b/napari_cellseg3d/dev_scripts/view_sample.py @@ -1,5 +1,5 @@ import napari -from dask_image.imread import imread +from tifffile import imread # Visual x = imread( diff --git a/napari_cellseg3d/utils.py b/napari_cellseg3d/utils.py index 7897fdf3..6a3b57d3 100644 --- a/napari_cellseg3d/utils.py +++ b/napari_cellseg3d/utils.py @@ -4,7 +4,6 @@ from pathlib import Path import numpy as np -from dask_image.imread import imread as dask_imread from pandas import DataFrame from pandas import Series from skimage import io @@ -301,7 +300,7 @@ def check_csv(project_path, ext): filename_pattern_original = Path(project_path) / Path( f"dataset/Original_size/Original/*{ext}" ) - images_original = dask_imread(filename_pattern_original) + images_original = tfl_imread(filename_pattern_original) z, y, x = images_original.shape record = Series( [ @@ -426,7 +425,9 @@ def get_time_filepath(): return "{:%H_%M_%S}".format(datetime.now()) -def load_images(dir_or_path, filetype="", as_folder: bool = False): +def load_images( + dir_or_path, filetype="", as_folder: bool = False +): # TODO(cyril):refactor w/o as_folder """Loads the images in ``directory``, with different behaviour depending on ``filetype`` and ``as_folder`` * If ``as_folder`` is **False**, will load the path as a single 3D **.tif** image. @@ -446,7 +447,7 @@ def load_images(dir_or_path, filetype="", as_folder: bool = False): as_folder (bool): Whether to load a folder of images as stack or a single 3D image Returns: - dask.array.Array: dask array with loaded images + np.array: array with loaded images """ if not as_folder: @@ -459,7 +460,12 @@ def load_images(dir_or_path, filetype="", as_folder: bool = False): raise ValueError("If loading as a folder, filetype must be specified") if as_folder: - images_original = dask_imread(filename_pattern_original) + try: + images_original = tfl_imread(filename_pattern_original) + except ValueError: + LOGGER.error( + "Loading a stack this way is no longer supported. Use napari to load a stack." + ) else: images_original = tfl_imread( filename_pattern_original diff --git a/notebooks/full_plot.ipynb b/notebooks/full_plot.ipynb index 857384d4..5c640e1b 100644 --- a/notebooks/full_plot.ipynb +++ b/notebooks/full_plot.ipynb @@ -11,9 +11,21 @@ "import os\n", "import numpy as np\n", "from PIL import Image\n", - "from dask_image.imread import imread" + "from tifffile import imread" ] }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "import sys\n", + "!{sys.executable} -m pip install plotly" + ], + "metadata": { + "collapsed": false + } + }, { "cell_type": "markdown", "id": "cb6ce5bf-0a09-46a4-988c-2183d09a8211", diff --git a/pyproject.toml b/pyproject.toml index 4950e754..0b305a88 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ "napari>=0.4.14", "QtPy", "opencv-python>=4.5.5", - "dask-image>=0.6.0", +# "dask-image>=0.6.0", "scikit-image>=0.19.2", "matplotlib>=3.4.1", "tifffile>=2022.2.9", @@ -53,6 +53,9 @@ profile = "black" line_length = 79 [project.optional-dependencies] +all = [ + "napari[all]>=0.4.14", +] dev = [ "isort", "black", @@ -72,3 +75,4 @@ test = [ "tox", "twine", ] + diff --git a/requirements.txt b/requirements.txt index 3ba73405..2d3a981b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,6 +17,7 @@ matplotlib>=3.4.1 tifffile>=2022.2.9 imageio-ffmpeg>=0.4.5 torch>=1.11 -monai[nibabel,scikit-image,itk,einops]>=0.9.0 +monai[nibabel,scikit-image,einops]>=0.9.0 +# itk pillow vispy>=0.9.6 diff --git a/setup.cfg b/setup.cfg index e12775ca..37ccef73 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,34 +1,34 @@ -[metadata] -name = napari-cellseg3d -version = 0.0.2rc6 -author = Cyril Achard, Maxime Vidal, Jessy Lauer, Mackenzie Mathis -author_email = cyril.achard@epfl.ch, maxime.vidal@epfl.ch, mackenzie@post.harvard.edu - -license = MIT -description = plugin for cell segmentation -long_description = file: README.md -long_description_content_type = text/markdown -classifiers = - Development Status :: 2 - Pre-Alpha - Intended Audience :: Science/Research - Framework :: napari - Topic :: Software Development :: Testing - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Operating System :: OS Independent - License :: OSI Approved :: MIT License - Topic :: Scientific/Engineering :: Artificial Intelligence - Topic :: Scientific/Engineering :: Image Processing - Topic :: Scientific/Engineering :: Visualization - -url = https://github.com/AdaptiveMotorControlLab/CellSeg3d -project_urls = - Bug Tracker = https://github.com/AdaptiveMotorControlLab/CellSeg3d/issues - Documentation = https://adaptivemotorcontrollab.github.io/cellseg3d-docs/res/welcome.html - Source Code = https://github.com/AdaptiveMotorControlLab/CellSeg3d +;[metadata] +;name = napari-cellseg3d +;version = 0.0.2rc6 +;author = Cyril Achard, Maxime Vidal, Jessy Lauer, Mackenzie Mathis +;author_email = cyril.achard@epfl.ch, maxime.vidal@epfl.ch, mackenzie@post.harvard.edu +; +;license = MIT +;description = plugin for cell segmentation +;long_description = file: README.md +;long_description_content_type = text/markdown +;classifiers = +; Development Status :: 2 - Pre-Alpha +; Intended Audience :: Science/Research +; Framework :: napari +; Topic :: Software Development :: Testing +; Programming Language :: Python +; Programming Language :: Python :: 3 +; Programming Language :: Python :: 3.8 +; Programming Language :: Python :: 3.9 +; Programming Language :: Python :: 3.10 +; Operating System :: OS Independent +; License :: OSI Approved :: MIT License +; Topic :: Scientific/Engineering :: Artificial Intelligence +; Topic :: Scientific/Engineering :: Image Processing +; Topic :: Scientific/Engineering :: Visualization +; +;url = https://github.com/AdaptiveMotorControlLab/CellSeg3d +;project_urls = +; Bug Tracker = https://github.com/AdaptiveMotorControlLab/CellSeg3d/issues +; Documentation = https://adaptivemotorcontrollab.github.io/cellseg3d-docs/res/welcome.html +; Source Code = https://github.com/AdaptiveMotorControlLab/CellSeg3d [options] packages = find: @@ -39,35 +39,35 @@ package_dir = # add your package requirements here # the long list after monai is due to monai optional requirements... Not sure how to know in advance which readers it wil use -install_requires = - numpy - napari[all]>=0.4.14 - QtPy - opencv-python>=4.5.5 - dask-image>=0.6.0 - scikit-image>=0.19.2 - matplotlib>=3.4.1 - tifffile>=2022.2.9 - imageio-ffmpeg>=0.4.5 - torch>=1.11 - monai[nibabel,einops]>=0.9.0 - itk - tqdm - nibabel - scikit-image - pillow - tqdm - matplotlib - vispy>=0.9.6 +;install_requires = +; numpy +; napari[all]>=0.4.14 +; QtPy +; opencv-python>=4.5.5 +; dask-image>=0.6.0 +; scikit-image>=0.19.2 +; matplotlib>=3.4.1 +; tifffile>=2022.2.9 +; imageio-ffmpeg>=0.4.5 +; torch>=1.11 +; monai[nibabel,einops]>=0.9.0 +; itk +; tqdm +; nibabel +; scikit-image +; pillow +; tqdm +; matplotlib +; vispy>=0.9.6 [options.packages.find] where = . -[options.package_data] -napari-cellseg3d = - res/*.png - code_models/models/pretrained/*.json - napari.yaml +;[options.package_data] +;napari-cellseg3d = +; res/*.png +; code_models/models/pretrained/*.json +; napari.yaml [options.entry_points] napari.manifest = diff --git a/tox.ini b/tox.ini index 3409f43c..292b8fa4 100644 --- a/tox.ini +++ b/tox.ini @@ -29,7 +29,7 @@ passenv = deps = pytest # https://docs.pytest.org/en/latest/contents.html pytest-cov # https://pytest-cov.readthedocs.io/en/latest/ - dask-image +; dask-image ; # you can remove these if you don't use them napari PyQt5 From 36d007d1000c73799ef8ecb95bed452be9c0b87b Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sat, 22 Apr 2023 12:01:07 +0200 Subject: [PATCH 05/11] Reduced duplicates in setup .cfg --- requirements.txt | 2 +- setup.cfg | 61 ------------------------------------------------ 2 files changed, 1 insertion(+), 62 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2d3a981b..b3ac8520 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,6 @@ tifffile>=2022.2.9 imageio-ffmpeg>=0.4.5 torch>=1.11 monai[nibabel,scikit-image,einops]>=0.9.0 -# itk + # itk pillow vispy>=0.9.6 diff --git a/setup.cfg b/setup.cfg index 37ccef73..3a0bdaae 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,35 +1,3 @@ -;[metadata] -;name = napari-cellseg3d -;version = 0.0.2rc6 -;author = Cyril Achard, Maxime Vidal, Jessy Lauer, Mackenzie Mathis -;author_email = cyril.achard@epfl.ch, maxime.vidal@epfl.ch, mackenzie@post.harvard.edu -; -;license = MIT -;description = plugin for cell segmentation -;long_description = file: README.md -;long_description_content_type = text/markdown -;classifiers = -; Development Status :: 2 - Pre-Alpha -; Intended Audience :: Science/Research -; Framework :: napari -; Topic :: Software Development :: Testing -; Programming Language :: Python -; Programming Language :: Python :: 3 -; Programming Language :: Python :: 3.8 -; Programming Language :: Python :: 3.9 -; Programming Language :: Python :: 3.10 -; Operating System :: OS Independent -; License :: OSI Approved :: MIT License -; Topic :: Scientific/Engineering :: Artificial Intelligence -; Topic :: Scientific/Engineering :: Image Processing -; Topic :: Scientific/Engineering :: Visualization -; -;url = https://github.com/AdaptiveMotorControlLab/CellSeg3d -;project_urls = -; Bug Tracker = https://github.com/AdaptiveMotorControlLab/CellSeg3d/issues -; Documentation = https://adaptivemotorcontrollab.github.io/cellseg3d-docs/res/welcome.html -; Source Code = https://github.com/AdaptiveMotorControlLab/CellSeg3d - [options] packages = find: include_package_data = True @@ -37,38 +5,9 @@ python_requires = >=3.8 package_dir = =. -# add your package requirements here -# the long list after monai is due to monai optional requirements... Not sure how to know in advance which readers it wil use -;install_requires = -; numpy -; napari[all]>=0.4.14 -; QtPy -; opencv-python>=4.5.5 -; dask-image>=0.6.0 -; scikit-image>=0.19.2 -; matplotlib>=3.4.1 -; tifffile>=2022.2.9 -; imageio-ffmpeg>=0.4.5 -; torch>=1.11 -; monai[nibabel,einops]>=0.9.0 -; itk -; tqdm -; nibabel -; scikit-image -; pillow -; tqdm -; matplotlib -; vispy>=0.9.6 - [options.packages.find] where = . -;[options.package_data] -;napari-cellseg3d = -; res/*.png -; code_models/models/pretrained/*.json -; napari.yaml - [options.entry_points] napari.manifest = napari-cellseg3d = napari_cellseg3d:napari.yaml From b9eea80912629b09690d97983566d122f6cb9724 Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sat, 22 Apr 2023 12:04:12 +0200 Subject: [PATCH 06/11] Clean up pyproject --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0b305a88..de27c005 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ dependencies = [ "napari>=0.4.14", "QtPy", "opencv-python>=4.5.5", -# "dask-image>=0.6.0", "scikit-image>=0.19.2", "matplotlib>=3.4.1", "tifffile>=2022.2.9", @@ -60,6 +59,7 @@ dev = [ "isort", "black", "ruff", + "tuna", "pre-commit", ] docs = [ From 68ddb854e77009f9f5198db5ee9a887ba6566c5e Mon Sep 17 00:00:00 2001 From: Mackenzie Mathis Date: Sat, 22 Apr 2023 13:27:40 +0200 Subject: [PATCH 07/11] Update requirements.txt --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b3ac8520..f97de33c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,5 @@ tifffile>=2022.2.9 imageio-ffmpeg>=0.4.5 torch>=1.11 monai[nibabel,scikit-image,einops]>=0.9.0 - # itk pillow vispy>=0.9.6 From 327defe0ffdf98689174626e25efae3467ea3ae2 Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sun, 23 Apr 2023 14:15:48 +0200 Subject: [PATCH 08/11] Update README.md --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index feed1544..5cc4fc75 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ 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. **M1 Mac users, please see below** +**Note** : we recommend using conda to create a new environment for the plugin. **M1 Mac users, please see the [M1 install section](#m1-mac-users)** conda create --name napari-cellseg3d python=3.8 conda activate napari-cellseg3d @@ -49,12 +49,12 @@ then from the “Plugins” menu within the napari application, select “Instal ### M1 Mac users Create a new conda env using the provided conda/napari_cellseg3d_m1.yml file : - + conda env create -f conda/napari_cellseg3d_m1.yml conda activate napari_cellseg3d_m1 - + Then install PyQt5 from conda separately : - + conda install -c anaconda PyQt5 From 2d97a1b0d2bf9a813cd19f0bc531eaabc59c9d5f Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sun, 23 Apr 2023 14:22:27 +0200 Subject: [PATCH 09/11] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5cc4fc75..011f072c 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,8 @@ 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. **M1 Mac users, please see the [M1 install section](#m1-mac-users)** +**Note** : we recommend using conda to create a new environment for the plugin. +**M1 Mac users, please see the [M1 install section](#m1-mac-users)** conda create --name napari-cellseg3d python=3.8 conda activate napari-cellseg3d From efdb6c3527d38e30c041bb1a355952014a0b281c Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sun, 23 Apr 2023 14:36:12 +0200 Subject: [PATCH 10/11] Latest pre-commit hooks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4202f04e..7053663e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: rev: 5.12.0 hooks: - id: isort - args: ["--profile", "black", --line-length=72] + args: ["--profile", "black", --line-length=79] - repo: https://github.com/charliermarsh/ruff-pre-commit # Ruff version. rev: 'v0.0.262' From 0707e4240d552e083c1ad7ba7ff819408971d7b1 Mon Sep 17 00:00:00 2001 From: C-Achard Date: Sun, 23 Apr 2023 14:39:03 +0200 Subject: [PATCH 11/11] Run full suite of pre-commit checks --- conda/napari_cellseg3d_m1.yml | 2 +- napari_cellseg3d/code_models/model_workers.py | 1 + pyproject.toml | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/napari_cellseg3d_m1.yml b/conda/napari_cellseg3d_m1.yml index 12ec9cf5..8209be9e 100644 --- a/conda/napari_cellseg3d_m1.yml +++ b/conda/napari_cellseg3d_m1.yml @@ -23,4 +23,4 @@ dependencies: - pillow - tqdm - matplotlib - - vispy>=0.9.6 \ No newline at end of file + - vispy>=0.9.6 diff --git a/napari_cellseg3d/code_models/model_workers.py b/napari_cellseg3d/code_models/model_workers.py index 8b1caf8e..c5675a11 100644 --- a/napari_cellseg3d/code_models/model_workers.py +++ b/napari_cellseg3d/code_models/model_workers.py @@ -457,6 +457,7 @@ def model_output( # self.config.model_info.get_model().get_output(model, inputs) # ) + def model_output(inputs): return post_process_transforms( self.config.model_info.get_model().get_output(model, inputs) diff --git a/pyproject.toml b/pyproject.toml index de27c005..11b8dced 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,4 +75,3 @@ test = [ "tox", "twine", ] -