Browse Source

Specify min dependency and minor cleanups.

master
Kevin Baensch 11 months ago
parent
commit
ca803a53c9
Signed by: derped GPG Key ID: C0F1D326C7626543
  1. 1
      colonycounter.py
  2. 6
      fileutils.py
  3. 2
      requirements.txt

1
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

6
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))

2
requirements.txt

@ -1,5 +1,5 @@
numpy
opencv-python == 4.3.0
pythreshold
scikit-image
scikit-image >= 0.18.1
scipy
Loading…
Cancel
Save