Skip to content

Commit

Permalink
Ensure rater id per ann
Browse files Browse the repository at this point in the history
  • Loading branch information
anwai98 committed Jan 8, 2025
1 parent 8c48bbc commit 1858afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch_em/data/datasets/medical/kits.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _preprocess_inputs(path):
for p in glob(os.path.join(patient_dir, "instances", f"tumor_instance*-{rater}.nii.gz")):
masks[nib.load(p).get_fdata() > 0] = 1

f.create_dataset(f"labels/tumor/rater_{rater_id}", data=masks, compression="gzip")
f.create_dataset(f"labels/tumor/rater_{rater}", data=masks, compression="gzip")

# Add annotations for cysts per rater.
if len(cyst_anns) > 0:
Expand All @@ -133,7 +133,7 @@ def _preprocess_inputs(path):
for p in glob(os.path.join(patient_dir, "instances", f"cyst_instance*-{rater}.nii.gz")):
masks[nib.load(p).get_fdata() > 0] = 1

f.create_dataset(f"labels/cyst/rater_{rater_id}", data=masks, compression="gzip")
f.create_dataset(f"labels/cyst/rater_{rater}", data=masks, compression="gzip")


def get_kits_paths(path: Union[os.PathLike, str], download: bool = False) -> List[str]:
Expand Down

0 comments on commit 1858afe

Please sign in to comment.