M_ReadElementsData: data not read completelyideal = 5734400 : actual = 2700286M

Hi, I’m very new to using simpleITK for image conversion, my model now seemingly runs but with this one error message been presented.

M_ReadElementsData: data not read completelyideal = 5734400 : actual = 2700286

Has any one seen this before, there are some augmentations on the image, could that be the issue?

Hello @Will_G,

Based on the information provided in the question it is hard to identify if the issue is due to SimpleITK or something in the deep learning framework in use here (which is it? tensorflow/keras/pytorch/monai…).

When you say “simpleITK for image conversion”, what exactly is it that you are doing? Are you reading an image using simpleitk and then getting a numpy array from it?

Please provide specific details, preferably a minimal working example illustrating the issue.

Hi @zivy, I am trying to read in and mhd file in pytorch, and convert it to a numpy array that is then called later on and formed into a tensor. It is still going through and I am able to run the model, but it seems as though the data is not being read or converted fully. I do pad the image with 0’s before cropping it do you think that could be the case?

Hello @Will_G,

This doesn’t sound like an issue with SimpleITK. I would recommend that you check that the reading and extraction of the numpy array from the SimpleITK image work as expected. If not, create a MWE illustrating the problem with the reading.

If image reading and extraction of the numpy array work, then the problem is in the pytorch code and should be asked on the pytorch discourse.

Does this happen with every .mhd image you have or just one particular image? If the latter, the image could indeed be damaged, e.g. truncated by an unfinished download.

1 Like

@dzenanz Thank you so much, redownloading got rid of the error, unfortunately whenever I run the model now it says “killed” but that seems to be the enxt issue. Thanks again.

1 Like