Description
The Dataset Viewer crashes when loading datasets containing NIfTI (.nii, .nii.gz) neuroimaging files with the error:
Feature type 'Nifti' not found. Available feature types: ['Value', 'ClassLabel', 'Translation', 'TranslationVariableLanguages', 'LargeList', 'List', 'Array2D', 'Array3D', 'Array4D', 'Array5D', 'Audio', 'Image', 'Video', 'Pdf']
Affected Dataset
https://huggingface.co/datasets/hugging-science/arc-aphasia-bids
This is a 273GB neuroimaging dataset in BIDS format containing NIfTI brain scans.
Root Cause
The datasets library added Nifti feature type support in version 4.4.0 (PR huggingface/datasets#7815), but the Dataset Viewer currently pins datasets==4.1.1 which doesn't include this feature type.
Proposed Solution
- Bump
datasets dependency from 4.1.1 to ^4.4.1
- Add
nibabel ^5.0.0 dependency for NIfTI file handling
- Implement NIfTI support in the viewer pipeline:
- Add
NiftiSource TypedDict and create_nifti_file() in asset.py
- Add
nifti() handler in features.py
- Update url_preparator.py for Nifti URL signing
- Update rows.py to prevent truncation of Nifti columns
- Update rows_utils.py for multithreaded Nifti uploads
Implementation
I have a working implementation ready with full test coverage. Will submit a PR shortly.
Impact
This would enable viewing of neuroimaging datasets on HuggingFace Hub, supporting the neuroscience research community.
Description
The Dataset Viewer crashes when loading datasets containing NIfTI (.nii, .nii.gz) neuroimaging files with the error:
Affected Dataset
https://huggingface.co/datasets/hugging-science/arc-aphasia-bids
This is a 273GB neuroimaging dataset in BIDS format containing NIfTI brain scans.
Root Cause
The
datasetslibrary addedNiftifeature type support in version 4.4.0 (PR huggingface/datasets#7815), but the Dataset Viewer currently pinsdatasets==4.1.1which doesn't include this feature type.Proposed Solution
datasetsdependency from 4.1.1 to ^4.4.1nibabel ^5.0.0dependency for NIfTI file handlingNiftiSourceTypedDict andcreate_nifti_file()in asset.pynifti()handler in features.pyImplementation
I have a working implementation ready with full test coverage. Will submit a PR shortly.
Impact
This would enable viewing of neuroimaging datasets on HuggingFace Hub, supporting the neuroscience research community.