Multi-Disease, Multi-View & Multi-Center Right Ventricular Segmentation in Cardiac MRI (M&Ms-2) Forum

Go back to competition Back to thread list Post in this thread

> Trouble with reading data

I always find these very silly questions.. but I cant seem to properly read in all the data.

In total I found 1600 files, where 509 produced no error and 1091 gave an error when executing the code `nib_obj = nibabel.load(temp_file)`. In the 1091 cases where it went wrong, the following error was generated:

nibabel.filebasedimages.ImageFileError: Cannot work out file type of "~/data/m&m/MnM-2/training/001/001_LA_ED.nii.gz"

Another method of reading in data is with the command `nib_obj = nibabel.Nifti1Image.from_filename(temp_file)`. This also gave an error, albeit a different one:

`gzip.BadGzipFile: Not a gzipped file (b'\x00\x00')

Then, the files that gave no error with either command were not totally error free though. Upon fetching the data with `image_array = nib_obj.get_fdata()` the following error was sometimes produced

zlib.error: Error -3 while decompressing data: invalid distance too far back

From my first inspection, this happens to files with ED or ES in them. Have not tried the validation files, this is only based on the training data. Has any of you encounterd this error as well?
Currently using the following version:
python - 3.8.5
nibabel - 3.0.1
gzip - 1.10

`

Posted by: zwep @ June 1, 2021, 12:05 p.m.

For the future:

my unzipping process was faulty. Im using Ubuntu and used the Extract here.. option when I right clicked the .rar file.
I think Ubuntu used some default extractor here that does not unpack .rar files properly. Resulting in this strange error, but also in wrong (extracted) file sizes.

Using the command line and the `unrar` command solved my issues

Posted by: zwep @ June 7, 2021, 9:45 a.m.
Post in this thread