Hi,
I'm finding that mri_convert produces a read error when trying to convert some short analyze files to mgz, invoked as the following: mri_convert -it analyze -i `pwd`/reslice/00125-003-1.img -o reslice/mni.mgz
The output contains (the dimensions shown are correct): ERROR: premature end of file ERROR: Success (0) frame = 0, slice = 219, k=219, row = 155 nread = 171, nexpected = 172 fname = height = 156 width = 172 depth = 220
and: analyzeRead2(): error reading from file reslice/00125-003-1.img
The file in question is 11806080 bytes.
Using strace I can see that when the .img file is opened 1 byte is read from it before reading in blocks of 1024, and a final read of 383 bytes. Trying another short file (which works) this initial 1 byte read does not happen. Is this is bug? I can provide the files in question if needed.
Build stamp: freesurfer-Linux-rh9-stable-pub-v4.0.3
Kernel info: Linux 2.6.21.5-smp i686
Thanks, Ian Malone
Hi Ian,
do you have a .hdr file for both of them? A .mat?
cheers, Bruce On Wed, 14 Jan 2009, Ian Malone wrote:
Hi,
I'm finding that mri_convert produces a read error when trying to convert some short analyze files to mgz, invoked as the following: mri_convert -it analyze -i `pwd`/reslice/00125-003-1.img -o reslice/mni.mgz
The output contains (the dimensions shown are correct): ERROR: premature end of file ERROR: Success (0) frame = 0, slice = 219, k=219, row = 155 nread = 171, nexpected = 172 fname = height = 156 width = 172 depth = 220
and: analyzeRead2(): error reading from file reslice/00125-003-1.img
The file in question is 11806080 bytes.
Using strace I can see that when the .img file is opened 1 byte is read from it before reading in blocks of 1024, and a final read of 383 bytes. Trying another short file (which works) this initial 1 byte read does not happen. Is this is bug? I can provide the files in question if needed.
Build stamp: freesurfer-Linux-rh9-stable-pub-v4.0.3
Kernel info: Linux 2.6.21.5-smp i686
Thanks, Ian Malone _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Can you verify that the file is the right size?
Ian Malone wrote:
Hi,
I'm finding that mri_convert produces a read error when trying to convert some short analyze files to mgz, invoked as the following: mri_convert -it analyze -i `pwd`/reslice/00125-003-1.img -o reslice/mni.mgz
The output contains (the dimensions shown are correct): ERROR: premature end of file ERROR: Success (0) frame = 0, slice = 219, k=219, row = 155 nread = 171, nexpected = 172 fname = height = 156 width = 172 depth = 220
and: analyzeRead2(): error reading from file reslice/00125-003-1.img
The file in question is 11806080 bytes.
Using strace I can see that when the .img file is opened 1 byte is read from it before reading in blocks of 1024, and a final read of 383 bytes. Trying another short file (which works) this initial 1 byte read does not happen. Is this is bug? I can provide the files in question if needed.
Build stamp: freesurfer-Linux-rh9-stable-pub-v4.0.3
Kernel info: Linux 2.6.21.5-smp i686
Thanks, Ian Malone _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
The file is the right size, however further investigation shows that vox_offset in the .hdr file was (incorrectly) non-zero; equal to 1, so mri_convert is correct in skipping one byte at the start. Sorry for the fuss.
Ian
Douglas N Greve wrote:
Can you verify that the file is the right size?
Ian Malone wrote:
Hi,
I'm finding that mri_convert produces a read error when trying to convert some short analyze files to mgz, invoked as the following: mri_convert -it analyze -i `pwd`/reslice/00125-003-1.img -o reslice/mni.mgz
The output contains (the dimensions shown are correct): ERROR: premature end of file ERROR: Success (0) frame = 0, slice = 219, k=219, row = 155 nread = 171, nexpected = 172 fname = height = 156 width = 172 depth = 220
and: analyzeRead2(): error reading from file reslice/00125-003-1.img
The file in question is 11806080 bytes.
Using strace I can see that when the .img file is opened 1 byte is read from it before reading in blocks of 1024, and a final read of 383 bytes. Trying another short file (which works) this initial 1 byte read does not happen. Is this is bug? I can provide the files in question if needed.
Build stamp: freesurfer-Linux-rh9-stable-pub-v4.0.3
Kernel info: Linux 2.6.21.5-smp i686
Thanks, Ian Malone _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
no problem, thanks for tracking it down.
Bruce On Thu, 15 Jan 2009, Ian Malone wrote:
The file is the right size, however further investigation shows that vox_offset in the .hdr file was (incorrectly) non-zero; equal to 1, so mri_convert is correct in skipping one byte at the start. Sorry for the fuss.
Ian
Douglas N Greve wrote:
Can you verify that the file is the right size?
Ian Malone wrote:
Hi,
I'm finding that mri_convert produces a read error when trying to convert some short analyze files to mgz, invoked as the following: mri_convert -it analyze -i `pwd`/reslice/00125-003-1.img -o reslice/mni.mgz
The output contains (the dimensions shown are correct): ERROR: premature end of file ERROR: Success (0) frame = 0, slice = 219, k=219, row = 155 nread = 171, nexpected = 172 fname = height = 156 width = 172 depth = 220
and: analyzeRead2(): error reading from file reslice/00125-003-1.img
The file in question is 11806080 bytes.
Using strace I can see that when the .img file is opened 1 byte is read from it before reading in blocks of 1024, and a final read of 383 bytes. Trying another short file (which works) this initial 1 byte read does not happen. Is this is bug? I can provide the files in question if needed.
Build stamp: freesurfer-Linux-rh9-stable-pub-v4.0.3
Kernel info: Linux 2.6.21.5-smp i686
Thanks, Ian Malone _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer
freesurfer@nmr.mgh.harvard.edu