Skip to content

Commit cb74925

Browse files
committed
Replace denoising-related terms with 'computational clearing' to more accurately indicate what has happened with the dataset
1 parent ff831e5 commit cb74925

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/murfey/workflows/clem/register_preprocessing_results.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"gray", "red", "green", "blue", "cyan", "magenta", "yellow"
3434
]
3535

36-
DENOISING_MODES = ("_ICC", "_Lng_LVCC", "_Lng_SVCC")
36+
CC_MODES = ("_ICC", "_Lng_LVCC", "_Lng_SVCC")
3737

3838

3939
class CLEMPreprocessingResult(BaseModel):
@@ -57,22 +57,22 @@ class CLEMPreprocessingResult(BaseModel):
5757
# Valid Pydantic decorator not supported by MyPy
5858
@computed_field # type: ignore
5959
@cached_property
60-
def is_denoised(self) -> bool:
60+
def is_cc(self) -> bool:
6161
"""
6262
The "_ICC", "_Lng_LVCC", and "_Lng_SVCC" suffixes appended to a CLEM dataset's
63-
position name indicate that it's a denoised image set of the same position.
64-
They should override or supersede the original ones if they're present.
63+
position name indicate that it's a computationally cleared image set of the
64+
same position. They should override or supersede the original ones if present.
6565
"""
66-
return any(self.series_name.endswith(pattern) for pattern in DENOISING_MODES)
66+
return any(self.series_name.endswith(pattern) for pattern in CC_MODES)
6767

68-
# Vallid Pydantic decorator not supported by MyPy
68+
# Valid Pydantic decorator not supported by MyPy
6969
@computed_field # type: ignore
7070
@cached_property
71-
def denoising_mode(self) -> str | None:
71+
def cc_mode(self) -> str | None:
7272
"""
73-
Store the denoising mode used as an attribute
73+
Store the computational clearing mode used as an attribute
7474
"""
75-
for pattern in DENOISING_MODES:
75+
for pattern in CC_MODES:
7676
if self.series_name.endswith(pattern):
7777
return pattern[1:]
7878
return None
@@ -82,11 +82,11 @@ def denoising_mode(self) -> str | None:
8282
@cached_property
8383
def site_name(self) -> str:
8484
"""
85-
Extract just the name of the site by removing the denoising mode suffix from
85+
Extract just the name of the site by removing the clearing mode suffix from
8686
the series name.
8787
"""
88-
if self.denoising_mode is not None:
89-
return self.series_name[: -(len(self.denoising_mode) + 1)]
88+
if self.cc_mode is not None:
89+
return self.series_name[: -(len(self.cc_mode) + 1)]
9090
return self.series_name
9191

9292
# Valid Pydantic decorator not supported by MyPy
@@ -135,7 +135,7 @@ def _register_clem_imaging_site(
135135
"""
136136
Creates an ImagingSite database entry for the current CLEM preprocessing result
137137
if one doesn't already exist, or modifies the existing one if it does. Each entry
138-
corresponds to a unique site on the sample grid, and results containing denoised
138+
corresponds to a unique site on the sample grid, and results containing cleared
139139
data will supersede existing rows for the same position that contain only raw
140140
data. Returns the created/queried entry.
141141
"""
@@ -198,8 +198,8 @@ def _populate(
198198
)
199199
clem_img_site = _populate(clem_img_site, result)
200200

201-
# Prepare to overwrite existing entry if current result is a denoised dataset
202-
if result.is_denoised:
201+
# Prepare to overwrite existing entry if current result is a cleared dataset
202+
if result.is_cc:
203203
# Proceed with overwrite if current result is different from existing entry
204204
output_file = list(result.output_files.values())[0]
205205
if str(output_file.parent / "*.tiff") != clem_img_site.image_path:

0 commit comments

Comments
 (0)