Skip to content

Commit 35a0536

Browse files
author
Lukas Schrangl
committed
Analyzer: Further adapt to changes in Tracker and sdt-python
1 parent a66b93a commit 35a0536

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

smfret_analysis/analyzer.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,6 @@ def filter_bleach_step(self, donor_thresh: float, acceptor_thresh: float):
351351
fret.SmFretAnalyzer.bleach_step
352352
"""
353353
for k, v in self.sources.items():
354-
if v["special"].startswith("d") or v["special"].startswith("a"):
355-
# Don't filter donor-only and acceptor-only samples
356-
continue
357354
a = self.analyzers[k]
358355
a.bleach_step(donor_thresh, acceptor_thresh, truncate=False)
359356

@@ -786,12 +783,13 @@ def find_cell_mask_params(self) -> nbui.Thresholder:
786783
if self._thresholder is None:
787784
self._thresholder = nbui.Thresholder()
788785

789-
self._thresholder.images = collections.OrderedDict(
786+
self._thresholder.image_selector.images = collections.OrderedDict(
790787
[(k, v[0]) for k, v in self.cell_images.items()])
791788

792789
return self._thresholder
793790

794-
def apply_cell_masks(self, thresh_algorithm: str = "adaptive", **kwargs):
791+
def apply_cell_masks(self, keys: Sequence[str],
792+
thresh_algorithm: str = "adaptive", **kwargs):
795793
"""Remove datapoints from non-cell-occupied regions
796794
797795
Threshold cell images according to the parameters and use the resulting
@@ -800,6 +798,8 @@ def apply_cell_masks(self, thresh_algorithm: str = "adaptive", **kwargs):
800798
801799
Parameters
802800
----------
801+
keys
802+
Which datasets to apply cell masks to.
803803
thresh_algorithm
804804
Use the ``thresh_algorithm + "_thresh"`` function from
805805
:py:mod:`sdt.image` for thresholding.
@@ -809,10 +809,7 @@ def apply_cell_masks(self, thresh_algorithm: str = "adaptive", **kwargs):
809809
if isinstance(thresh_algorithm, str):
810810
thresh_algorithm = getattr(image, thresh_algorithm + "_thresh")
811811

812-
for k, v in self.sources.items():
813-
if not v["special"].startswith("c"):
814-
continue
815-
812+
for k in keys:
816813
ana = self.analyzers[k]
817814
files = np.unique(ana.tracks.index.levels[0])
818815

0 commit comments

Comments
 (0)