Skip to content

Commit

Permalink
Add flag for antialiasing filter
Browse files Browse the repository at this point in the history
  • Loading branch information
fepegar committed Oct 11, 2018
1 parent f64427a commit 3b91e25
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions niftynet/layer/rand_spatial_scaling.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_sigma(self, zoom):
sigma = np.sqrt(variance)
return sigma

def _apply_transformation(self, image, interp_order=3):
def _apply_transformation(self, image, interp_order=3, antialiasing=True):
if interp_order < 0:
return image
assert self._rand_zoom is not None
Expand All @@ -59,7 +59,7 @@ def _apply_transformation(self, image, interp_order=3):
if image.ndim == 4:
output = []
for mod in range(image.shape[-1]):
if smooth:
if smooth and antialiasing:
original_resolution = ndi.gaussian_filter(
image[..., mod], sigma)
else:
Expand All @@ -69,7 +69,7 @@ def _apply_transformation(self, image, interp_order=3):
output.append(scaled[..., np.newaxis])
return np.concatenate(output, axis=-1)
elif image.ndim == 3:
if smooth:
if smooth and antialiasing:
original_resolution = ndi.gaussian_filter(
image, sigma)
else:
Expand Down

0 comments on commit 3b91e25

Please sign in to comment.