Title: Segmentify on stacks with 4 channels · Issue #24 · transformify-plugins/segmentify · GitHub
Open Graph Title: Segmentify on stacks with 4 channels · Issue #24 · transformify-plugins/segmentify
X Title: Segmentify on stacks with 4 channels · Issue #24 · transformify-plugins/segmentify
Description: 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 use...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/transformify-plugins/segmentify/issues/24
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Segmentify on stacks with 4 channels","articleBody":"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.\r\n\r\n1. 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?\r\n\r\n2. 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\r\n\r\n\r\nHere is my workaround command line tool for this for now\r\n\r\n```\r\n\"\"\"segmentify zarr command line viewer.\r\npython3.6 segmentify/segmentify_zarr.py --zarr \"2019-07-10-17-12-23-06-f2va.mch8.4_fused_cropped.zarr/fused/fused/\"\r\n\"\"\"\r\n\r\nimport argparse\r\nimport dask.array as da\r\nfrom scipy.ndimage import zoom\r\nfrom segmentify import Viewer, gui_qt\r\n\r\n\r\ndef main(args):\r\n \"\"\"The main Command Line Interface for Segmentify zarr\"\"\"\r\n\r\n # parse in zarr\r\n array = da.from_zarr(args.zarr)\r\n\r\n # Rescale to t, z, 512, 512\r\n assert len(array.shape) == 4\r\n assert array.shape[2] == array.shape[3] == 2048\r\n img = zoom(array, [1, 1, 0.25, 0.25]).astype(float)\r\n\r\n # Click shift+n till you get the filter as the featurizer,\r\n # more generic than using\r\n # specific HPA Cell, nucleus etc featurizers as in README\r\n for x in range(img.shape[0]):\r\n for y in range(img.shape[1]):\r\n with gui_qt():\r\n viewer = Viewer(img[x, y, :, :].astype(float))\r\n\r\n # TODO add a binding for saving the output layer\r\n\r\n # Or run the below 4 lines in ipython terminal inside napari\r\n # from skimage import imsave\r\n # image = viewer.layers['output'].data\r\n # path = \"groundtruth_{}_{}.png\".format(x, y)\r\n # imsave(path, image)\r\n\r\n # closing the viewer will show the next image to annotate\r\n # TODO all multi channel images should be displayed at once and only\r\n # one image can be annotated and segmeted at a time\r\n\r\n\r\nif __name__ == \"__main__\":\r\n # parser\r\n parser = argparse.ArgumentParser()\r\n parser.add_argument(\"--zarr\", type=str, help=\"Zarr to view and segment.\")\r\n args = parser.parse_args()\r\n\r\n main(args)```\r\n","author":{"url":"https://github.com/pranathivemuri","@type":"Person","name":"pranathivemuri"},"datePublished":"2019-10-04T21:51:42.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/24/segmentify/issues/24"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c9b6bb1a-a2f1-b205-3ac1-2602ca97a018 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8C54:10C367:1DCC2:27955:698E4DD1 |
| html-safe-nonce | e4120a95ce99fb3b48a4b1b908e6b4bc1b87d0df13d19ce87a4b6973d9c3607a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QzU0OjEwQzM2NzoxRENDMjoyNzk1NTo2OThFNEREMSIsInZpc2l0b3JfaWQiOiIyNDY1MTcxMjE4MDM2MDUxNDA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 163843d6be6bb946f64d62a449f8830d6c279077b8911165361e67fd81b22bf9 |
| hovercard-subject-tag | issue:502859411 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/transformify-plugins/segmentify/24/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b4eafd192e97064582a7cde6d4ab7cd9231a70f425dddad55dc2bf65795930ad/transformify-plugins/segmentify/issues/24 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b4eafd192e97064582a7cde6d4ab7cd9231a70f425dddad55dc2bf65795930ad/transformify-plugins/segmentify/issues/24 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pranathivemuri |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0e08b85f0035d49bc4c22868f70a4d30fb8c2a777936895c37e78df095242ddc |
| turbo-cache-control | no-preview |
| go-import | github.com/transformify-plugins/segmentify git https://github.com/transformify-plugins/segmentify.git |
| octolytics-dimension-user_id | 51755733 |
| octolytics-dimension-user_login | transformify-plugins |
| octolytics-dimension-repository_id | 189932552 |
| octolytics-dimension-repository_nwo | transformify-plugins/segmentify |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 189932552 |
| octolytics-dimension-repository_network_root_nwo | transformify-plugins/segmentify |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ab1cf30f0feb8db377fc0d52bc41f0105f9b4181 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width