Skip to content

Commit

Permalink
Linelevel: fix difference option
Browse files Browse the repository at this point in the history
pySNOM returns a smaller image in this case, thus there were problems.
  • Loading branch information
markotoplak committed Oct 4, 2024
1 parent cd7a2df commit 3b5f229
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions orangecontrib/snom/widgets/preprocessors/linelevel.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import numpy as np
from AnyQt.QtWidgets import QFormLayout

from orangewidget.gui import comboBox
Expand All @@ -18,9 +19,13 @@ def __init__(self, method="median"):

def transform_image(self, image, data):
datatype = data.attributes.get("measurement.signaltype", "Phase")
return LineLevel(method=self.method, datatype=DataTypes[datatype]).transform(
image
)
processed = LineLevel(
method=self.method, datatype=DataTypes[datatype]
).transform(image)
if self.method == 'difference':
# add a row of NaN, so that the size matches
processed = np.vstack((processed, np.full((1, image.shape[1]), np.nan)))
return processed


class LineLevelEditor(BaseEditorOrange):
Expand Down

0 comments on commit 3b5f229

Please sign in to comment.