Skip to main content

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

  1. Clone this repository
  2. 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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nifti_converter-0.1.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

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

Hashes for nifti_converter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9fbe1cdb64cebf8a0d4c411475a3d7327d788b616126e75859b8307759757a09
MD5 67422cf96418b43418076d7bc4435774
BLAKE2b-256 53e46cf56badbaa5cd7ecd46dc71638246fd637df55a985655bf7de06ad05141

See more details on using hashes here.

File details

Details for the file nifti_converter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nifti_converter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7fe459875c6ff1b37c84c7451de66e3d3db5384a1aae52f35f219e8934771662
MD5 b433d8c137494139ba7e8c5eacd901e8
BLAKE2b-256 0bdb45c1735ad7169639138ae84d0c75b8e0f9362cb814e86e7a1fcb96671d01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page