Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenterpstra authored May 4, 2023
1 parent aaa06d5 commit 765786f
Showing 1 changed file with 25 additions and 18 deletions.
43 changes: 25 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ against CT.

To get a local copy up and running follow these simple steps.

### Prerequisites

* numpy
```sh
pip install numpy
```


### Installation

Expand All @@ -84,29 +77,43 @@ or
git clone [email protected]:SynthRAD2023/metrics.git
```

### Prerequisites

* numpy
```sh
pip install -r requirements.txt
```

<!-- USAGE EXAMPLES -->

## Usage

The main file ``.py`` is meant to:
* Calculate the image similarity metrics;
The metrics are computed in two files: `image_metrics.py` and `dose_metrics.py`.
These compute respectively,
* The image similarity between the ground-truth CT and the synthetic CT. Thes metrics include the mean squared error (MSE), peak signal to noise ratio (PSNR), and structural similarity (SSIM).
* The metrics to compare the dose delivered to the ground truth and the synthetic CT. These metrics include the mean absolute dose (MAE), dose-volume histogram difference (DVH), and the gamma pass rate.



### Functions Descriptions
In general, any function can be used in the following way.

**a(input, output)**

description:
open nifti using SimpleITK and calculate ... metrics
compute the metric a (e.g., mse, psnr, ssim) between input and output

arguments:
input: file containing nifti file (example 'C:\path\containing\input.nii.gz')
output: output file path for list of metrics (example: 'C:\path\to\folder\ouput.csv')

command line usage:
python metrics.py ...'



input: The numpy array of the ground-truth image
output: The numpy array of the predicted image

All metrics can be computed by using the `score_patient`, which loads the data and returns all metrics:
```
metrics = ImageMetrics()
ground_truth_path = "path/to/ground_truth.mha"
predicted_path = "path/to/prediction.mha"
print(metrics.score_patient(ground_truth_path, predicted_path))
```
<!-- ROADMAP -->
## Roadmap

Expand Down

0 comments on commit 765786f

Please sign in to comment.