-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into verify-norm
- Loading branch information
Showing
52 changed files
with
2,458 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_acdc_loader | ||
from torch_em.data import MinInstanceSampler | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/acdc" | ||
|
||
|
||
def check_acdc(): | ||
loader = get_acdc_loader( | ||
path=ROOT, | ||
patch_shape=(4, 256, 256), | ||
batch_size=2, | ||
split="train", | ||
download=True, | ||
sampler=MinInstanceSampler(min_num_instances=4), | ||
) | ||
|
||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_acdc() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data import MinInstanceSampler | ||
from torch_em.data.datasets.medical import get_amos_loader | ||
|
||
ROOT = "/media/anwai/ANWAI/data/amos" | ||
|
||
|
||
def check_amos(): | ||
loader = get_amos_loader( | ||
path=ROOT, | ||
split="train", | ||
patch_shape=(1, 512, 512), | ||
modality="mri", | ||
ndim=2, | ||
batch_size=2, | ||
download=True, | ||
sampler=MinInstanceSampler(min_num_instances=3), | ||
resize_inputs=False, | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_amos() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from torch_em.data import MinInstanceSampler | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_cbis_ddsm_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/cbis_ddsm" | ||
|
||
|
||
def check_cbis_ddsm(): | ||
loader = get_cbis_ddsm_loader( | ||
path=ROOT, | ||
patch_shape=(512, 512), | ||
batch_size=2, | ||
split="Train", | ||
task=None, | ||
tumour_type=None, | ||
resize_inputs=True, | ||
sampler=MinInstanceSampler() | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_cbis_ddsm() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_cholecseg8k_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/cholecseg8k" | ||
|
||
|
||
def get_cholecseg8k(): | ||
loader = get_cholecseg8k_loader( | ||
path=ROOT, | ||
patch_shape=(512, 512), | ||
batch_size=2, | ||
split="train", | ||
resize_inputs=True, | ||
download=False, | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
get_cholecseg8k() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data import MinInstanceSampler | ||
from torch_em.data.datasets.medical import get_covid19_seg_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/covid19_seg" | ||
|
||
|
||
def check_covid19_seg(): | ||
loader = get_covid19_seg_loader( | ||
path=ROOT, | ||
patch_shape=(32, 512, 512), | ||
batch_size=2, | ||
task="lung", | ||
download=True, | ||
sampler=MinInstanceSampler(), | ||
) | ||
|
||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_covid19_seg() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_dca1_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/dca1" | ||
|
||
|
||
def check_dca1(): | ||
loader = get_dca1_loader( | ||
path=ROOT, | ||
patch_shape=(512, 512), | ||
batch_size=2, | ||
split="test", | ||
resize_inputs=True, | ||
download=False, | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_dca1() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_duke_liver_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/duke_liver" | ||
|
||
|
||
def check_duke_liver(): | ||
from micro_sam.training import identity | ||
loader = get_duke_liver_loader( | ||
path=ROOT, | ||
patch_shape=(32, 512, 512), | ||
batch_size=2, | ||
split="train", | ||
download=False, | ||
raw_transform=identity, | ||
|
||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_duke_liver() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_han_seg_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/han-seg/" | ||
|
||
|
||
def check_han_seg(): | ||
loader = get_han_seg_loader( | ||
path=ROOT, | ||
patch_shape=(32, 512, 512), | ||
batch_size=2, | ||
download=False, | ||
) | ||
|
||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_han_seg() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_isic_loader | ||
|
||
|
||
ROOT = "/scratch/share/cidas/cca/data/isic" | ||
|
||
|
||
def check_isic(): | ||
loader = get_isic_loader( | ||
path=ROOT, | ||
patch_shape=(700, 700), | ||
batch_size=2, | ||
split="test", | ||
download=True, | ||
resize_inputs=True, | ||
) | ||
|
||
check_loader(loader, 8, plt=True, save_path="./isic.png") | ||
|
||
|
||
if __name__ == "__main__": | ||
check_isic() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_m2caiseg_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/m2caiseg" | ||
|
||
|
||
def check_m2caiseg(): | ||
loader = get_m2caiseg_loader( | ||
path=ROOT, | ||
split="train", | ||
patch_shape=(512, 512), | ||
batch_size=2, | ||
resize_inputs=True, | ||
download=True, | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_m2caiseg() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data.datasets.medical import get_piccolo_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/piccolo" | ||
|
||
|
||
def check_piccolo(): | ||
loader = get_piccolo_loader( | ||
path=ROOT, | ||
patch_shape=(512, 512), | ||
batch_size=2, | ||
split="train", | ||
resize_inputs=True, | ||
) | ||
check_loader(loader, 8) | ||
|
||
|
||
if __name__ == "__main__": | ||
check_piccolo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from torch_em.util.debug import check_loader | ||
from torch_em.data import MinInstanceSampler | ||
from torch_em.data.datasets.medical import get_spider_loader | ||
|
||
|
||
ROOT = "/media/anwai/ANWAI/data/spider" | ||
|
||
|
||
def check_spider(): | ||
loader = get_spider_loader( | ||
path=ROOT, | ||
patch_shape=(1, 512, 512), | ||
batch_size=2, | ||
sampler=MinInstanceSampler() | ||
) | ||
|
||
check_loader(loader, 8) | ||
|
||
|
||
check_spider() |
Oops, something went wrong.