{"name":"neuro-sam","display_name":"Neuro-SAM","visibility":"public","icon":"","categories":[],"schema_version":"0.2.1","on_activate":null,"on_deactivate":null,"contributions":{"commands":[{"id":"neuro-sam.make_widget","title":"Neuro-SAM","python_name":"neuro_sam.napari_utils.main_widget:NeuroSAMWidget","short_title":null,"category":null,"icon":null,"enablement":null}],"readers":null,"writers":null,"widgets":[{"command":"neuro-sam.make_widget","display_name":"Neuro-SAM","autogenerate":false}],"sample_data":null,"themes":null,"menus":{},"submenus":null,"keybindings":null,"configuration":[]},"package_metadata":{"metadata_version":"2.4","name":"neuro-sam","version":"0.1.18","dynamic":null,"platform":null,"supported_platform":null,"summary":"Neuro-SAM: Foundation Model for Dendrite and Dendritic Spine Segmentation","description":"<div align=\"center\">\n\n# Neuro-SAM\n#### Foundation Model for Dendrite and Dendritic Spine Segmentation\n\n</div>\n\nNeuro-SAM is a napari plugin for analysing dendritic morphology in 3D fluorescence microscopy stacks. It enables you to:\n\n- Trace individual dendrites in a 3D volume using waypoint-guided brightest-path search\n- Segment traced dendrites using a fine-tuned SAM2 model\n- Detect dendritic spines along each traced path\n- Segment individual spines using a dedicated fine-tuned SAM2 model\n\nNeuro-SAM works across imaging modalities including two-photon, confocal, and STED microscopy.\n\n---\n\n### 🚀 Installation\n\nNeuro-SAM requires **Python 3.10+**. We recommend using Conda/Miniconda for environment management.\n\n```bash\npip install neuro-sam\n```\n\nModels are downloaded automatically on first use and stored in `src/neuro_sam/checkpoints/` — easy to find and delete.\n\nTo pre-download all models and the sample dataset:\n\n```bash\nneuro-sam-download\n```\n\nGPU acceleration is supported via **CUDA** and **MPS** (Apple Silicon).\n\n---\n\n### 📊 Usage\n\n```bash\n# Launch with the built-in benchmark dataset\nneuro-sam\n\n# Launch with your own dataset\nneuro-sam --image-path /path/to/your/image.tif\n```\n\n---\n\n### 🗃 Repository Structure\n\n```\nsrc/neuro_sam/\n├── checkpoints/          # model weights (auto-downloaded on first use)\n├── napari_utils/         # UI widgets and inference modules\n│   ├── main_widget.py          # top-level plugin widget\n│   ├── path_tracing_module.py  # waypoint path tracing\n│   ├── segmentation_module.py  # dendrite segmentation\n│   ├── segmentation_model.py   # SAM2 dendrite model wrapper\n│   ├── spine_detection_module.py     # spine detection\n│   ├── spine_segmentation_module.py  # spine segmentation UI\n│   ├── spine_segmentation_model.py   # SAM2 spine model wrapper\n│   └── anisotropic_scaling.py  # voxel spacing / scaling\n├── brightest_path_lib/   # waypoint A* path tracing algorithm\n├── training/             # training scripts for fine-tuning\n├── plugin.py             # napari entry point\n└── utils.py              # model download and shared utilities\n```\n\n---\n\n### 🔬 Workflow\n\n#### 1. Configure Voxel Spacing\nIn the **Path Tracing** tab, set accurate X, Y, Z voxel spacing (nm) for your acquisition. This ensures correct anisotropic scaling throughout the pipeline.\n\n#### 2. Trace Dendritic Paths\n- Click waypoints along dendrite structures in the viewer\n- Use **Load Dataset** to switch datasets without restarting\n- The algorithm finds the optimal brightest path between waypoints\n\n#### 3. Segment Dendrites\n- Go to the **Segmentation** tab\n- Load the pre-trained SAM2 dendrite model\n- Run segmentation on individual traced paths\n\n#### 4. Detect Spines\n- Go to the **Spine Detection** tab\n- Select a segmented path\n- Run automatic spine detection using tubular view analysis\n\n#### 5. Segment Spines\n- Go to the **Spine Segmentation** tab\n- Load the pre-trained SAM2 spine model\n- Run spine segmentation on detected spine positions\n- Export spine masks as TIFF files\n\n---\n\n### 🗂 Models\n\n| Model | Description |\n|---|---|\n| `sam2.1_hiera_small.pt` | SAM2 base checkpoint |\n| `dendrite_model.torch` | Fine-tuned weights for dendrite segmentation |\n| `spine_model.torch` | Fine-tuned weights for spine segmentation |\n\nAll models are downloaded from the [GitHub release](https://github.com/nipunarora8/Neuro-SAM/releases/tag/weights) on first use.\n\n---\n\n### 📬 Contact\n\n- Nipun Arora — nipunarora8@yahoo.com\n\n<div align=\"center\">\n<b>Made with ♥️ at <a href='https://anki.xyz'>Anki Lab</a> 🧠✨</b>\n</div>\n","description_content_type":"text/markdown","keywords":null,"home_page":null,"download_url":null,"author":null,"author_email":"Nipun Arora <nipunarora8@yahoo.com>","maintainer":null,"maintainer_email":null,"license":"MIT","classifier":["Programming Language :: Python :: 3","License :: OSI Approved :: MIT License","Operating System :: OS Independent","Framework :: napari"],"requires_dist":["napari","numpy","scipy","imageio","torch>=2.0.0","torchvision>=0.15.0","hydra-core>=1.3.2","iopath>=0.1.10","pillow>=9.4.0","tqdm>=4.66.1","vispy","qtpy","superqt","magicgui","scikit-image","tifffile","numba","PyQt5","opencv-python-headless","matplotlib","requests","flammkuchen","albumentations","wandb","tensorflow","imagecodecs"],"requires_python":">=3.10","requires_external":null,"project_url":["Homepage, https://github.com/nipunarora8/Neuro-SAM","Bug Tracker, https://github.com/nipunarora8/Neuro-SAM/issues"],"provides_extra":null,"provides_dist":null,"obsoletes_dist":null},"npe1_shim":false}