{"id":13738014,"url":"https://github.com/hanjinliu/impy","last_synced_at":"2026-01-20T19:09:31.780Z","repository":{"id":39710570,"uuid":"340083998","full_name":"hanjinliu/impy","owner":"hanjinliu","description":"Speed up coding/extending image analysis in Python.","archived":false,"fork":false,"pushed_at":"2025-09-21T03:04:18.000Z","size":33472,"stargazers_count":35,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-27T18:24:02.609Z","etag":null,"topics":["image-analysis","image-processing","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hanjinliu.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-18T14:57:47.000Z","updated_at":"2025-09-21T03:04:21.000Z","dependencies_parsed_at":"2023-10-15T23:23:22.546Z","dependency_job_id":"532f292e-c6a2-4d96-97e1-7273294284f2","html_url":"https://github.com/hanjinliu/impy","commit_stats":{"total_commits":1155,"total_committers":4,"mean_commits":288.75,"dds":0.07359307359307354,"last_synced_commit":"d5968974ea597bc1caa2354fead116bc1e470fb2"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/hanjinliu/impy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanjinliu%2Fimpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanjinliu%2Fimpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanjinliu%2Fimpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanjinliu%2Fimpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hanjinliu","download_url":"https://codeload.github.com/hanjinliu/impy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hanjinliu%2Fimpy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["image-analysis","image-processing","napari","python"],"created_at":"2024-08-03T03:02:08.924Z","updated_at":"2026-01-20T19:09:31.743Z","avatar_url":"https://github.com/hanjinliu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![BSD 3-Clause License](https://img.shields.io/pypi/l/impy-array.svg?color=green)](https://github.com/hanjinliu/impy/blob/main/LICENSE)\n[![Python package index download statistics](https://img.shields.io/pypi/dm/impy-array.svg)](https://pypistats.org/packages/impy-array)\n[![PyPI version](https://badge.fury.io/py/impy-array.svg)](https://badge.fury.io/py/impy-array)\n\n# impy\n\n`impy` is an all-in-one multi-dimensional image analysis library. The core array,\n`ImgArray`, is a subclass of `numpy.ndarray`, tagged with information such as:\n\n- image axes\n- scale of each axis\n- directory of the original image\n- and other image metadata\n\n## Documentation\n\nDocumentation is available [here](https://hanjinliu.github.io/impy/).\n\n## Installation\n\n- use pip\n\n``` sh\npip install impy-array\npip install impy-array[tiff]    # with supports for reading/writing .tif files\npip install impy-array[mrc]     # with supports for reading/writing .mrc files\npip install impy-array[napari]  # viewer support\npip install impy-array[all]     # install everything\n```\n\n- from source\n\n```\ngit clone https://github.com/hanjinliu/impy\n```\n\n### Code as fast as you speak\n\nAlmost all the functions, such as filtering, deconvolution, labeling, single molecule\ndetection, and even those pure `numpy` functions, are aware of image metadata. They\n\"know\" which dimension corresponds to `\"z\"` axis, which axes they should iterate along\nor where to save the image. As a result, **your code will be very concise**:\n\n```python\nimport impy as ip\nimport numpy as np\n\nimg = ip.imread(\"path/to/image.tif\")   # Read images with metadata.\nimg[\"z=3;t=0\"].imshow()                # Plot image slice at z=3 and t=0.\nimg[\"y=N//4:N//4*3\"].imshow()          # `N` for the size of the axis.\nimg_fil = img.gaussian_filter(sigma=2) # Paralell batch denoising. No more for loop!\nimg_prj = np.max(img_fil, axis=\"z\")    # Z-projection (numpy is aware of image axes!).\nimg_prj.imsave(\"image_max.tif\")        # Save in the same place. Don't spend time on searching for the directory!\n```\n\n### Supports many file formats\n\n`impy` automatically chooses the proper reader/writer according to the extension.\n\n- Tiff file (\".tif\", \".tiff\")\n- LSM file (\".lsm\")\n- MRC file (\".mrc\", \".rec\", \".st\", \".map\", \".map.gz\")\n- Zarr file (\".zarr\")\n- ND2 file (\".nd2\")\n- Other image file (\".png\", \".jpg\")\n\n### Lazy loading\n\nWith the `lazy` submodule, you can easily make image processing workflows for large\nimages.\n\n```python\nimport impy as ip\n\nimg = ip.lazy.imread(\"path/to/very-large-image.tif\")\nout = img.gaussian_filter()\nout.imsave(\"image_filtered.tif\")\n```\n\n### Switch between CPU and GPU\n\n`impy` can internally switches the functions between `numpy` and `cupy`.\n\n```python\nimg.gaussian_filter()  # \u003c- CPU\nwith ip.use(\"cupy\"):\n    img.gaussian_filter()  # \u003c- GPU\nip.Const[\"RESOURCE\"] = \"cupy\"  # \u003c- globally use GPU\n```\n\n### Seamless interface between `napari`\n\n[napari](https://github.com/napari/napari) is an interactive viewer for multi-dimensional\nimages. `impy` has a **simple and efficient interface** with it, via the object `ip.gui`.\nSince `ImgArray` is tagged with image metadata, you don't have to care about axes or\nscales. Just run\n\n```python\nip.gui.add(img)\n```\n\n### Extend your function for batch processing\n\nAlready have a function for `numpy` and `scipy`? Decorate it with `@ip.bind`\n\n```python\n@ip.bind\ndef imfilter(img, param=None):\n    # Your function here.\n    # Do something on a 2D or 3D image and return image, scalar or labels\n    return out\n```\n\nand it's ready for batch processing!\n\n```python\nimg.imfilter(param=1.0)\n```\n\n### Command line usage\n\n`impy` also supports command-line-based image analysis. All methods of `ImgArray` are\navailable from the command line, such as\n\n```shell\nimpy path/to/image.tif ./output.tif --method gaussian_filter --sigma 2.0\n```\n\nwhich is equivalent to\n\n```python\nimport impy as ip\nimg = ip.imread(\"path/to/image.tif\")\nout = img.gaussian_filter(sigma=2.0)\nout.imsave(\"./output.tif\")\n```\n\nFor more complex procedures, it is possible to send images directly to `IPython`\n\n```\nimpy path/to/image.tif -i\n```\n\n```python\nthr = img.gaussian_filter().threshold()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanjinliu%2Fimpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhanjinliu%2Fimpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhanjinliu%2Fimpy/lists"}