Metadata-Version: 2.4
Name: autoseg
Version: 1.0.1
Summary: Run TotalSegmentator segmentation on NIfTI files in a folder tree.
Author: AutoSeg contributors
License-Expression: MIT
Project-URL: Homepage, https://github.com/Z-ttack/AutoSeg.git
Project-URL: Source, https://github.com/Z-ttack/AutoSeg.git
Project-URL: Issues, https://github.com/Z-ttack/AutoSeg.git/issues
Keywords: nifti,segmentation,totalsegmentator,medical-imaging
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# AutoSeg

AutoSeg runs [TotalSegmentator](https://github.com/wasserth/totalsegmentator) on every `.nii` or `.nii.gz` file inside a folder tree.

Given a root folder, it searches that folder and all subfolders for NIfTI files, runs:

```powershell
TotalSegmentator -i <input_file> -o <output_folder> -ta <task>
```

and saves each segmentation output beside the source scan.

## Requirements

- Python 3.9 or newer
- TotalSegmentator installed and available on your command line

Install TotalSegmentator separately before using this package. You should be able to run:

```powershell
TotalSegmentator --help
```

## Install

After this package is published to PyPI, users will be able to install it with:

```powershell
pip install autoseg
```

## Task Argument

AutoSeg adds the `-ta` flag to the TotalSegmentator command for you. You only need to provide the task name:

```powershell
autoseg "C:\path\to\scans" total
```

## Usage

Run AutoSeg on a folder:

```powershell
autoseg "C:\path\to\scans" total
```

Use another TotalSegmentator task by passing the task name after the folder:

```powershell
autoseg "C:\path\to\scans" teeth
```

If you leave the task name off, AutoSeg prompts for it during runtime:

```powershell
autoseg "C:\path\to\scans"
```

Preview what would run without starting TotalSegmentator (Reduced wait time for testing/troubleshooting):

```powershell
autoseg "C:\path\to\scans" total --dry-run
```

## Output Folders

For each input file, AutoSeg creates a segmentation folder in the same directory as the scan.

Examples:

```text
C:\data\patient01\scan.nii.gz
C:\data\patient01\scan_segmentations\

C:\data\patient02\upper_jaw.nii
C:\data\patient02\upper_jaw_segmentations\
```

If the expected output folder already exists and contains files, AutoSeg skips that scan so it does not run segmentation again.


