Skip to content

Added proper handling of nifti RGB formats#46

Open
baishi wants to merge 2 commits intoHumanBrainProject:masterfrom
Neuroinflab:master
Open

Added proper handling of nifti RGB formats#46
baishi wants to merge 2 commits intoHumanBrainProject:masterfrom
Neuroinflab:master

Conversation

@baishi
Copy link

@baishi baishi commented Feb 18, 2026

Two formats of NIfTI are properly supported

  1. The format of (x, y, z, t, (uint8, uint8, uint8)) is supported and mmap works out of the box
  2. The format of (x, y, z, t, [('R', 'u1'), ('G', 'u1'), ('B', 'u1')]) structured rgb format is also supported. However, due to limitation of nibabel, the full dataset need to be loaded into memory.
    A warning is printed for this case

Shi Bai added 2 commits February 19, 2026 05:05
1. The format of (x, y, z, t, (uint8, uint8, uint8)) is supported and
   mmap works out of the box
2. The format of (x, y, z, t, [('R', 'u1'), ('G', 'u1'), ('B', 'u1')])
   structured rgb format is also supported. However, due to limitation
   of nibabel, the full dataset need to be loaded into memory.
   A warning is printed for this case
@xgui3783
Copy link
Collaborator

@baishi thanks for the PR.

Is there a sample nifti where we can write test to prevent regression in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants