Metadata-Version: 2.4
Name: medcore
Version: 1.6.0
Summary: Medical imaging utilities based on SimpleITK
Author-email: yongho choi <yhchoi@hutom.co.kr>
Maintainer-email: DATA <dm@hutom.co.kr>
License: MIT License
        
        Copyright (c) 2026 최용호
        
        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.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: pydicom>=3.0
Requires-Dist: SimpleITK>=2.4
Requires-Dist: networkx>=3.0
Requires-Dist: matplotlib>=3.7
Requires-Dist: opencv-python-headless>=4.8
Requires-Dist: scikit-image>=0.21
Requires-Dist: scipy>=1.11
Provides-Extra: dev
Requires-Dist: black>=24.0; extra == "dev"
Requires-Dist: pre-commit>=4.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: ruff>=0.11.0; extra == "dev"
Dynamic: license-file

# medcore

Medical imaging utilities for DICOM / NIfTI workflows based on SimpleITK.

## Features
- IO
  - DICOM / NIfTI reading (`ImageReader`)
- Image utils
  - intensity array conversion / normalization
  - resampling / transform helpers
  - NIfTI write and label merge utilities
- Detection
  - coronal angle estimation
  - umbilicus detection helpers
- Segmentation
  - torso and abdomen segmentation classes
- Feature extraction
  - label area/volume summary
  - patch extraction around landmark points

## Installation
### From source
```bash
git clone https://github.com/yhchoi-data/medcore.git
cd medcore
pip install .
```

### From source (developer mode)
```bash
git clone https://github.com/yhchoi-data/medcore.git
cd medcore
pip install -e ".[dev]"
```

### From pypi [to be updated]
```bash
pip install medcore
```

### Optional: DICOM to NIfTI conversion with dcm2niix
`medcore.io.convert_dicom_to_nifti` uses the external `dcm2niix` executable.
Install it separately when you need dcm2niix-based DICOM to NIfTI conversion:

```bash
conda install -c conda-forge dcm2niix
```

After installation, make sure the executable is available in your shell or
notebook kernel:

```bash
dcm2niix -h
```

## Quick start

```python
from medcore.io import ImageReader, convert_dicom_to_nifti
from medcore.utils import (
    sitk_get_array,
    sitk_write_nii,
    sitk_read_labelfiles,
)

from medcore.detect import UmbilicusPredictor, UmbilicusDetector
from medcore.segment import TorsoSegmenter, AbdomenSegmenter
from medcore.feature import compute_label_volumes, extract_patches_from_image
```

## Package usage

```python
# IO
from medcore.io import ImageReader

# Utility functions
from medcore.utils import sitk_resampler, figure_overlay_label_on_slices

# Detection / segmentation
from medcore.detect import UmbilicusPredictor
from medcore.segment import TorsoSegmenter

# Feature extraction
from medcore.feature import compute_label_areas, compute_label_volumes
```

## Documentation
Detailed examples are in [USAGE.md](USAGE.md).

## Developer workflow

```bash
pre-commit run --all-files
```

On the first run, some hooks may show `Failed` because they automatically fix files such as trailing whitespace or formatting. That is normal. Run `pre-commit run --all-files` once more and it should pass after the auto-fixes are applied.
