Beispiel #1
0
 def map(self, ctx):
     p = BioImgPlane(ctx.value)
     pixels = p.get_xy()
     plane_tag = '%s-z%04d-c%04d-t%04d' % (p.name, p.z, p.c, p.t)
     out_rec = to_avro(calc_features(pixels, plane_tag))
     out_rec['plane_tag'] = plane_tag
     ctx.emit(None, out_rec)
 def map(self, ctx):
     p = BioImgPlane(ctx.value)
     pixels = p.get_xy()
     bn = '%s-z%04d-c%04d-t%04d.npy' % (p.name, p.z, p.c, p.t)
     fn = hdfs.path.join(self.out_dir, p.name, bn)
     with hdfs.open(fn, 'w') as fo:
         np.save(fo, pixels)
     ctx.emit(fn, '%s\t%s' % (p.dimension_order, pixels.shape))