deephealthproject / pyecvl

Python wrapper for the ECVL.
MIT License
4 stars 2 forks source link

Error when trying to read nifti images #60

Closed ipediez closed 3 years ago

ipediez commented 3 years ago

Hi,

I'm testing EDDL and ECVL libraries trying to import the data using a DeepHealth Dataset Format file. The images are provided in nifti format (.nii.gz). When executing the code, it yields the following error:

W: DcmItem: Length of element (0000,bdec) is odd
E: DcmElement: Unknown Tag & Data (0000,bdec) larger (1163170935) than remaining bytes in file
W: DcmItem: Dataset not in ascending tag order, at element (0000,bdec)
E: can't read file './sub-S0023782_ses-E0025277_run-1_bp-lsspine_vp-sag_T2w.nii.gz'
Error: cannot load DICOM image (Invalid DICOM document)

The code I'm using to load the dataset is the following:

d = ecvl.DLDataset('./uc09_dhdataset.yaml', prm['BATCH_SIZE'], dataset_augs)

Is nifti implemented inside ECVL? Do you know a way to read these images with the ecvl.DLDataset function?

lauracanalini commented 3 years ago

Hi @ipediez, nifti is already implemented in ECVL, but only for decompressed images (.nii). So, right now, the only way is to decompress the images a priori.

We will work to integrate the import of compressed images directly into ECVL.

ipediez commented 3 years ago

Thank you! I'll work decompressing the images until it's integrated

lauracanalini commented 3 years ago

Hi @ipediez, we added the decompression in the development branch. It's still not optimized, but it should work. Could you try if your dataset images are decompressed correctly? We downloaded some compressed nifti but another check could be useful!

ipediez commented 3 years ago

Hi @lauracanalini,

We are testing the dataset and the ECVL library in ODH platform (PF5), so let me get in touch with ODH administrators to see if they can install the development version to test it.

ipediez commented 2 years ago

Hi @lauracanalini

I have tested the images with the development branch of ECVL by reading the images with ECLV and then plotting them with matplotlib. The new functionality seems to decompress correctly the images.