Author: rick reynolds (---.nimh.nih.gov)
Date: 10-07-08 10:47
Hi Cinly,
It is correct that the code fails because of the first
nifti_image_write_bricks(nim, &NBL) call.
Initially, a.nii is written with 2 volumes. The first
nifti_image_read() call reads the header, but then the
first nifti_image_load_bricks() call loads volume[0],
but not volume[1].
---
Then that single volume is written out via the first
nifti_image_write_bricks() call. This is actually not
done correctly. The NBL structure should match the
nifti_image. But the NBL structure contains 1 volume
while the nifti_image has time dimension 2.
The nifti_image_write_bricks() function ought to have a
check and complain when this happens, but it currently
does not.
The result of the first nifti_image_write_bricks() call
is that a.nii now only has 1 volume, while the header
claims that it has 2. So the next read function fails
(since vol = 1, and not 0).
- rick
|
|