Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ncullen93 committed Apr 24, 2024
1 parent 2595180 commit 66a4845
Show file tree
Hide file tree
Showing 3 changed files with 1,077 additions and 13 deletions.
20 changes: 10 additions & 10 deletions nitrain/transforms/structural_transforms.py
Expand Up @@ -144,17 +144,17 @@ class Crop(BaseTransform):
Crop an image to remove all blank space around the brain or
crop based on specified indices.
"""
def __init__(self, lower_indices=None, upper_indices=None):
self.lower_indices = lower_indices
self.upper_indices = upper_indices
def __init__(self, lower=None, upper=None, leader=None):
self.lower = lower
self.upper = upper
self.leader = leader

def __call__(self, image):
if self.lower_indices and self.upper_indices:
new_image = image.crop_indices(self.lower_indices,
self.upper_indices)
else:
new_image = image.crop_image()
return new_image
def __call__(self, *images):
new_images = []
for image in images:
new_image = image.crop(self.lower, self.upper)
new_images.append(new_image)
return new_images if len(new_images) > 1 else new_images[0]


class RandomCrop(BaseTransform):
Expand Down

0 comments on commit 66a4845

Please sign in to comment.