https://github.com/digital-porous-media/dpm_srm

https://github.com/digital-porous-media/dpm_srm

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.2%) to scientific vocabulary
Last synced: 5 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: digital-porous-media
  • License: other
  • Language: C++
  • Default Branch: main
  • Size: 217 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

Statistical Region Merging

Statistical Region Merging (SRM) is a method for image segmentation. The labeled image is initialized such that each pixel (or voxel) corresponds to one region. A statistical test on neighboring regions determines whether the mean intensities are similar enough to be merged.

This library is an adaptation of the SRM plugin to Fiji/ImageJ and is based on the algorithm proposed in Nock and Nielsen (2004). Our contribution was to translate the original algorithm to C++ and wrap it in Python. We provide this package under the Digital Porous Media (DPM) organization.

Installation:

dpm_srm is packaged on pypi and can be installed with pip. pip install dpm-srm.

If installing from source, this package requires a C++ compiler.

Usage Example:


This implementation of SRM expects a 2D or 3D grayscale (single color channel) image of type uint8, uint16, or uint32 and a value for Q, which is used as a merging criterion. Roughly speaking, Q is an estimate of the number of expected regions, though this is not strictly adhered to. The larger the Q value, the more regions are produced. The algorithm will return a labeled image of the same shape and datatype as the input image.

Note that the algorithm performs bucket sorting, where the number of buckets correspond to the maximum allowable value for the particular datatype. Therefore, it's important that intensity values of the input image are scaled over the entire range of the datatype. For example, if the input image is uint8, the image should be scaled such that the minimum intensity value is 0, and the maximum is 255. If the input image is uint16 or uint32, the minimum values should be 0 and the maximum should be 65535 (or 4294967295) respectively.

We wrapped each version (2D vs. 3D, dtype) of the template class into individual class instances. The nomenclature is: SRM[2(or 3)]Dunumberofbits (e.g. ```SRG2Du8(),SRG3D_u32()```).

Python Example: ``` import dpm_srm import numpy as np

np.random.seed(130621) image = np.random.randint(0, 256, size=(100, 200, 200), dtype=np.uint8)

srmobj = dpmsrm.SRM3Du8(image, Q=5.0) srmobj.segment() segmentation = srmobj.getresult() ```

Acknowledgements

This project includes code adapted from Statistical Region Merging by Johannes Schindelin, which is licensed under the BSD 2-Clause License.

The original code can be found here

Owner

  • Name: Digital Porous Media
  • Login: digital-porous-media
  • Kind: organization
  • Email: bcchang@utexas.edu

GitHub Events

Total
Last Year

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 256 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: dpm-srm

Statistical Region Merging Segmentation

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 256 Last month
Rankings
Dependent packages count: 10.2%
Average: 33.9%
Dependent repos count: 57.5%
Maintainers (1)
Last synced: 5 months ago

Dependencies

.github/workflows/build.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v4 composite
pyproject.toml pypi
  • numpy *
setup.py pypi