Skip to content

Commit

Permalink
Merge pull request #430 from psavery/gauss-laplace-filter
Browse files Browse the repository at this point in the history
Add a gaussian laplace op to ProcessedImageSeries
  • Loading branch information
joelvbernier authored Apr 22, 2022
2 parents 18ebb7a + fdb4a83 commit cc2cae4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hexrd/imageseries/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy

import numpy as np
import scipy

from .baseclass import ImageSeries

Expand All @@ -12,6 +13,7 @@ class ProcessedImageSeries(ImageSeries):
DARK = 'dark'
RECT = 'rectangle'
ADD = 'add'
GAUSS_LAPLACE = 'gauss_laplace'

def __init__(self, imser, oplist, **kwargs):
"""imsageseries based on existing one with image processing options
Expand All @@ -36,6 +38,7 @@ def __init__(self, imser, oplist, **kwargs):
self.addop(self.FLIP, self._flip)
self.addop(self.RECT, self._rectangle)
self.addop(self.ADD, self._add)
self.addop(self.GAUSS_LAPLACE, self._gauss_laplace)

def __getitem__(self, key):
return self._process_frame(self._get_index(key))
Expand Down Expand Up @@ -103,6 +106,9 @@ def _add(self, img, addend):
img = img.astype(np.float32)
return img + addend

def _gauss_laplace(self, img, sigma):
return scipy.ndimage.gaussian_laplace(img, sigma)

#
# ==================== API
#
Expand Down

0 comments on commit cc2cae4

Please sign in to comment.