{"id":25924751,"url":"https://github.com/purepani/xim_reader","last_synced_at":"2025-03-03T18:02:14.559Z","repository":{"id":277780665,"uuid":"933472331","full_name":"purepani/xim_reader","owner":"purepani","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-23T04:38:08.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T05:26:00.745Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purepani.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-02-16T03:15:22.000Z","updated_at":"2025-02-23T04:38:11.000Z","dependencies_parsed_at":"2025-02-16T04:29:13.653Z","dependency_job_id":null,"html_url":"https://github.com/purepani/xim_reader","commit_stats":null,"previous_names":["purepani/xim_reader"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purepani%2Fxim_reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purepani%2Fxim_reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purepani%2Fxim_reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purepani%2Fxim_reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purepani","download_url":"https://codeload.github.com/purepani/xim_reader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241715018,"owners_count":20007913,"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":[],"created_at":"2025-03-03T18:01:36.698Z","updated_at":"2025-03-03T18:02:14.511Z","avatar_url":"https://github.com/purepani.png","language":"Rust","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# xim_reader\nThis tool is a python extension library to read the XIM image format, written in Rust for improved speed. I haven't had a chance to test this with many images, yet, so this library is in an alpha state. This is basically just a parsing library at the moment, so it is better used as a reader to something like the `XIM` class in [pylinac](https://github.com/jrkerns/pylinac).\n\n## Installation\n\nIf just using `pip`,\n```bash\npip install xim-reader-rs\n\n```\nI recommend `uv` as a python projection manager, where\n```bash\nuv add xim-reader-rs\n```\nwill work.\n\n\n\n## Usage\n```python\nfrom xim_reader import XIMImage\nimport numpy as np\n\npath = \"/path/to/image.xim\"\nxim = XIMImage(path)\n\n#Items parsed from header\nheader = xim.header\nprint(header.identifier)\nprint(header.version)\nprint(header.width)\nprint(header.height)\nprint(header.bits_per_pixel)\nprint(header.bytes_per_pixel)\n\n#A 2D numpy array read-only view with the shape (header.height, header.width) representing the image\npixels: np.ndarray[np.int8] | np.ndarray[np.int16] | np.ndarray[np.int32] | np.ndarray[np.int64] = xim.numpy\n\n#A list where each index represents a bin of an XIM Histogram\nhistogram: list[int] = xim.histogram\n\n#Properties contained in XIM image. No processing done on these aside from reading them into a dictionary.\nproperties: dict[str | int | float | list[float] | list[str]] = xim.properties\n\n```\n\n## Building from source\nAside from needing `uv`, the rust compiler must be installed an availible on `PATH`. I have decided to use the 2024 rust edition, meaning at the moment, only the latest rustc version(1.85) is supported. Future versions should compile the package, though. \nAfter that, running \n```bash\nuv build\n```\nwould build the package.\n\nTo install the Rust package into the environment with a debug build, run. Refer to the `maturin` documentation for more info.\n```bash\nmaturin develop\n```\n\n## Contributing\nFeel free to contribute and improve this. Testing this with different data types and compression images would be helpful as well. I currently have only tested with a 32 bit compressed image.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurepani%2Fxim_reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurepani%2Fxim_reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurepani%2Fxim_reader/lists"}