Skip to content

istevenep/nii-to-gii-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

nii-to-gii-converter

Overview

This project provides a Python script to convert NIfTI (.nii or .nii.gz) files into GIFTI (.gii) files for both left and right pial surfaces from the fsaverage surface included in nilearn. The script is a wrapper for Nilearn and Nibabel functions and outputs the GIFTI files in the same directory as the input NIfTI file, using the same base filename. The .gii file can then be opened with other software (i.e. surfice) for plotting

You can use the script in two ways:

  • Command Line Interface (CLI): Provide the input file as an argument to convert directly from the terminal.
  • Graphical Dialog: Run the script without arguments to open a file dialog for interactive file selection.

Requirements

Install the required dependencies with:

pip install -r requirements.txt
  • nilearn
  • nibabel
  • numpy

Usage

Command Line

To convert a .nii or .nii.gz file to .gii files from the terminal:

python convert_nii_to_gii.py <input_file.nii[.gz]>
  • <input_file.nii[.gz]>: Path to your NIfTI file.

The output files will be named after the input file, with _left.gii and _right.gii suffixes, and saved in the same directory.

Graphical Dialog

To use the graphical interface, run the script without any arguments:

python convert_nii_to_gii.py

A dialog box will appear, allowing you to select the input file interactively.

Output

The script generates two GIFTI files in the same directory as the input NIfTI file:

  • <input_file>_left.gii (left pial surface)
  • <input_file>_right.gii (right pial surface)

Example

Convert both surfaces and use default output names:

python convert_nii_to_gii.py input.nii.gz

This will create input_left.gii and input_right.gii in the same folder as the input

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages