{"id":15521345,"url":"https://github.com/andrewrosss/nii-info","last_synced_at":"2026-07-29T09:31:29.644Z","repository":{"id":62591421,"uuid":"487040240","full_name":"andrewrosss/nii-info","owner":"andrewrosss","description":"Display NIfTI image information in a tabular format","archived":false,"fork":false,"pushed_at":"2022-05-02T05:49:49.000Z","size":31,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T22:05:51.745Z","etag":null,"topics":["cli","nifti","nifti-images","tool"],"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/andrewrosss.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}},"created_at":"2022-04-29T16:28:52.000Z","updated_at":"2022-04-30T16:42:56.000Z","dependencies_parsed_at":"2022-11-03T20:13:45.149Z","dependency_job_id":null,"html_url":"https://github.com/andrewrosss/nii-info","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fnii-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fnii-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fnii-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewrosss%2Fnii-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewrosss","download_url":"https://codeload.github.com/andrewrosss/nii-info/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248647258,"owners_count":21139081,"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":["cli","nifti","nifti-images","tool"],"created_at":"2024-10-02T10:33:59.476Z","updated_at":"2025-10-15T01:38:45.072Z","avatar_url":"https://github.com/andrewrosss.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nii-info\n\nDisplay NIfTI image information in a tabular format\n\n[![PyPI Version](https://img.shields.io/pypi/v/nii-info.svg)](https://pypi.org/project/nii-info/)\n\n## Installation\n\n```bash\npip install nii-info\n```\n\n## Motivation\n\nThis package attempts to provide a quick and easy way to get a high-level overview of a collection of NIfTI images.\n\nOften when dealing with a collection of NIfTI images the metadata describing those images is embeded across multiple files, specifically the nii images themselves, as well as potential JOSN sidecar files.\n\nOf course, one can crack open a NIfTI file to inspect the header, or load a JSON sidecar into an editor to view its contents. However this quickly becomes tedious when one is dealing with many files and many fields of interest.\n\n`nii-info` collects the values of fields of interest across a set of NIfTI files and aggregates them in a tablular format.\n\n## Usage\n\n`nii-info` exposes a CLI: `nii`\n\n```text\n$ nii --help\nusage: nii [-h] [-o OUT_TSV] [-f FIELDS] [-v] [-D]\n           path [path ...]\n\nDisplay NIfTI image information in a tabular format\n\n...\n\npositional arguments:\n  path                  nifti files or directories\n                        containing nifti files,\n                        directories are searched\n                        recursively\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o OUT_TSV, --out-tsv OUT_TSV\n                        file to write info to. (default:\n                        stdout)\n  -f FIELDS, --fields FIELDS\n                        Fields to include in the table.\n  -v, --version         show program's version number and\n                        exit\n  -D, --debug           run program in debug mode\n```\n\nThe `nii` CLI accepts a list of files and/or directories. Directories are searched recursively for `*.nii` and `*.nii.gz` files.\n\nSimple usage might look something like:\n\n```bash\nnii /path/to/nii/file1.nii.gz /path/to/nii/file2.nii.gz /path/to/nii/dir/\n```\n\n## Modifying Fields/Columns\n\nThis application enables the user to modify which JSON sidecar \u0026 NIfTI header fields are included in the generated output via the `-f`/`--fields` option.\n\nThe `-f` option can be passed multiple times and uses a special syntax.\n\nThe argument for the `-f` option should be string of comma-separated values, where each value contains the \"location\", sidecar or nii header \"key\", and optional \"label\".\n\nFor example, to add the `FlipAngle` and `InversionTime` fields from the sidecars as well as the `datatype` and `descrip` fields from the NIfTI headers to the default set of outputs, the command could look something like:\n\n```bash\nnii \\\n    -f 'sidecar:FlipAngle,sidecar:InversionTime' \\\n    -f 'header:datatype,header:descrip:Header Description' \\\n    /path/to/nii/dir/\n```\n\nIn the above example, `sidecar:FlipAngle` tells the application to extract the `FlipAngle` field from each image's sidecar.\n\nAdditionally, `header:descrip:Header Description` tells the application to extract the `descrip` field from each image's NIfTI header and use the label `Header Descrption` as the column heading.\n\n## Contributing\n\n1. Have or install a recent version of `poetry` (version \u003e= 1.1)\n1. Fork the repo\n1. Setup a virtual environment (however you prefer)\n1. Run `poetry install`\n1. Run `pre-commit install`\n1. Add your changes (adding/updating tests is always nice too)\n1. Commit your changes + push to your fork\n1. Open a PR\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrosss%2Fnii-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewrosss%2Fnii-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewrosss%2Fnii-info/lists"}