Skip to content

Commit

Permalink
Merge pull request #241 from slaclab/bugfix-image-processor
Browse files Browse the repository at this point in the history
Bugfix image processor
  • Loading branch information
roussel-ryan authored Feb 22, 2025
2 parents 438113a + 3ced002 commit efa644f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lcls_tools/common/frontend/plotting/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def plot_image_projection_fit(result: ImageProjectionFitResult):
fig.set_size_inches(4, 9)

image = result.image
ax[0].imshow(image)
c = ax[0].imshow(image)
fig.colorbar(c, ax=ax[0])

projections = {
"x": np.array(np.sum(image, axis=0)),
Expand Down
6 changes: 3 additions & 3 deletions lcls_tools/common/image/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
from scipy.ndimage import gaussian_filter, median_filter
from pydantic import PositiveFloat, ConfigDict
from pydantic import PositiveFloat, ConfigDict, PositiveInt
from lcls_tools.common.image.roi import ROI
import lcls_tools

Expand All @@ -30,8 +30,8 @@ class ImageProcessor(lcls_tools.common.BaseModel):
roi: Optional[ROI] = None
background_image: Optional[np.ndarray] = None
threshold: Optional[PositiveFloat] = 0.0
gaussian_filter_size: Optional[PositiveFloat] = None
median_filter_size: Optional[PositiveFloat] = None
gaussian_filter_size: Optional[PositiveInt] = None
median_filter_size: Optional[PositiveInt] = None

def subtract_background(self, raw_image: np.ndarray) -> np.ndarray:
"""Subtract background pixel intensity from a raw image"""
Expand Down

0 comments on commit efa644f

Please sign in to comment.