BIC-MNI / Display

MNI Display project, converted from CVS
Other
8 stars 4 forks source link

Allow Display to view single-slice 2D nifti files #37

Closed gdevenyi closed 8 years ago

gdevenyi commented 8 years ago

If I try to load a 2D nifti file (a single brain slice), I get:

<REPEAT MANY TIMES>
++ WARNING: nifti_read_buffer(resampled.nii.gz):
   data bytes needed = 314216
   data bytes input  = 0
   number missing    = 314216 (set to 0)
clipping uint8 value
<REPEAT MANY TIMES>
VIO_Volume resampled.nii.gz has 2 dimensions, should have at least 3
Error loading resampled.nii.gz

Example files here https://github.com/ntustison/antsRegistrationWithMaskExample

rdvincent commented 8 years ago

@gdevenyi I just pushed a fix for this in libminc. Essentially we have to lie to Display and treat 2D files as 3D files with a singleton dimension. In the longer run it might be nice to convince Display to work with actual 1D or 2D files, but that would probably require major surgery.

gdevenyi commented 8 years ago

What you did sounds like a fine fix for now.

Tested with Display and register, works fine.