Metadata-Version: 2.1
Name: orcaz
Version: 0.1.3.1
Summary: ORCA (Optimized Registration through Conditional Adversarial networks) 
Home-page: 
Author: Zacharias Chalampalakis, PhD, Lalith Kumar Shiyam Sundar, PhD
Author-email: zacharias.chalampalakis@meduniwien.ac.at, lalith.shiyamsundar@meduniwien.ac.at
License: GNU General Public License v3.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyfiglet~=0.8.post1
Requires-Dist: setuptools~=65.5.1
Requires-Dist: nibabel
Requires-Dist: tqdm
Requires-Dist: torch>=0.4.1
Requires-Dist: torchvision>=0.2.1
Requires-Dist: matplotlib
Requires-Dist: tensorboard
Requires-Dist: scipy
Requires-Dist: SimpleITK
Requires-Dist: scikit-learn
Requires-Dist: emoji
Requires-Dist: pydicom
Requires-Dist: dicom2nifti
Requires-Dist: moosez
Requires-Dist: falconz
Requires-Dist: nifti2dicom
Requires-Dist: rich
Requires-Dist: pathlib

![Orca-logo](ORCA_graph.jpg)

## ORCA: Optimized Registration through Conditional Adversarial networks

[![Recommended Version](https://img.shields.io/badge/Recommended-pip%20install%20orcaz%3D%3D0.1.0-9400D3.svg)](https://pypi.org/project/orcaz/0.1.0/) 
[![Monthly Downloads](https://img.shields.io/pypi/dm/orcaz?label=Downloads%20(Monthly)&color=9400D3&style=flat-square&logo=python)](https://pypi.org/project/orcaz/) 
[![Daily Downloads](https://img.shields.io/pypi/dd/orcaz?label=Downloads%20(Daily)&color=9400D3&style=flat-square&logo=python)](https://pypi.org/project/orcaz/)


## **Requirements** ✅

For an optimal experience with ORCA, ensure the following:

- **Operating System**: ORCA runs smoothly on Windows, Mac, or Linux.
- **Memory**: At least 32GB of RAM ensures ORCA operates without a hitch.
- **GPU**: For blazing-fast predictions, an NVIDIA GPU comes highly recommended. But if you don't have one, fret not! ORCA will still get the job done, just at a more leisurely pace.
For training new models, you must have a GPU!
- **Python**: Version 3.9.2 or above. We like to stay updated!

---

## **Installation Guide** 🛠️

Navigating the installation process is a breeze. Just follow the steps below:

**For Linux and MacOS** 🐧🍏
1. Create a Python environment, for example, 'orca-env'.
```bash
python3 -m venv orca-env
```
2. Activate your environment.
```bash
source orca-env/bin/activate  # for Linux
source orca-env/bin/activate  # for MacOS
```
3. Install ORCA.
```bash
pip install orcaz
```

**For Windows** 🪟
1. Set up a Python environment, say 'orca-env'.
```bash
python -m venv orca-env
```
2. Get your environment up and running.
```bash
.\orca-env\Scripts\activate
```
3. Hop over to the PyTorch website and fetch the right version for your system. This step is crucial!
4. Finish up by installing ORCA.
```bash
pip install orcaz
```

## Usage Guide 📚

### Command-line tool for data folder processing :computer: 

```bash
orcaz -d <path_to_patient_dir> -m <mode>
```

Here `<path_to_patient_dir>` refers to the directory containing your subject's PET and CT images. 
Where `<mode>` is the name of the mode for which we want to use the tool, from the available options. 

`train`: Yes we can !! Orca can be used to train your own models as a generic cGAN paltform. More instructions for that to follow !

`generate`: This option will force orca to generate a synthetic CT from your PET data and stop before coregistration. 

`coreg`: Option to generate synethic CT and perform the coregistration pipeline with an output of the co-registered CT. ORCA in its full glory !!



Using ORCA requires your data to be structured according to specific conventions. ORCA supports both DICOM and NIFTI formats. 

### Required Directory Structure 🌳
Please structure your dataset as follows:

```
EXAMPLE_Data_folder/
├── S1
│   ├── CT
│   │   ├── xyz_1.dcm
│   │   ├── xyz_2.dcm
│   │   ├── .
│   │   ├── .
│   │   ├── .
│   │   └── xyz_532.dcm
│   └── AC_FDG_PET
│       ├── xyz_1.dcm
│       ├── xyz_2.dcm
│       ├── .
│       ├── .
│       ├── .
│       └── xyz_532.dcm
├── S2
│   ├── CT
│   │   ├── xyz_1.dcm
│   │   ├── xyz_2.dcm
│   │   ├── .
│   │   ├── .
│   │   ├── .
│   │   └── xyz_532.dcm
│   └── NAC_FDG_PET
│       ├── xyz_1.dcm
│       ├── xyz_2.dcm
│       ├── .
│       ├── .
│       ├── .
│       └── xyz_532.dcm
├── S2
│   ├── CT
│   │   └── xyz_ct.nii
│   └── AC_FDG_PET
│       └── xyz_pt.nii
```

In all these cases, ORCA can be executed on the directories one by one

```bash
orcaz -d S1 -m coreg
orcaz -d S2 -m coreg
orcaz -d S3 -m coreg  
```

**Note:** If the necessary naming conventions are not followed, ORCA will not process the data in the directory.


### Naming Conventions for files 📝
There is none! Currently orca requires the naming of the subject subloders to be of a particular name. 

For instance, `CT` and `NAC_FDG_PET`, or  `CT` and `AC_FDG_PET`.

### Output
After successful completion, the co-registered CT is saved as dicom data in `ORCA_CT_DICOM`.

Intermediate images and warp files are stored within the `ORCA-VXX-YYYY-MM-DD-HH-MM-SS` folder
```
S1
├── CT
├── NAC_FDG_PET
├── ORCA_CT_DICOM
├── ORCA-V01-2023-09-28-00-02-52
```
