You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have seen a couple of hangups for me to use segmentify on my 4 channeled TZXY zarr stack that I have discussed with @sofroniewn, but I wanted to put it out here as well.
add a binding for saving the output layer after segmenting, I used ipython terminal to save which is really handy, but I think it might be great to have a binding where you can go on a layer and say ctrl+s and it will save the data on the layer, maybe?
also annotations and segmentations on 4 channeled images give different featurizers different errors. One with the hpa.pth's is that channels is expected to be 1 not greater than 1 and with filter featurizer, gaussian etc filters expect a 2D image error. It would be great if segmenify takes only the array at which it is right at the instant, and not the whole array in the viewer to segment
Here is my workaround command line tool for this for now
"""segmentify zarr command line viewer.
python3.6 segmentify/segmentify_zarr.py --zarr "2019-07-10-17-12-23-06-f2va.mch8.4_fused_cropped.zarr/fused/fused/"
"""
import argparse
import dask.array as da
from scipy.ndimage import zoom
from segmentify import Viewer, gui_qt
def main(args):
"""The main Command Line Interface for Segmentify zarr"""
# parse in zarr
array = da.from_zarr(args.zarr)
# Rescale to t, z, 512, 512
assert len(array.shape) == 4
assert array.shape[2] == array.shape[3] == 2048
img = zoom(array, [1, 1, 0.25, 0.25]).astype(float)
# Click shift+n till you get the filter as the featurizer,
# more generic than using
# specific HPA Cell, nucleus etc featurizers as in README
for x in range(img.shape[0]):
for y in range(img.shape[1]):
with gui_qt():
viewer = Viewer(img[x, y, :, :].astype(float))
# TODO add a binding for saving the output layer
# Or run the below 4 lines in ipython terminal inside napari
# from skimage import imsave
# image = viewer.layers['output'].data
# path = "groundtruth_{}_{}.png".format(x, y)
# imsave(path, image)
# closing the viewer will show the next image to annotate
# TODO all multi channel images should be displayed at once and only
# one image can be annotated and segmeted at a time
if __name__ == "__main__":
# parser
parser = argparse.ArgumentParser()
parser.add_argument("--zarr", type=str, help="Zarr to view and segment.")
args = parser.parse_args()
main(args)```
The text was updated successfully, but these errors were encountered:
I have seen a couple of hangups for me to use segmentify on my 4 channeled TZXY zarr stack that I have discussed with @sofroniewn, but I wanted to put it out here as well.
add a binding for saving the output layer after segmenting, I used ipython terminal to save which is really handy, but I think it might be great to have a binding where you can go on a layer and say ctrl+s and it will save the data on the layer, maybe?
also annotations and segmentations on 4 channeled images give different featurizers different errors. One with the hpa.pth's is that channels is expected to be 1 not greater than 1 and with filter featurizer, gaussian etc filters expect a 2D image error. It would be great if segmenify takes only the array at which it is right at the instant, and not the whole array in the viewer to segment
Here is my workaround command line tool for this for now
The text was updated successfully, but these errors were encountered: