From eaa86724b87703bf7c888d458ed47b249e489337 Mon Sep 17 00:00:00 2001 From: Juan Nunez-Iglesias Date: Fri, 8 Jan 2016 12:02:06 +1100 Subject: [PATCH] Document communication functions on Solver --- gala/serve.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gala/serve.py b/gala/serve.py index ca6a80a..499612f 100644 --- a/gala/serve.py +++ b/gala/serve.py @@ -45,6 +45,15 @@ def _build_rag(self): self.original_rag = self.rag.copy() def send_segmentation(self): + """Send a segmentation to ZMQ as a fragment-to-segment lookup table. + + The format of the lookup table (LUT) is specified in the BigCat + wiki [1]_. + + References + ---------- + .. [1] https://github.com/saalfeldlab/bigcat/wiki/Actors,-responsibilities,-and-inter-process-communication + """ self.relearn() # correct way to do it is to implement RAG splits self.rag.agglomerate(0.5) dst = [int(i) for i in self.rag.tree.get_map(0.5)] @@ -54,6 +63,15 @@ def send_segmentation(self): self.comm.send_json(message) def listen(self): + """Listen to ZMQ port for instructions and data. + + The instructions conform to the proofreading protocol defined in the + BigCat wiki [1]_. + + References + ---------- + .. [1] https://github.com/saalfeldlab/bigcat/wiki/Actors,-responsibilities,-and-inter-process-communication + """ while True: message = self.comm.recv_json() command = message['type']