Metadata-Version: 2.1
Name: dcm_ball_detector
Version: 0.0.9
Summary: given a .dcm format image sequence, identify the positions of all spherical markers from this image sequence.
Author-email: GGN_2015 <premierbob@qq.com>
License: MIT License
        
        Copyright (c) 2024 GGN_2015
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydicom
Requires-Dist: pylibjpeg
Requires-Dist: pylibjpeg-libjpeg
Requires-Dist: tqdm
Requires-Dist: numpy
Requires-Dist: matplotlib
Requires-Dist: scipy
Requires-Dist: scikit-learn
Requires-Dist: scikit-image

# dcm_ball_detector
given a `.dcm` format image sequence, identify the positions of all spherical markers from this image sequence.

## install

- it is recommended that this module should be installed in a python virtual environment (venv).

```bash
pip install dcm-ball-detector
```

## usage

- we assume that you have put your `.dcm` files into a folder of which the path is `<folder path>`.

- we assume that your `.dcm` files are named under **alphabetical order**.

- use the following command to get a prediction of the position of the marker balls.

```bash
python3 -m dcm_ball_detector <folder path>
```

- the program will output something like below to stdout:

```json
[{"xmm": 349.02488432862555, "ymm": 328.00209214017735, "zmm": 132.5840302807579}, {"xmm": 331.0029681581956, "ymm": 274.1596321456759, "zmm": 161.7956332082969}, {"xmm": 388.61439982471455, "ymm": 341.3301036489755, "zmm": 176.0079302709168}, {"xmm": 364.3212735729133, "ymm": 280.99146326745836, "zmm": 201.8262056427377}]
```

## debug

- if you want to show the debug info of the marker balls, use the following command:

```bash
python3 -m dcm_ball_detector --debug <folder path>
```

- after the program has been finished, in stderr there will be a line like:

```bash
   tips: relevant images in: .../dcm_ball_detector/log_image
```

- relevant images for debugging will be listed in folder `.../dcm_ball_detector/log_image`.
