{"name":"morphodeep","display_name":"Predict Instance Segmentation Plugin","visibility":"public","icon":"","categories":[],"schema_version":"0.1.0","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"morphodeep.napari.morphodeep_widget","title":"MorphoDeep","python_name":"morphodeep.napari._widget:morphodeep_widget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"morphodeep.napari.morphodeep_widget","display_name":"MorphoDeep","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"morphodeep","version":"0.0.1","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"Instance segmentation of membranes","description":"# morphodeep\n\n[![License GNU LGPL v3.0](https://img.shields.io/pypi/l/morphodeep.svg?color=green)](https://github.com/Gitlab /morphodeep/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/morphodeep.svg?color=green)](https://pypi.org/project/morphodeep)\n[![Python Version](https://img.shields.io/pypi/pyversions/morphodeep.svg?color=green)](https://python.org)\n[![tests](https://github.com/Gitlab /morphodeep/workflows/tests/badge.svg)](https://github.com/Gitlab /morphodeep/actions)\n[![codecov](https://codecov.io/gh/Gitlab /morphodeep/branch/main/graph/badge.svg)](https://codecov.io/gh/Gitlab /morphodeep)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/morphodeep)](https://napari-hub.org/plugins/morphodeep)\n[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)\n[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)\n\n# MorphoDeep\n\nMorphoDeep is a **Python package** for performing **membrane instance segmentation** using a pre-trained **U-Net** model based on the Semantic format.  \nIt produces a dense **labels image** where each unique integer corresponds to a segmented cell instance.\nIt also includes a **napari plugin**\n\nThe plugin is designed for:\n\n- fluorescence images of cell membranes  \n- 2D and 3D volumes (with optional isotropic rescaling)  \n- interactive use in napari or scripted use in Python\n\n---\n## Key features\n\n- **Pre-trained U-Net** for 2D / pseudo-3D membrane instance segmentation  \n- **Napari widget** with:\n  - image layer selection\n  - network patch size (`128` or `256`)\n  - 2D / 3D mode\n  - optional tiling (“patches mode”) for large images\n  - voxel size and Z-axis selection\n  - optional isotropic rescaling for anisotropic volumes\n  - Automatic model download and caching on first use\n\n---\n\n## Installation\nSetup your environnement \n```\nconda create -y -n morphodeep-env python=3.10\nconda activate morphodeep-env\n```\nYou can install `morphodeep` via ff[pip]:\n\n```\npip install morphodeep\n```\n\n## Installation with napari\nSetup your environnement \n```\nconda create -y -n napari-env -c conda-forge python=3.11\nconda activate napari-env\n```\nYou can install `morphodeep` plugin with napari and Qt via:\n\n```\npip install \"napari[all]\"\npip install \"morphodeep[napari]\"\n\n```\n\n\n---\n\n\n# MorphoDeep library Usage \nYou  have 3 way to use the morphodeep library: \n1. with a command line :  ` python morphodeep.py  <args> `\n2. directly inside the python code using the semantic library: `MorphoModel(args)`\n3. directly in napari with the morphodeep plugin\n\n\n## Arguments  \n\n#### JOBS (run the command line in a job )\n  - `--job` : Launch the corresponding job \n  - `--exe` : Execute the method ( ground_truth ... )\n  - `--path_jobs` : path job output\n  - `--job_number` :  Launch a sepecif job in job array list\n  - `--job_filename` : The file of the job array list\n  - \n#### ACTION\n  - `--train` :  Launch the training\n  - `--predict` :  Launch the prediction\n  - `--ground_truth` : Generate all the ground truth\n  - `--setdata` : Generate the data list files used for train/test/predict\n  - `--export` : Compute the testing set and plot the results in figures\n  - `--evolution` : Evaluation the testing set throught the different epochs\n  - `--export_evol` : Predict for each epochs \n  - `--eval` : Evaluation of training database \n  - `--plot` : Compute export and plot loss\n  - `--plot_loss` : Plot the loss and accuracy\n\n#### METHOD\n - `-mode` :  2D or 3D\n  - `--img_size` :  image size\n  - `--full` :  Use a several layers to complete a tiles network to a work with image size\n  - `--weight_files` :  weight files\n  - \n#### TRAINING\n  - `--batch_size` :  \"batch_size\n  - `--steps_per_epoch` :  steps_per_epoch\n  - `--epochs` :  number of epochs\n  - `--log_path` :  log path for tensorboard\n  - `--specie` :  which specie ? (PM,DR,AT,DM,or PM-AT, PM-DM-AT, CP (for CellPose)\n  - `--microscope` :  which microscope ? (SPIM (for lightsheet), CONF (for confocal),SIM (for simulated))\n  - `--augmentation` :  Use Data Augmentation ? Default is False\n  - `--pondere` :  Keep only the worst element (10%) for training \n\n#### DATA Management\n  - `--input_path` :  Input Path (depend on the called method )\n  - `--output_path` :  Output Path (depend on the called method \n  - `--membrane_filename` :  Filename membrane\")\n  - `--nucleus_filename` :  Filename nucleus\")\n  - `--segmented_filename` :  Filename segmented\")\n  - `--embryo_name` :  Embryo Name\")\n  - `--ratio` :  Resize the full database\")\n  - `--input_method` :  Input Method (for Ground Truth Calculcation)\")\n\n#### DATASET\n  - `--dataset_file` :  Dataset File without .train, .valid and .test\n  - `--test_split` :  Float between 0 and 1. Fraction of the data to be used as test data.\n  - `--validation_split` :  Float between 0 and 1. Fraction of the data to be used as validate data.\n\n#### PREDICTION\n  - `--input_file` :  Input Filename to predict\n  - `--output_file` :  Output Filename of the predicted image\n  - `--patches` :  uses for prediction \n\n#### RESULT\n  - `--export_path` :  The export path for the results\n\n---\n## DATA PREPARATION  \n\n### 1. Extract segmentation and Raw Images data\n#### SPIM PHALLUSIA MAMILATA\nexample :`python morphodeep.py --microscope SPIM --specie PM --phallusia_data`  \n#### CONF ARABIDOPSSIS \nexample :`python morphodeep.py --microscope CONF --specie AT --arabidopsis_data` \n#### CONF LATERAL ROOTS\nexample :`python morphodeep.py --microscope CONF --specie LP --plantseg_data` \n#### CONF OVULES \nexample :`python morphodeep.py --microscope CONF --specie OV --plantseg_data` \n#### CONF SEA STAR\nexample :`python morphodeep.py --microscope CONF --specie SS --seastar_data `   \n#### CONF C ELEGANS\nexample :`python morphodeep.py --microscope CONF --specie CE --celegans_data`    \n\n### 2. Generate all Ground Truth\nargs : ` --ground_truth `\nexample :`python morphodeep.py --ground_truth --microscope CONF --specie SS  ` \n\n### 3. Split Train,Test Valid data \nargs : ` --setdata `\nexample :`python morphodeep.py  --setdata --microscope CONF --specie SS `\n\n#### 3.b To transfert your data in 128 patches \nexample : `python morphodeep.py  --setdata --img_size 128`\n\n### 4. Predict Cellpose (on test data)\nargs : ` --predict_cellpose `\nexample :`python morphodeep.py  --predict_cellpose --exe --microscope SPIM --specie PM ` \n\n### 5. Predict PlantSeg (on test data)\nargs : ` --predict_plantseg `\nexample :`python morphodeep.py  --predict_plantseg --exe --microscope CONF --specie OV `  \n\n### 6. DataManagement \nTo compress or uncompress data from $STORE path in Jean Zay : `morphodeep/DataManagement/store_data.py`\nexample :`python store_data.py --compress --microscope CONF --specie PM `\n  \n### 7. Train Semantic Networks\nargs : ` --train `\nexample : ` python morphodeep.py  --train  --microscope SPIM --specie PM `\n\n### 8. Compute accuracy and plot loss evolution\nargs : ` --plot `\nexample : ` python morphodeep.py --plot --microscope CONF --specie AT `\n\n### 9. Benchmark Test data (from figures path)\nexample : `  python Benchmark.py --predict`\n\n### 11. Benchmark on external data\nargs : ` python Benchmark.py --predict -f figure_5/EXTERNAL_DATA/external_data_3D.txt`\n\n---\n## 2D \nEverything is by default in 3D, add ` --mode 2D`  to comptue evertyhing in 2D\n\n### 1. Convert in 2D DATA  (and generate txt files)\nWe extract all the 3D datbase to 2D slices \nargs : ` --extract_2D `\nexample :`python morphodeep.py --mode 3D  --microscope ALL --specie all --extract_2D [-wh <test;train;valid>]`  \n\n### 2. Generate all Ground Truth for all species (includ in all)\nargs : ` --ground_truth `\nexample :`python morphodeep.py --mode 2D --ground_truth  --microscope SPIM --specie PM ` \n\n### 3. Predict Cellpose (on test data)\nargs : ` --predict_cellpose `\nexample :`python morphodeep.py  --mode 2D --predict_cellpose   ` \n\n### 4. Predict PlantSseg (on test data)\nargs : ` --predict_plantseg `\nexample :`python morphodeep.py  --mode 2D --predict_plantseg   `  \n\n### 6. DataManagement \nTo compress or uncompress data from $STORE path in Jean Zay : `semantic/DataManagement/store_data.py`\nexample :`python store_data.py --mode 2D --compress --microscope CONF --specie PM `\n \n### 7. Train Semantic Networks\nargs : ` --train `\nexample : ` python morphodeep.py  --mode 2D --batch_size 32  --train `\n\n### 8. Compute accuracy and plot loss evolution\nargs : ` --plot `\nexample : ` python morphodeep.py --mode 2D --plot `\n\n### 12. Benchmark Test data (from figures path)\nexample : `python Benchmark.py --predict -t 2D  -p True`\n\n### 12. Benchmark on external data\nexample : `python Benchmark.py --predict -t 2D -p True -n DUNNET -f /lustre/fsn1/projects/rech/dhp/uhb36wd/DATA_INTEGRATION//EXTERNAL_DATA_2D/external_data_2D.txt`\n\n\n---\n\nThis [napari] plugin was generated with [copier] using the [napari-plugin-template] (None).\n\n\n## Contributing\n\nContributions are very welcome. Tests can be run with [tox], please ensure\nthe coverage at least stays the same before you submit a pull request.\n\n## License\n\nDistributed under the terms of the [GNU LGPL v3.0] license,\n\"morphodeep\" is free and open source software\n\n## Issues\n\nIf you encounter any problems, please [file an issue] along with a detailed description.\n\n[napari]: https://github.com/napari/napari\n[copier]: https://copier.readthedocs.io/en/stable/\n[@napari]: https://github.com/napari\n[MIT]: http://opensource.org/licenses/MIT\n[BSD-3]: http://opensource.org/licenses/BSD-3-Clause\n[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt\n[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt\n[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0\n[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt\n[napari-plugin-template]: https://github.com/napari/napari-plugin-template\n\n[napari]: https://github.com/napari/napari\n[tox]: https://tox.readthedocs.io/en/latest/\n[pip]: https://pypi.org/project/pip/\n[PyPI]: https://pypi.org/\n","description_content_type":"text/markdown","keywords":"image analysis,bioimage,segmentation,instance-segmentation,deep learning,unet,napari plugin,microscopy","home_page":null,"download_url":null,"author":"Emmanuel Faure","author_email":"emmanuel.faure@lirmm.fr","maintainer":null,"maintainer_email":null,"license":"GNU LESSER GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n\n  This version of the GNU Lesser General Public License incorporates\nthe terms and conditions of version 3 of the GNU General Public\nLicense, supplemented by the additional permissions listed below.\n\n  0. Additional Definitions.\n\n  As used herein, \"this License\" refers to version 3 of the GNU Lesser\nGeneral Public License, and the \"GNU GPL\" refers to version 3 of the GNU\nGeneral Public License.\n\n  \"The Library\" refers to a covered work governed by this License,\nother than an Application or a Combined Work as defined below.\n\n  An \"Application\" is any work that makes use of an interface provided\nby the Library, but which is not otherwise based on the Library.\nDefining a subclass of a class defined by the Library is deemed a mode\nof using an interface provided by the Library.\n\n  A \"Combined Work\" is a work produced by combining or linking an\nApplication with the Library.  The particular version of the Library\nwith which the Combined Work was made is also called the \"Linked\nVersion\".\n\n  The \"Minimal Corresponding Source\" for a Combined Work means the\nCorresponding Source for the Combined Work, excluding any source code\nfor portions of the Combined Work that, considered in isolation, are\nbased on the Application, and not on the Linked Version.\n\n  The \"Corresponding Application Code\" for a Combined Work means the\nobject code and/or source code for the Application, including any data\nand utility programs needed for reproducing the Combined Work from the\nApplication, but excluding the System Libraries of the Combined Work.\n\n  1. Exception to Section 3 of the GNU GPL.\n\n  You may convey a covered work under sections 3 and 4 of this License\nwithout being bound by section 3 of the GNU GPL.\n\n  2. Conveying Modified Versions.\n\n  If you modify a copy of the Library, and, in your modifications, a\nfacility refers to a function or data to be supplied by an Application\nthat uses the facility (other than as an argument passed when the\nfacility is invoked), then you may convey a copy of the modified\nversion:\n\n   a) under this License, provided that you make a good faith effort to\n   ensure that, in the event an Application does not supply the\n   function or data, the facility still operates, and performs\n   whatever part of its purpose remains meaningful, or\n\n   b) under the GNU GPL, with none of the additional permissions of\n   this License applicable to that copy.\n\n  3. Object Code Incorporating Material from Library Header Files.\n\n  The object code form of an Application may incorporate material from\na header file that is part of the Library.  You may convey such object\ncode under terms of your choice, provided that, if the incorporated\nmaterial is not limited to numerical parameters, data structure\nlayouts and accessors, or small macros, inline functions and templates\n(ten or fewer lines in length), you do both of the following:\n\n   a) Give prominent notice with each copy of the object code that the\n   Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the object code with a copy of the GNU GPL and this license\n   document.\n\n  4. Combined Works.\n\n  You may convey a Combined Work under terms of your choice that,\ntaken together, effectively do not restrict modification of the\nportions of the Library contained in the Combined Work and reverse\nengineering for debugging such modifications, if you also do each of\nthe following:\n\n   a) Give prominent notice with each copy of the Combined Work that\n   the Library is used in it and that the Library and its use are\n   covered by this License.\n\n   b) Accompany the Combined Work with a copy of the GNU GPL and this license\n   document.\n\n   c) For a Combined Work that displays copyright notices during\n   execution, include the copyright notice for the Library among\n   these notices, as well as a reference directing the user to the\n   copies of the GNU GPL and this license document.\n\n   d) Do one of the following:\n\n       0) Convey the Minimal Corresponding Source under the terms of this\n       License, and the Corresponding Application Code in a form\n       suitable for, and under terms that permit, the user to\n       recombine or relink the Application with a modified version of\n       the Linked Version to produce a modified Combined Work, in the\n       manner specified by section 6 of the GNU GPL for conveying\n       Corresponding Source.\n\n       1) Use a suitable shared library mechanism for linking with the\n       Library.  A suitable mechanism is one that (a) uses at run time\n       a copy of the Library already present on the user's computer\n       system, and (b) will operate properly with a modified version\n       of the Library that is interface-compatible with the Linked\n       Version.\n\n   e) Provide Installation Information, but only if you would otherwise\n   be required to provide such information under section 6 of the\n   GNU GPL, and only to the extent that such information is\n   necessary to install and execute a modified version of the\n   Combined Work produced by recombining or relinking the\n   Application with a modified version of the Linked Version. (If\n   you use option 4d0, the Installation Information must accompany\n   the Minimal Corresponding Source and Corresponding Application\n   Code. If you use option 4d1, you must provide the Installation\n   Information in the manner specified by section 6 of the GNU GPL\n   for conveying Corresponding Source.)\n\n  5. Combined Libraries.\n\n  You may place library facilities that are a work based on the\nLibrary side by side in a single library together with other library\nfacilities that are not Applications and are not covered by this\nLicense, and convey such a combined library under terms of your\nchoice, if you do both of the following:\n\n   a) Accompany the combined library with a copy of the same work based\n   on the Library, uncombined with any other library facilities,\n   conveyed under the terms of this License.\n\n   b) Give prominent notice with the combined library that part of it\n   is a work based on the Library, and explaining where to find the\n   accompanying uncombined form of the same work.\n\n  6. Revised Versions of the GNU Lesser General Public License.\n\n  The Free Software Foundation may publish revised and/or new versions\nof the GNU Lesser General Public License from time to time. Such new\nversions will be similar in spirit to the present version, but may\ndiffer in detail to address new problems or concerns.\n\n  Each version is given a distinguishing version number. If the\nLibrary as you received it specifies that a certain numbered version\nof the GNU Lesser General Public License \"or any later version\"\napplies to it, you have the option of following the terms and\nconditions either of that published version or of any later version\npublished by the Free Software Foundation. If the Library as you\nreceived it does not specify a version number of the GNU Lesser\nGeneral Public License, you may choose any version of the GNU Lesser\nGeneral Public License ever published by the Free Software Foundation.\n\n  If the Library as you received it specifies that a proxy can decide\nwhether future versions of the GNU Lesser General Public License shall\napply, that proxy's public statement of acceptance of any version is\npermanent authorization for you to choose that version for the\nLibrary.\n","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)","Operating System :: OS Independent","Programming Language :: Python","Programming Language :: Python :: 3","Programming Language :: Python :: 3 :: Only","Programming Language :: Python :: 3.10","Programming Language :: Python :: 3.11","Programming Language :: Python :: 3.12","Programming Language :: Python :: 3.13","Topic :: Scientific/Engineering :: Image Processing"],"requires_dist":["numpy","tqdm","tensorflow","scikit-image","matplotlib","nibabel","scipy","h5py","paramiko","scp","pandas","napari>=0.4.19; extra == \"napari\"","magicgui>=0.6.0; extra == \"napari\"","PyQt5; extra == \"napari\"","qtpy>=2.0.0; extra == \"napari\""],"requires_python":">=3.10","requires_external":null,"project_url":null,"provides_extra":["napari"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}