From ca803a53c90843ec69da94b2e7ab89ed88cc0312 Mon Sep 17 00:00:00 2001 From: derped Date: Wed, 10 Mar 2021 22:19:06 +0100 Subject: [PATCH] Specify min dependency and minor cleanups. --- colonycounter.py | 1 - fileutils.py | 6 +----- requirements.txt | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/colonycounter.py b/colonycounter.py index 6303ca1..c9e5380 100644 --- a/colonycounter.py +++ b/colonycounter.py @@ -122,7 +122,6 @@ def main(): [f.opqueue.__init__([normalize, to8bit, rollingball, wat]) for f in files] [f.apply(dslice(f.opqueue,None,-1)) for f in files] - # [(f.apply(f.opqueue), f.save(True, f.opqueue)) for f in files] window.init(files) window.reset() return True diff --git a/fileutils.py b/fileutils.py index c88afad..e76aff3 100644 --- a/fileutils.py +++ b/fileutils.py @@ -53,7 +53,7 @@ class FILE: self.meta = pd.DataFrame(None if self.data[1]["data"][1:] == [] else self.data[1]["data"][1:], columns=self.data[1]["data"][0]) self.meta.insert(loc=0, column="Label", value="".join([self.fname, self.fext])) spath = self.path.split(path.sep) - if len(spath) > 2 and spath[-1] in ["BFP", "YFP"] and spath[-2][:-1].isdigit(): + if len(spath) > 2 and spath[-2][:-1].isdigit(): hour, culture = self.path.split(path.sep)[-2:] hour = int(hour[:-1]) else: @@ -82,11 +82,7 @@ class FILE: if self.outlines is not None: imwrite(path.join(DIROUT, self.path, f"{self.fname}.outlines.jpg"), self.outlines) if self.meta is not None: - print(path.join(DIROUT, self.path, f"{self.fname}.csv")) self.meta.to_csv(path.join(DIROUT, self.path, f"{self.fname}.csv"), index=False) - # [l.insert(1, self.getName(False, {})) for l in self.meta["data"][1:]] - # with open(path.join(DIROUT, self.path, f"{self.fname}.csv"), "w") as f: - # [f.write(",".join([str(e) for e in l]) + "\n") for l in self.meta["data"]] else: if not path.exists(path.join(DIRCACHE, self.path)): makedirs(path.join(DIRCACHE, self.path)) diff --git a/requirements.txt b/requirements.txt index fc993df..f496273 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ numpy opencv-python == 4.3.0 pythreshold -scikit-image +scikit-image >= 0.18.1 scipy