Skip to content

Commit

Permalink
adding acdc dataset example for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jizong committed Nov 26, 2021
1 parent ce075e5 commit e34125b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@
| ![Python](https://img.shields.io/badge/python-3.6/3.7/3.8-orange) | ![System](https://img.shields.io/badge/Windows-blue) | ![Unittests Windows](https://github.com/PhoenixDL/rising/workflows/Unittests%20Windows/badge.svg) |
| ![Python](https://img.shields.io/badge/python-3.6/3.7/3.8-orange) | ![System](https://img.shields.io/badge/MacOS-blue) | ![Unittests macOS](https://github.com/PhoenixDL/rising/workflows/Unittests%20MacOS/badge.svg) |

## What I have modified from the original repo?

I noticed that rising under its current form has small bugs and inconsistency in terms of design and performance, especially for medical image segmentation task with 3D volumes. Based on project requirement, several improvements have been made so that it can now enjoy a better compatibility with 3D datas and intenstive augmentation operations using GPUs. Issues and PRs are welcome.

Thanks a lot @Yuxiang1990 for the kind PR.

## Working example on ACDC dataset

[ACDC example](notebooks/medical_seg/acdc_seg.py) should provide a resonable example of how to use rising besides the below
explanations.

______________________________________________________________________

## What is `rising`?

Rising is a high-performance data loading and augmentation library for 2D *and* 3D data completely written in PyTorch.
Expand All @@ -27,13 +40,6 @@ Multiple examples for different use cases can be found in our [tutorial docs](ht
[Example Transformation Output](https://rising.readthedocs.io/en/latest/transformations.html),
[Integration of External Frameworks](https://rising.readthedocs.io/en/latest/external_augmentation.html)

## What I have modified from the original repo?

I noticed that rising under its current form has small bugs and inconsistency in terms of design and performance, especially for medical image segmentation task with 3D volumes. Based on project requirement, several improvements have been made so that it can now enjoy a better compatibility with 3D datas and intenstive augmentation operations using GPUs. Issues and PRs are welcome.

Thanks a lot @Yuxiang1990 for the kind PR.


## Why another framework?

| | rising | TorchIO | Batchgenerators | Kornia | DALI | Vanilla PyTorch | Albumentations |
Expand Down
5 changes: 4 additions & 1 deletion notebooks/medical_seg/acdc_seg.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
transforms.GammaCorrection(gamma=UniformParameter(0.8, 2), keys=("image",)),
transforms.RicianNoiseTransform(keys=("image",), std=0.05, keep_range=False),
transforms.BaseAffine(
scale=(1, UniformParameter(0.5, 2), UniformParameter(0.9, 1.2)),
scale=(1, UniformParameter(0.5, 4), UniformParameter(0.9, 1.2)),
rotation=(0, UniformParameter(-10, 10), UniformParameter(-10, 10)),
degree=True,
p=1,
Expand Down Expand Up @@ -56,6 +56,9 @@

for data in tqdm(tra_loader):
image, label = data["image"], data["label"]
from tests.realtime_viewer import multi_slice_viewer_debug

multi_slice_viewer_debug([*image.squeeze()], *label.squeeze(), block=True, no_contour=True)
# from tests.realtime_viewer import multi_slice_viewer_debug
#
# for img, lab in zip(image, label):
Expand Down
6 changes: 3 additions & 3 deletions tests/realtime_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def previous_slice(ax):
else:
ax.con.remove()
ax.con = ax.imshow(ax.gt_volume[ax.index], alpha=alpha, cmap="rainbow")
ax.set_title(f"plane = {ax.index}")
# ax.set_title(f"plane = {ax.index}")

def next_slice(ax):
img_volume = ax.img_volume
Expand All @@ -107,7 +107,7 @@ def next_slice(ax):
else:
ax.con.remove()
ax.con = ax.imshow(ax.gt_volume[ax.index], alpha=alpha, cmap="rainbow")
ax.set_title(f"plane = {ax.index}")
# ax.set_title(f"plane = {ax.index}")

try:
import matplotlib
Expand Down Expand Up @@ -147,7 +147,7 @@ def next_slice(ax):
except Exception as e:
pass
ax.axis("off")
ax.set_title(f"plane = {ax.index}")
# ax.set_title(f"plane = {ax.index}")

fig.canvas.mpl_connect("key_press_event", process_key)
fig.canvas.mpl_connect("scroll_event", process_mouse_wheel)
Expand Down

0 comments on commit e34125b

Please sign in to comment.