Skip to content

Commit

Permalink
Document communication functions on Solver
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Jan 8, 2016
1 parent c811df2 commit eaa8672
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions gala/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -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']
Expand Down

0 comments on commit eaa8672

Please sign in to comment.