Skip to main content

YoloV8 model for the segmentation of the lungs in mice CT scans.

Project description

EPFL Center for Imaging logo

🫁 Lungs segmentation in mice CT scans

screenshot

We provide a YoloV8 model for the segmentation of the lungs region in mice CT scans. The model was trained on 2D slices and can be applied slice by slice to produce 3D segmentations.

[Installation] [Model weights] [Usage]

This project is part of a collaboration between the EPFL Center for Imaging and the De Palma Lab.

Installation

We recommend performing the installation in a clean Python environment. Install our package from PyPi:

pip install mouselungseg

or from the repository:

pip install git+https://gitlab.com/center-for-imaging/lungs-segmentation.git

or clone the repository and install with:

git clone git+https://gitlab.com/center-for-imaging/lungs-segmentation.git
cd mouselungseg
pip install -e .

Model weights

The model weights (~6 Mb) are automatically downloaded from this repository on Zenodo the first time you run inference. The model files are saved in the user home folder in the .mousetumornet directory.

Usage

In Napari

To use our model in Napari, start the viewer with

napari -w mouselungseg

Open an image using File > Open files or drag-and-drop an image into the viewer window.

Sample data: To test the model, you can run it on our provided sample image. In Napari, open the image from File > Open Sample > Mouse lung CT scan.

Next, in the menu bar select Plugins > Lungs segmentation (mouselungseg) to start our plugin.

As a library

You can run a model in just a few lines of code to produce a segmentation mask from an image (represented as a numpy array).

from mouselungseg import LungsPredictor

lungs_predict = LungsPredictor()

segmentation = lungs_predict.predict(your_image)

As a CLI

Run inference on an image from the command-line. For example:

uls_predict_image -i /path/to/folder/image_001.tif

The command will save the segmentation next to the image:

folder/
    ├── image_001.tif
    ├── image_001_mask.tif

To run inference in batch on all images in a folder, use:

uls_predict_folder -i /path/to/folder/

This will produce:

folder/
    ├── image_001.tif
    ├── image_001_mask.tif
    ├── image_002.tif
    ├── image_002_mask.tif

Issues

If you encounter any problems, please file an issue along with a detailed description.

License

This model is licensed under the BSD-3 license.

Related projects

  • Mouse Tumor Net | 3D U-Net model trained to segment tumor nodules in mice CT scans.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mouselungseg-0.0.8.tar.gz (415.2 kB view details)

Uploaded Source

Built Distribution

mouselungseg-0.0.8-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file mouselungseg-0.0.8.tar.gz.

File metadata

  • Download URL: mouselungseg-0.0.8.tar.gz
  • Upload date:
  • Size: 415.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for mouselungseg-0.0.8.tar.gz
Algorithm Hash digest
SHA256 3c3d0ad2788959379b30f95b5e18fa49cc4300dbc935faf6d56f0277b7651990
MD5 489c3a1a89bcdd36da37f8820f3194d4
BLAKE2b-256 c65e1d8846308254d7bba2a65babad65560e87768228be7897900914a91aaaff

See more details on using hashes here.

File details

Details for the file mouselungseg-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: mouselungseg-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for mouselungseg-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 46572a7387060c2b31c12aae0f06dc3504f538cdd7fa9b4e916f9c1aaff2637f
MD5 49c9f0d23887b1f01f2e3c35d0e57b95
BLAKE2b-256 85ac46ce0a20b83ef2f53ef3a7a44fa2ed2d21e59e5184746fb7afa98e842968

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page