Unverified Commit 9aaa3f43 authored by Michael Baumgartner's avatar Michael Baumgartner Committed by GitHub
Browse files

Merge pull request #75 from MIC-DKFZ/0001_dataloader

fix index in dataloading when object is larger than patch
parents 33f9a1f4 7c170b80
...@@ -373,7 +373,7 @@ class DataLoader3DOffset(DataLoader3DFast): ...@@ -373,7 +373,7 @@ class DataLoader3DOffset(DataLoader3DFast):
elif box_size[i] >= self.patch_size_final[i]: # selected instance is larger than patch elif box_size[i] >= self.patch_size_final[i]: # selected instance is larger than patch
# we can not offset, we select our center point inside the bounding box and hope for the best # we can not offset, we select our center point inside the bounding box and hope for the best
center = np.random.randint(int(box[ib]) + 1, int(box[ib2])) center = np.random.randint(int(box[ib]) + 1, int(box[ib2]))
origins.append(center - (self.patch_size_generator[0] // 2)) origins.append(center - (self.patch_size_generator[i] // 2))
else: # create best effort offset else: # create best effort offset
patch_upper_bound = spatial_shape[i] - self.patch_size_final[i] patch_upper_bound = spatial_shape[i] - self.patch_size_final[i]
lower_bound = np.clip(box[ib] - (self.patch_size_final[i] - box_size[i]), lower_bound = np.clip(box[ib] - (self.patch_size_final[i] - box_size[i]),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment