def _on_pos_changed(self, current, previous): w = str(self.pos_table.item(current.row(), 1).text()) p = str(self.pos_table.item(current.row(), 2).text()) coord = cellh5.CH5PositionCoordinate(self.ch5file.plate, w, p) pos = self.ch5file.get_position_from_coord(coord) self.cur_pos = pos self.cur_w = w self.cur_p = p self.cur_coord = coord self.update_event_table(coord)
def _to_ch5_coord(self, plate, well, site): return cellh5.CH5PositionCoordinate(plate, well, site)
if isStatic: timePoints = None else: timePoints = analyse_each_cell(pool, minSegLen, elongationRegions, cellRois, mitosisDir) if ch5: description = ("cell", "cell_shape_features") with cellh5write.CH5FileWriter(mitosisDir + "mitosisAnalysis.ch5") as cfw: for cellNb in [k.split("_")[0] for k in elongationRegions.keys()]: cdata = list() for c in chs: cdata.append(tifffile.imread(fluoDir + cropImgs + str(cellNb) + "_" + c + ".tif")) cdata = np.array(cdata) while len(cdata.shape) < 5: cdata = np.expand_dims(cdata, axis=0) shape = cdata.shape cpw = cfw.add_position(cellh5.CH5PositionCoordinate(pos, date, cellNb)) crw = cpw.add_label_image(shape=shape, dtype=np.int16) for c in range(shape[0]): for t in range(shape[1]): for z in range(shape[2]): crw.write(cdata[c,t,z,:,:], c=c, t=t, z=z) crw.finalize() regObjs = list() cow_cell = cpw.add_region_object('cell') for t in range(shape[2]): cow_cell.write(t=t, object_labels=np.array([cellNb])) cow_cell.finalize() regObjs.append(cow_cell)