Convert NIfTI files to usual image formats
Project description
NIfTI Converter
This tool is a command-line application that converts between NIfTI format image files and common image file formats (PNG, TIFF, etc.).
Installation
pip install nifti-converter
Usage
Converting NIfTI to image sequence
nii2iseq -i <input_file> [-o <output_directory>] [--prefix <prefix>]
Options:
-i,--input: Path to the NIfTI file-o,--output: Directory to output files (default: same name as input file without extension)--prefix: Prefix for output file names (default: "")-f,--format: Output file format (default: png)
Notes
- This tool only supports 3D NIfTI files. Files containing 4D or higher dimensional data will result in an error.
- Only png and tiff formats are supported for output files.
- Each slice is saved in the format
<prefix><XXX>.<format>(where XXX is a 3-digit number starting from 000).
Converting image sequence to NIfTI
iseq2nii -i <input_directory> [-o <output_file>]
Options:
-i,--input: Path to the input image directory-o,--output: Output file destination (default: "<input_directory_name>.nii")
For Developers
Prerequisites
Installation
- Clone this repository
- Install dependencies:
cd nifti-converter
uv sync
Testing
To run the modified application locally, execute the following command:
# Converting NIfTI to image sequence
uv run nii2iseq -i <input_file> [-o <output_directory>] [--prefix <prefix>]
# Converting image sequence to NIfTI
uv run iseq2nii -i <input_directory> [-o <output_file>]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nifti_converter-0.1.0.tar.gz
(15.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nifti_converter-0.1.0.tar.gz.
File metadata
- Download URL: nifti_converter-0.1.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fbe1cdb64cebf8a0d4c411475a3d7327d788b616126e75859b8307759757a09
|
|
| MD5 |
67422cf96418b43418076d7bc4435774
|
|
| BLAKE2b-256 |
53e46cf56badbaa5cd7ecd46dc71638246fd637df55a985655bf7de06ad05141
|
File details
Details for the file nifti_converter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nifti_converter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.4.25
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fe459875c6ff1b37c84c7451de66e3d3db5384a1aae52f35f219e8934771662
|
|
| MD5 |
b433d8c137494139ba7e8c5eacd901e8
|
|
| BLAKE2b-256 |
0bdb45c1735ad7169639138ae84d0c75b8e0f9362cb814e86e7a1fcb96671d01
|