Skip to content

Commit

Permalink
including changes from main (forgot to pull)
Browse files Browse the repository at this point in the history
  • Loading branch information
elainehoml committed Dec 1, 2022
1 parent 2d951e7 commit 4d2a259
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
3 changes: 3 additions & 0 deletions src/quoll/frc/oneimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def miplib_oneimg_FRC_calibrated(
# Apply correction
if calibration_func is not None:
frc_data[0].correlation["frequency"] = calibration_func(freqs)

else:
frc_data[0].correlation["frequency"] = freqs

# Analyze results
analyzer = frc_analysis.FourierCorrelationAnalysis(
Expand Down
23 changes: 3 additions & 20 deletions tests/test_frc_oneimg.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,10 @@ def test_set_calibration_func(self):
In this test, calibration function is set to return the exact same
value, so the result should be equal to uncalibrated.
"""
Img = reader.Image("./data/042.tif")
result_calibrated = oneimg.calc_frc_res(
Image=Img,
calibration_func=lambda x: x # just return original value
)
result_uncalibrated = oneimg.calc_frc_res(
Image=Img,
calibration_func=None
Img = reader.Image(
filename="./data/042.tif",
pixel_size=3.3724
)
self.assertAlmostEqual(
result_calibrated.resolution["resolution"],
result_uncalibrated.resolution["resolution"])
self.assertIsNotNone(result_calibrated.resolution["resolution"])
self.assertIsNotNone(result_uncalibrated.resolution["resolution"])
def test_set_calibration_func(self):
"""
Tests that calibration function can be set to a custom function
In this test, calibration function is set to return the exact same
value, so the result should be equal to uncalibrated.
"""
Img = reader.Image("./data/042.tif")
result_calibrated = oneimg.calc_frc_res(
Image=Img,
calibration_func=lambda x: x # just return original value
Expand Down

0 comments on commit 4d2a259

Please sign in to comment.