Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
70403da
ruff
laurensWe Jan 7, 2026
bd2506c
rename more inline with original matlab function
laurensWe Jan 7, 2026
3a11853
make gaussian constant more precise
laurensWe Jan 7, 2026
4f4d775
replace (data)classes by returning tuple
laurensWe Jan 8, 2026
3ca3ea0
Extra docstrings
laurensWe Jan 8, 2026
5c07a78
merge conflicts?
laurensWe Jan 8, 2026
15affb7
Merge branch 'main' into feature/step2_preprocessbulletdata.m
laurensWe Jan 8, 2026
6994fda
remove 2D enforcing
laurensWe Jan 8, 2026
124bade
ruff
laurensWe Jan 8, 2026
4c5afe7
big cleanup of functions
laurensWe Jan 9, 2026
88652b9
ruff
vergep Jan 9, 2026
3fa9a18
wip final code check. Ttests and def apply_gaussian_filter_1d needs t…
vergep Jan 9, 2026
e82e313
fix unit tests
laurensWe Jan 12, 2026
9c19c57
First try at translation of step 3 of preprocessdata.m
laurensWe Jan 12, 2026
c7ea20a
clean-up
laurensWe Jan 12, 2026
64533ac
Bring back the fine_align to the preprocessdata function
laurensWe Jan 12, 2026
c2b9d9c
stage3 first attempt + end-to-end test stage 2 and 3
vergep Jan 12, 2026
fc43815
first round of feedback Simone
laurensWe Jan 12, 2026
75b2878
more feedback Simone
laurensWe Jan 12, 2026
9c494fc
Rename folder + Fix unit test to actually use the python code
laurensWe Jan 13, 2026
9cb4ede
Add noise_shape removal check
laurensWe Jan 13, 2026
e786c71
Now identical implementation
laurensWe Jan 13, 2026
e37abfd
Merge branch 'main' into feature/step_3
laurensWe Jan 14, 2026
30753ee
fix pyright errors
laurensWe Jan 14, 2026
20f518c
Implement feedback cfs-data
laurensWe Jan 14, 2026
6afafcc
Implemented some feedback of cfs-data
laurensWe Jan 14, 2026
5d460c2
pyright issues
laurensWe Jan 14, 2026
3a54254
Integrate MarkType of existing code
laurensWe Jan 15, 2026
671b588
refactor to use resample.py for resampling
laurensWe Jan 15, 2026
0b98d88
Remove range_indices parameter
laurensWe Jan 15, 2026
f6947a0
feedback simone
laurensWe Jan 15, 2026
26f874d
remove fluff and matlab mentions
laurensWe Jan 15, 2026
b73f370
Use scan_image.model_copy instead of making a new scanimage
laurensWe Jan 15, 2026
0fda5d5
set the mask rotated to be stricter
laurensWe Jan 15, 2026
03efbb3
resample instead of slicing
laurensWe Jan 15, 2026
d7ab104
Correct scale after rotation
laurensWe Jan 15, 2026
af9c266
sonarcube fixes
laurensWe Jan 15, 2026
be85daf
Merge branch 'main' into feature/step_3
laurensWe Jan 15, 2026
909769e
fix tests after merge
laurensWe Jan 15, 2026
007c1c2
feedback Simone for using a parameter dataclass
laurensWe Jan 15, 2026
0aacd22
Temp commit for unifying the filter.py
laurensWe Jan 15, 2026
e884b08
With padding
laurensWe Jan 16, 2026
15231ad
tests work
vergep Jan 16, 2026
8a675c5
cleaned up code
vergep Jan 16, 2026
ed56f4f
nan-testen voor striation falen
vergep Jan 16, 2026
0565470
nan an non-nan matlab striation tests fale
vergep Jan 16, 2026
f34bb20
revert conftest
laurensWe Jan 19, 2026
c238053
Change the kernel size depending on whether data contains nans or not…
laurensWe Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
465 changes: 403 additions & 62 deletions packages/scratch-core/src/conversion/filter.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/scratch-core/src/conversion/mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _determine_bounding_box(mask: MaskArray) -> tuple[slice, slice]:

y_min, x_min = np.min(non_zero_coords, axis=1)
y_max, x_max = np.max(non_zero_coords, axis=1)
return slice(x_min, x_max + 1), slice(y_min, y_max + 1)
return slice(y_min, y_max + 1), slice(x_min, x_max + 1)


def mask_and_crop_2d_array(
Expand Down
104 changes: 0 additions & 104 deletions packages/scratch-core/src/conversion/preprocess_impression/filter.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from container_models.base import ScanMap2DArray
from container_models.scan_image import ScanImage
from conversion.data_formats import Mark
from conversion.leveling import SurfaceTerms, level_map
from conversion.mask import crop_to_mask
from conversion.preprocess_impression.center import compute_center_local
from conversion.preprocess_impression.filter import (
from conversion.filter import (
apply_gaussian_filter_to_mark,
apply_filtering_pipeline,
)
from conversion.leveling import SurfaceTerms, level_map
from conversion.mask import crop_to_mask
from conversion.preprocess_impression.center import compute_center_local
from conversion.preprocess_impression.parameters import PreprocessingImpressionParams
from conversion.preprocess_impression.resample import (
resample,
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from dataclasses import dataclass


@dataclass
class PreprocessingStriationParams:
"""Processing parameters for striation preprocessing.

:param cutoff_hi: Cutoff wavelength for shape removal in meters (highpass filter).
:param cutoff_lo: Cutoff wavelength for noise removal in meters (lowpass filter).
:param cut_borders_after_smoothing: If True, crop filter edge artifacts.
:param use_mean: If True, use mean for profile extraction; if False, use median.
:param angle_accuracy: Target angle accuracy in degrees for fine alignment.
:param max_iter: Maximum iterations for fine alignment.
:param extra_sub_samp: Additional subsampling factor for gradient detection.
:param shape_noise_removal: If True, apply shape and noise removal filters.
"""

cutoff_hi: float = 2000e-6
cutoff_lo: float = 250e-6
cut_borders_after_smoothing: bool = True
use_mean: bool = True
angle_accuracy: float = 0.1
max_iter: int = 25
extra_sub_samp: int = 1
shape_noise_removal: bool = True
Loading
Loading