Skip to content

Commit

Permalink
Revert "Merge branch 'main' into verify-norm"
Browse files Browse the repository at this point in the history
This reverts commit 1e09cb0, reversing
changes made to be32576.
  • Loading branch information
anwai98 committed Jul 16, 2024
1 parent 1e09cb0 commit 7f2ec8e
Show file tree
Hide file tree
Showing 52 changed files with 120 additions and 2,458 deletions.
9 changes: 2 additions & 7 deletions experiments/unet-segmentation/dsb/train_boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ def train_boundaries(args):

patch_shape = (1, 256, 256)
train_loader = get_dsb_loader(
args.input, patch_shape=patch_shape, split="train",
args.input, patch_shape, split="train",
download=True, boundaries=True, batch_size=args.batch_size
)

# Uncomment this for checking the loader.
# from torch_em.util.debug import check_loader
# check_loader(train_loader, 4)

val_loader = get_dsb_loader(
args.input, patch_shape=patch_shape, split="test",
args.input, patch_shape, split="test",
boundaries=True, batch_size=args.batch_size
)
loss = torch_em.loss.DiceLoss()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from torch_em.data.datasets.medical import get_papila_loader


ROOT = "/scratch/share/cidas/cca/data/papila"
ROOT = "/media/anwai/ANWAI/data/papila"


def check_papila():
Expand All @@ -16,7 +16,7 @@ def check_papila():
download=True,
)

check_loader(loader, 8, plt=True, save_path="./papila.png")
check_loader(loader, 8)


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from torch_em.data.datasets.medical import get_siim_acr_loader


ROOT = "/scratch/share/cidas/cca/data/siim_acr"
ROOT = "/media/anwai/ANWAI/data/siim_acr"


def check_siim_acr():
Expand All @@ -13,10 +13,10 @@ def check_siim_acr():
patch_shape=(512, 512),
batch_size=2,
download=True,
resize_inputs=True,
resize_inputs=False,
sampler=MinInstanceSampler()
)
check_loader(loader, 8, plt=True, save_path="./siim_acr.png")
check_loader(loader, 8)


if __name__ == "__main__":
Expand Down
23 changes: 0 additions & 23 deletions scripts/datasets/medical/check_acdc.py

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/datasets/medical/check_amos.py

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/datasets/medical/check_cbis_ddsm.py

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/datasets/medical/check_cholecseg8k.py

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/datasets/medical/check_covid19_seg.py

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/datasets/medical/check_dca1.py

This file was deleted.

23 changes: 0 additions & 23 deletions scripts/datasets/medical/check_duke_liver.py

This file was deleted.

20 changes: 0 additions & 20 deletions scripts/datasets/medical/check_han_seg.py

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/datasets/medical/check_isic.py

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/datasets/medical/check_m2caiseg.py

This file was deleted.

5 changes: 2 additions & 3 deletions scripts/datasets/medical/check_oimhs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@
from torch_em.data.datasets.medical import get_oimhs_loader


ROOT = "/scratch/share/cidas/cca/data/oimhs"
ROOT = "/media/anwai/ANWAI/data/oimhs"


def check_oimhs():
loader = get_oimhs_loader(
path=ROOT,
patch_shape=(512, 512),
batch_size=2,
split="test",
download=False,
resize_inputs=True,
)

check_loader(loader, 8, plt=True, save_path="./oimhs.png")
check_loader(loader, 8)


if __name__ == "__main__":
Expand Down
19 changes: 18 additions & 1 deletion scripts/datasets/medical/check_osic_pulmofib.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@ def check_osic_pulmofib():
patch_shape=(1, 512, 512),
batch_size=2,
resize_inputs=False,
download=True,
download=False,
)

check_loader(loader, 8)


def visualize_data():
import os
from glob import glob

import nrrd
import napari

all_volume_paths = sorted(glob(os.path.join(ROOT, "nrrd_heart", "*", "*")))
for vol_path in all_volume_paths:
vol, header = nrrd.read(vol_path)

v = napari.Viewer()
v.add_image(vol.transpose(2, 0, 1))
napari.run()


if __name__ == "__main__":
# visualize_data()
check_osic_pulmofib()
20 changes: 0 additions & 20 deletions scripts/datasets/medical/check_piccolo.py

This file was deleted.

4 changes: 3 additions & 1 deletion scripts/datasets/medical/check_sega.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
def check_sega():
loader = get_sega_loader(
path=ROOT,
patch_shape=(32, 512, 512),
patch_shape=(1, 512, 512),
batch_size=2,
ndim=2,
data_choice="KiTS",
resize_inputs=True,
download=True,
sampler=MinInstanceSampler(),
)
Expand Down
20 changes: 0 additions & 20 deletions scripts/datasets/medical/check_spider.py

This file was deleted.

Loading

0 comments on commit 7f2ec8e

Please sign in to comment.