Skip to content

Refactor gaussian filter#114

Draft
Raytesnel wants to merge 5 commits intomainfrom
refactor-gaussian-filter
Draft

Refactor gaussian filter#114
Raytesnel wants to merge 5 commits intomainfrom
refactor-gaussian-filter

Conversation

@Raytesnel
Copy link
Collaborator

@Raytesnel Raytesnel commented Jan 30, 2026

Overview

for the get_cropped_image the next function calls are needed.

  • clip_factors
  • resample_scan_image
  • apply_mask_image
  • crop_to_mask
  • level_map
  • apply_gaussian_regression_filter

This PR is converting apply_gaussian_regression_filter

Changes:

TODO:

  • add logging
  • update tests

@Raytesnel Raytesnel self-assigned this Jan 30, 2026
@Raytesnel Raytesnel added the core Part of scratch-core package label Jan 30, 2026
@Raytesnel Raytesnel force-pushed the refactor-gaussian-filter branch from 8e495d5 to b52847b Compare February 4, 2026 15:40
self.cutoff_pixels = cutoff_pixels
self.regression_order = regression_order

def calculate_polynomial_filter(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could actually remove these local functions and use the implementation in conversion instead, since you need to change the code anyway later

if y + x <= order
]

def apply_on_image(self, scan_image: ScanImage) -> ScanImage:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only implementing this function should be sufficient for this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Part of scratch-core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants