Skip to content

Commit

Permalink
motion borders for roi processing
Browse files Browse the repository at this point in the history
  • Loading branch information
bensondaled committed May 6, 2017
1 parent 98532e7 commit b6d1c0f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pyfluo/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,4 +1434,16 @@ def process_roi(self, dist_thresh=5, **kwargs):
closeby_kw.update(distance_thresh = dist_thresh_pix)

roi_new = process_roi(roi, dff, closeby_kw=closeby_kw, **kwargs)

# remove anything outside motion borders
y0,x0 = int(np.floor(self.motion_borders.ymin)), int(np.floor(self.motion_borders.xmin))
y1,x1 = int(np.ceil(self.motion_borders.ymax)), int(np.ceil(self.motion_borders.xmax))
if roi_new.ndim == 2:
roi_new = np.array([roi_new])
roi_new = roi_new.astype(bool)
roi_new[:,:y0,:] = False
roi_new[:,y1:,:] = False
roi_new[:,:,:x0] = False
roi_new[:,:,x1:] = False

self.set_roi(roi_new)

0 comments on commit b6d1c0f

Please sign in to comment.