{"name":"napari-myelin-quantifier","display_name":"Myelin Quantifier","visibility":"public","icon":"","categories":[],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"napari-myelin-quantifier.myelin_quantifier_widget","title":"Myelin Rings: Quantify","python_name":"napari_myelin_quantifier._widget:myelin_quantifier_widget","short_title":null,"category":null,"icon":null,"enablement":null},{"id":"napari-myelin-quantifier.myelin_quantifier_dashboard","title":"Myelin Rings: Locate by ID","python_name":"napari_myelin_quantifier._widget:myelin_locator_dashboard","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"napari-myelin-quantifier.myelin_quantifier_widget","display_name":"Myelin Rings: Quantify","autogenerate":false},{"command":"napari-myelin-quantifier.myelin_quantifier_dashboard","display_name":"Myelin Rings: Locate by ID","autogenerate":false}],"sample_data":null,"themes":null,"menus":{"napari/plugins":[{"command":"napari-myelin-quantifier.myelin_quantifier_widget","when":"True","group":null,"alt":null},{"command":"napari-myelin-quantifier.myelin_quantifier_dashboard","when":"True","group":null,"alt":null}]},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"napari-myelin-quantifier","version":"1.1.1","dynamic":["license-file"],"platform":null,"supported_platform":null,"summary":"Myelinated Axon Quantification with Label Tracking","description":"# napari-myelin-quantifier\n\n[![License MIT](https://img.shields.io/pypi/l/napari-myelin-quantifier.svg?color=green)](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/raw/main/LICENSE)\n[![PyPI](https://img.shields.io/pypi/v/napari-myelin-quantifier.svg?color=green)](https://pypi.org/project/napari-myelin-quantifier)\n[![Python Version](https://img.shields.io/pypi/pyversions/napari-myelin-quantifier.svg?color=green)](https://python.org)\n[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-myelin-quantifier)](https://napari-hub.org/plugins/napari-myelin-quantifier)\n\n---\n\n## Overview\n\n`napari-myelin-quantifier` is a napari plugin for quantitative analysis of 2D cross-sectional myelinated axons from binary segmentation masks.\n\nThe plugin identifies individual myelin rings, assigns a unique `ring_id` to each structure, and exports morphometric measurements for downstream analysis.\n\nIt enables reproducible extraction of:\n\n- Axon diameter\n- Fiber diameter\n- Myelin thickness\n- g-ratio\n\n---\n\n## Installation\n\nInstall via pip:\n\n```bash\npip install napari-myelin-quantifier\n```\nIf napari is not installed:\n```bash\npip install \"napari-myelin-quantifier[all]\"\n```\n\nDevelopment version:\n```bash\npip install git+https://github.com/wulinteousa2-hash/napari-myelin-quantifier.git\n```\n\n## Input Requirements\n\nThe plugin accepts either:\n\n- A 2D binary mask layer\n\nExpected mask semantics:\n\n- Myelin = foreground (non-zero / True)\n- Background = 0 / False\n- Recommended: clean segmentation without holes or broken rings\n\nIf your mask is stored as RGB/RGBA or grayscale, use the optional Quick Mask Prep\nsection in the quantify panel to convert it into a binary mask first.\n\n## Quick Mask Prep (Optional)\n\nThis helper is intended for users who already have a segmented mask, but the\nfile is stored as RGB/RGBA or grayscale instead of a clean binary mask.\n\nAvailable quick actions:\n\n- `1-Channel` → create a single-channel image layer\n- `Invert` → create an inverted single-channel image layer\n- `Binary (Otsu)` → convert the selected layer into a binary Labels layer\n\nThe prepared binary layer is automatically selected in the quantifier `mask layer`\nfield so you can run quantification immediately.\n\nExample Binary Mask\n\n![Binary Mask](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/blob/main/docs/images/1_mask.PNG)\n\n*Image courtesy of Bo Hu Lab, Houston Methodist Research Institute.*\n\n## Ring Detection and Labeling\n\nEach connected myelin ring is:\n\n- Assigned a unique `ring_id`\n\n- Spatially localized using centroid coordinates\n\n- Evaluated for ring topology using Euler characteristic\n\nExample Labeled Output\n\n![MultiROI](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/blob/main/docs/images/2_multiROI_connected_components.PNG)\n\n![MultiROI_ring_ID](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/blob/main/docs/images/3_result_labels.PNG)\n\n## Topological Validation (Euler Characteristic)\n\nThe Euler number ensures valid ring topology:\n\n- Euler = 0 → valid ring (one hole)\n\n- Euler ≠ 0 → solid object or fragmented structure\n\nThis prevents non-myelinated artifacts from being included in analysis.\n\nTopology Illustration\n\n![Euler = 0 and  ≠ 0 ](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/blob/main/docs/images/4_2D_euler_number_0.PNG)\n\n## Quantitative Output (CSV)\n\nFor each ring, the plugin exports:\n\n`ring_id`\n\n`centroid_x, centroid_y`\n\n`bbox_x0, bbox_y0, bbox_x1, bbox_y1`\n\n`ring_area_px`\n\n`lumen_area_px`\n\n`filled_area_px`\n\n`euler`\n\n`touches_border`\n\nExample:\n\n```python\nring_id,centroid_x,centroid_y,bbox_x0,bbox_y0,bbox_x1,bbox_y1,ring_area_px,lumen_area_px,filled_area_px,euler,touches_border\n1,873.8658,34.4421,857,18,890,52,380,556,936,0,False\n```\n\n## Derived Morphometric Parameters\n\nAssuming approximately circular cross-sections:\n\n### Axon diameter:\n```Code\nd_axon = 2 × sqrt(lumen_area / π)\n```\n### Fiber diameter:\n```Code\nd_fiber = 2 × sqrt(filled_area / π)\n```\n### Myelin thickness:\n```Code\nt = (d_fiber − d_axon) / 2\n```\n### g-ratio:\n```Code\ng = d_axon / d_fiber\n```\nNote: These are geometric approximations. For highly irregular axons, area-based statistics may be preferable.\n\n## Typical Workflow\n\n1. Load your mask into napari.\n\n2. If needed, use `Quick Mask Prep` to convert RGB/RGBA or grayscale mask images into a binary mask.\n\n3. Open:\n- Plugins → Myelin Rings: Quantify\n\n4. Adjust filtering parameters:\n\n- Minimum ring area\n\n- Minimum lumen area\n\n- Exclude border objects (recommended)\n\n5. Run quantification.\n\n6. Optional: open Plugins → Myelin Rings: Locate by ID to jump to a specific `ring_id`.\n\n7. Export CSV.\n\n8. Perform statistical analysis in Python, R, or Excel.\n\nInterface\n\n![Interface ](https://github.com/wulinteousa2-hash/napari-myelin-quantifier/blob/main/docs/images/interface.PNG)\n\n## Acknowledgements\n\nExample microscopy data used in documentation were generated by the **Bo Hu Lab**, Houston Methodist Research Institute.\n\nImaging hardware and infrastructure support were provided by the **Electron Microscopy Core**, directed by **István Katona**, Houston Methodist Research Institute.\n\n## Contributing\n\nContributions are welcome. Please ensure tests pass before submitting pull requests.\n\nLicense\n\nMIT License.\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":"Wulin Teo","author_email":"wulinteo.usa2@gmail.com","maintainer":null,"maintainer_email":null,"license":"The MIT License (MIT)\n\nCopyright (c) 2026 Wulin Teo\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","classifier":["Development Status :: 2 - Pre-Alpha","Framework :: napari","Intended Audience :: Developers","License :: OSI Approved :: MIT License","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","magicgui","qtpy","scikit-image","napari[all]; extra == \"all\""],"requires_python":">=3.10","requires_external":null,"project_url":["Bug Tracker, https://github.com/wulinteousa2-hash/napari-myelin-quantifier/issues","Documentation, https://github.com/wulinteousa2-hash/napari-myelin-quantifier#README.md","Source Code, https://github.com/wulinteousa2-hash/napari-myelin-quantifier","User Support, https://github.com/wulinteousa2-hash/napari-myelin-quantifier/issues"],"provides_extra":["all"],"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}