You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @cabeen
I hope you are well, I got an error when I wanted to read a nifti file that had a .json extension. It may be my misunderstanding of the format.
while (start_addr < (int) ds.vox_offset)
{
int[] size_code = newint[2];
size_code[0] = di.readInt();
size_code[1] = di.readInt();
intnb = size_code[0] - NiftiHeader.EXT_KEY_SIZE;
byte[] eblob = newbyte[nb];
di.readFully(eblob, 0, nb);
ds.extension_blobs.add(eblob);
ds.extensions_list.add(size_code);
start_addr += (size_code[0]);
if (start_addr > (int) ds.vox_offset)
thrownewIOException("Error: Data for extension " + (ds.extensions_list.size())
+ " appears to overrun start of image data.");
}
let's assume we have a JSON file (157 bytes) and 8 bytes for extension keys; when it reaches to end; the start_addr is 509, so It starts again and reads the first 8 bytes which may be wrong.
I think if it checks the size of the rest bytes, it could be solved. like this:
if(((int) ds.vox_offset - start_addr)<16)
break;
Kind regards,
The text was updated successfully, but these errors were encountered:
Hi @cabeen
I hope you are well, I got an error when I wanted to read a nifti file that had a .json extension. It may be my misunderstanding of the format.
let's assume we have a JSON file (157 bytes) and 8 bytes for extension keys; when it reaches to end; the start_addr is 509, so It starts again and reads the first 8 bytes which may be wrong.
I think if it checks the size of the rest bytes, it could be solved. like this:
Kind regards,
The text was updated successfully, but these errors were encountered: