dpm-srm 0.1.9__cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dpm_srm
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
Summary: Statistical Region Merging Segmentation
|
|
5
|
+
Author: Digital Porous Media
|
|
6
|
+
Author-email: Digital Porous Media <bcchang@utexas.edu>
|
|
7
|
+
License: BSD License
|
|
8
|
+
Project-URL: Homepage, https://github.com/digital-porous-media/
|
|
9
|
+
Project-URL: Repository, https://github.com/digital-porous-media/dpm_srm
|
|
10
|
+
Project-URL: Issues, https://github.com/digital-porous-media/dpm_srm/issues
|
|
11
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Requires-Python: >=3.8
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: numpy
|
|
26
|
+
Dynamic: author
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Statistical Region Merging
|
|
30
|
+
|
|
31
|
+
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.
|
|
32
|
+
|
|
33
|
+
This library is an adaptation of the [SRM plugin to Fiji/ImageJ](https://imagej.net/plugins/statistical-region-merging) and is based on the algorithm proposed in [Nock and Nielsen (2004)](10.1109/tpami.2004.110). 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.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
## Installation:
|
|
37
|
+
dpm_srm is packaged on [pypi](https://pypi.org/project/dpm-srm/) and can be installed with pip.
|
|
38
|
+
```pip install dpm-srm```.
|
|
39
|
+
|
|
40
|
+
If installing from source, this package requires a C++ compiler.
|
|
41
|
+
|
|
42
|
+
## Usage Example:
|
|
43
|
+
---
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
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.
|
|
47
|
+
|
|
48
|
+
We wrapped each version (2D vs. 3D, dtype) of the template class into individual class instances. The nomenclature is: SRM[2(or 3)]D_u[number_of_bits]() (e.g. ```SRG2D_u8()```, ```SRG3D_u32()```).
|
|
49
|
+
|
|
50
|
+
**Python Example:**
|
|
51
|
+
```
|
|
52
|
+
import dpm_srm
|
|
53
|
+
import numpy as np
|
|
54
|
+
|
|
55
|
+
np.random.seed(130621)
|
|
56
|
+
image = np.random.randint(0, 256, size=(100, 200, 200), dtype=np.uint8)
|
|
57
|
+
|
|
58
|
+
srm_obj = dpm_srm.SRM3D_u8(image, Q=5.0)
|
|
59
|
+
srm_obj.segment()
|
|
60
|
+
segmentation = srm_obj.get_result()
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
## Acknowledgements
|
|
65
|
+
This project includes code adapted from Statistical Region Merging by Johannes Schindelin, which is licensed under the BSD 2-Clause License.
|
|
66
|
+
|
|
67
|
+
The original code can be found [here](https://github.com/fiji/Statistical_Region_Merging/tree/master)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
dpm_srm.cpython-310-x86_64-linux-gnu.so,sha256=78WvlY36Fj8oJNDA7-ADyrqQvS5z_jiJogFJ1KBalBU,337776
|
|
2
|
+
dpm_srm-0.1.9.dist-info/METADATA,sha256=BgU3z1E1TGnnOrLlj4-VvHZr1s7ajIuJxGBoiu9en1w,3724
|
|
3
|
+
dpm_srm-0.1.9.dist-info/WHEEL,sha256=xC5vN6wBTmB2C4Fr7td38rfq_jDc4PtO4UseGSOZNLo,153
|
|
4
|
+
dpm_srm-0.1.9.dist-info/top_level.txt,sha256=7x0Y5PfjV6e74A2kkg8ayzUTPlgqLbLdjZkWsP6TiL8,8
|
|
5
|
+
dpm_srm-0.1.9.dist-info/RECORD,,
|
|
6
|
+
dpm_srm-0.1.9.dist-info/licenses/LICENSE,sha256=DPkH2YUOqq6GA9joNyrjSii3kGn-7Wn2CMYV5rY-Gok,3073
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
BSD 2-Clause License
|
|
2
|
+
|
|
3
|
+
# Attribution
|
|
4
|
+
This project includes code adapted from Statistical Region Merging by Johannes Schindelin, licensed under the BSD 2-Clause License.
|
|
5
|
+
|
|
6
|
+
# Original License
|
|
7
|
+
Copyright (C) 2009 - 2013, Johannes Schindelin
|
|
8
|
+
|
|
9
|
+
* Redistribution and use in source and binary forms, with or without
|
|
10
|
+
* modification, are permitted provided that the following conditions are met:
|
|
11
|
+
*
|
|
12
|
+
* 1. Redistributions of source code must retain the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer.
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
19
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
20
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
21
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
|
|
22
|
+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
23
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
24
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
25
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
26
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
27
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
28
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
29
|
+
*
|
|
30
|
+
* The views and conclusions contained in the software and documentation are
|
|
31
|
+
* those of the authors and should not be interpreted as representing official
|
|
32
|
+
* policies, either expressed or implied, of any organization.
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# Our Contributions
|
|
36
|
+
Copyright (c) 2024, Digital Porous Media
|
|
37
|
+
|
|
38
|
+
Redistribution and use in source and binary forms, with or without
|
|
39
|
+
modification, are permitted provided that the following conditions are met:
|
|
40
|
+
|
|
41
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
42
|
+
list of conditions and the following disclaimer.
|
|
43
|
+
|
|
44
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
45
|
+
this list of conditions and the following disclaimer in the documentation
|
|
46
|
+
and/or other materials provided with the distribution.
|
|
47
|
+
|
|
48
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
49
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
50
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
51
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
52
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
53
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
54
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
55
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
56
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
57
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
dpm_srm
|
|
Binary file
|