{"id":28568154,"url":"https://github.com/arquolo/bipl","last_synced_at":"2025-06-10T16:03:30.516Z","repository":{"id":161565604,"uuid":"606889900","full_name":"arquolo/bipl","owner":"arquolo","description":"Big Image Python Library","archived":false,"fork":false,"pushed_at":"2025-06-08T13:38:11.000Z","size":363,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-08T14:29:12.869Z","etag":null,"topics":["computer-vision","image-processing","openslide","python","tiff"],"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/arquolo.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":"2023-02-26T21:11:49.000Z","updated_at":"2025-06-08T13:38:16.000Z","dependencies_parsed_at":"2025-06-08T14:25:02.039Z","dependency_job_id":"ca108128-f6d0-409b-bcfc-04da39350f4b","html_url":"https://github.com/arquolo/bipl","commit_stats":{"total_commits":84,"total_committers":1,"mean_commits":84.0,"dds":0.0,"last_synced_commit":"619f8ac26004f9e21c787a695ff65d9c6f6a1364"},"previous_names":[],"tags_count":38,"template":false,"template_full_name":"arquolo/glow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arquolo%2Fbipl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arquolo%2Fbipl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arquolo%2Fbipl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arquolo%2Fbipl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arquolo","download_url":"https://codeload.github.com/arquolo/bipl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arquolo%2Fbipl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258828305,"owners_count":22763943,"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","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":["computer-vision","image-processing","openslide","python","tiff"],"created_at":"2025-06-10T16:01:18.156Z","updated_at":"2025-06-10T16:03:30.498Z","avatar_url":"https://github.com/arquolo.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BIPL is a Big Image Python Library\n\nLibrary to read big pyramidal images like in formats like BigTiff, Aperio SVS, Leica MRXS.\n\n## `bipl.Slide` - ndarray-like reader for multiscale images (svs, tiff, etc...)\n\u003cdetails\u003e\n\n```python\nimport numpy as np\nfrom bipl import Slide\n\nslide = Slide.open('test.svs')\nshape: tuple[int, ...] = slide.shape  # Native shape\ndownsamples: tuple[int, ...] = slide.downsamples  # List of pre-existing sub-resolution levels\n\n# Get native miniature\ntmb: np.ndarray = slide.thumbnail()\n\nmpp: float = slide.mpp  # X um per pixel, native resolution\nimage: np.ndarray = slide[:2048, :2048]  # Get numpy.ndarray of 2048x2048 from full resolution\n\nMPP = 16.  # Let's say we want slide at 16 um/px resolution\ndownsample = MPP / slide.mpp\nmini = slide.pool(downsample)  # Gives `downsample`-times smaller image\nmini = slide.resample(MPP)  # Gives the same result\n\n# Those ones trigger ndarray conversion\nimage: np.ndarray\nimage = mini[:512, :512]  # Take a part of\nimage = mini.numpy()  # Take a whole resolution level\nimage = np.array(mini, copy=False)  # Use __array__ API\n```\n\u003c/details\u003e\n\n## `bipl.Mosaic` - apply function for each tile of big image on desired scale.\n\u003cdetails\u003e\n\n```python\nimport numpy as np\nfrom bipl import Mosaic, Slide\n\nm = Mosaic(step=512, overlap=0)  # Read at [0:512], [512:1024], ...\n\n# Open slide at 1:1 scale\ns = Slide.open('test.svs')\n\n# Target at 4 um/px resolution\n# If `test.svs` has some pyramid in it (i.e. 1:1, 1:4, 1:16), it will be used to speed up reads.\ns4 = s.resample(mpp=4.0)\n\n# Get iterator over tiles.\n# Reads will be at [0:512], [512:1024] ... @ MPP\ntiles = m.iterate(s4)\n\n# Read only subset of tiles according to binary mask (1s are read, 0s are not).\n# `s4.shape * scale = mask.shape`, `scale \u003c= 1`\ntiles = tiles.select(mask, scale)\n\n# Read all data, trigger I/O. All the previous calls do not trigger any disk reads beyond metadata.\nimages: list[np.ndarray] = [*tiles]\n```\n\u003c/details\u003e\n\n## Installation\n\n```bash\npip install bipl\n```\nbipl is compatible with: Python 3.10+.\nTested on ArchLinux, Ubuntu 20.04/22.04, Windows 10/11.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farquolo%2Fbipl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farquolo%2Fbipl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farquolo%2Fbipl/lists"}