{"id":17329603,"url":"https://github.com/psobolewskiphd/napari_scripts","last_synced_at":"2025-09-16T12:45:47.604Z","repository":{"id":118833049,"uuid":"402182151","full_name":"psobolewskiPhD/napari_scripts","owner":"psobolewskiPhD","description":"Collection of useful (to me) python scripts for interacting with napari","archived":false,"fork":false,"pushed_at":"2022-08-14T20:09:07.000Z","size":49,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T07:46:31.785Z","etag":null,"topics":["bioimage-analysis","napari","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/psobolewskiPhD.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-01T19:38:45.000Z","updated_at":"2025-04-25T08:32:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"66e9ad45-7108-4b9d-bd70-66c25190eb32","html_url":"https://github.com/psobolewskiPhD/napari_scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/psobolewskiPhD/napari_scripts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psobolewskiPhD%2Fnapari_scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psobolewskiPhD%2Fnapari_scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psobolewskiPhD%2Fnapari_scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psobolewskiPhD%2Fnapari_scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psobolewskiPhD","download_url":"https://codeload.github.com/psobolewskiPhD/napari_scripts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psobolewskiPhD%2Fnapari_scripts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275420209,"owners_count":25461690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bioimage-analysis","napari","python"],"created_at":"2024-10-15T14:48:48.881Z","updated_at":"2025-09-16T12:45:47.598Z","avatar_url":"https://github.com/psobolewskiPhD.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Napari scripts\n# A collection of [napari](https://napari.org) related tools in various state of disrepair/functionality.\n\n# napari_colormaps_widget.py \nThis is a script that can be run as:  \n`python napari_colormaps_widget.py`  \nIt will launch a viewer with an example single channel image and add widget that permits extended colormap/LUT features. \nThere will be 3 tabs:\n1. Allows access to inverted ChrisLUTs by @cleterrier (https://github.com/cleterrier/ChrisLUTs)\n2. Allows one to make a colormap by specifying a name, whether it should be inverted, and the end-point color.\n3. Allows for importing of ImageJ .lut files (both ascii and binary) and applying them to layers in napari.  \n\nNote: inverted LUTs are not yet supported for multichannel images in napari. Also, when you apply a colormap to an image, it will persist in the napari colormaps menu for the duration of the viewer (even with the widget closed).\n\n# napari_line_profile_widget.py\nThis is a module that can be imported, for example:\n```\nimport napari_line_profile_widget as linepro\n```\nand then permits:\n```\nline_plot = linepro.profile_line(\u003cinsert name of napari viewer\u003e) \n```\nThis will add a shape layer with a red line and widget at the bottom of the Napari window. \nThe widget will display a plot of the pixel instensities along the red line, as you move the red line or change z- or t-stack slice.\nThe top most image layer will be used for the intensity data and the x-axis of the plot should be consistent with any scale data provided to napari. If you close and open a new image, move the line/change slice to update.\nYou can also get a nice figure (6\"x3\", 300 dpi) of the current viewer status and the line profile:\n```\nlinepro.get_figure(line_plot, \u003cinsert name of napari viewer\u003e)\n```\nIf you don't want the viewer status and just want the plot, pass `screenshot=False`\nThe figure can be saved, for example as PDF:\n```\nlinepro.get_figure(line_plot, \u003cinsert name of napari viewer\u003e, name=\"test_profile.pdf\")\n```\n\n# napari_measure_widget.py\nThis is a module that can be imported, for example:\n```\nimport napari_measure_widget as nmw\n```\nand then permits:\n```\nnmw.measure_shape(\u003cinsert name of napari viewer\u003e)\n```\nThis will add a shape layer to the napari window and create a widget to display a table of results. By default, the key `m` will be bound to measuring:\n- length of lines drawn with `line` or `path` tools\n- angle between `path` segments, for the case of a `path` of two segments (3 points)\n- area of shapes drawn with `rectangle`, `polygon`, or `ellipse` tools\nThe last drawn shape will be measured, unless a shape is selected.\nThe keybind can be changed, by passing a different keybind as a string. For example, to set the keybind to `z`:\n```\nnm.measure_shape(\u003cinsert name of napari viewer\u003e, keybind=\"z\")\n```\nBy default, existing keybinds will *not* be overwritten. To overwrite an existing keybind (for example, if re-opening the widget), you must pass `overwrite=True`.\nThe measurements will be displayed in a table in the widget. \nMake sure there is an open, visible image layer, so that the measurements can take into account any scale and unit information.\n\n# Browse_LIF_widget.py\n## *This functionality is now part of the [napari-aicsimageio plugin](https://github.com/AllenCellModeling/napari-aicsimageio), which supports other file types, as well. Please test it! Note: empty/singleton dimensions may be handled differently, so leave feedback.*\n\nThis module can be imported, for example:\n```\nimport napari_scripts.Browse_LIF_widget as BL\n```\nit then can be used to open Napari with a LIF browser widget:\n```\nviewer = BL.lif_widget()\n```\nThis Napari viewer will have a empty widget on the right, where you can drag-and-drop a LIF. **Make sure you drop it on the side panel, not the main/middle Napari canvas** Using `aicsimageio`, the widget will import the LIF and prepare a list of scenes. Clicking on a scene should load the chosen scene as an image layer. Note: the Image will have all `MTCZYX` channels, to permit browsing all types of scenes. The returned `viewer` can be used for other manipulations, such listing the selected scenes: `viewer.layers`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsobolewskiphd%2Fnapari_scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsobolewskiphd%2Fnapari_scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsobolewskiphd%2Fnapari_scripts/lists"}