Error: "GlSlice: Trying to set a Slice containing NaN."

Hi all,

I’m getting the error “GlSlice: Trying to set a Slice containing NaN.” while trying to open a 3D image with ImFusion. The specifications are resolution: 192x192x148, file type: .nii.gz, spacing 1.0mm. The image is opening successfully in Slicer (slicer.org), and can be successfully read via the Python SimpleITK library (simpleitk.readthedocs.io).

The image is created from a NumPy array, and saved using the SimpleITK Python library. Other images using the same technique load fine in ImFusion.

The NumPy array contains no NaNs when it is saved. Similarly, after re-loading the saved image in Python, no NaNs are found. The range of unique values is:

array([-1020., -1017., -1014., ...,  1558.,  1602.,  1608.], dtype=float32)

Has anyone encountered the same error, or the least found a working solution?

My ImFusion version is 2.27.1.

Many thanks,
Abdullah

Dear Abdullah,
Could you share an example file with us?
(you can send it to me via private message if you don’t want to make the file public)

1 Like

Dear Abdullah,

I had a look at the file that you saved me and the problem seems to come from the matrix (world position/orientation) of the volume. This 4x4 matrix somehow contains Nans when our Nifti loader tries to open your image.
We will investigate on that. In the meantime, a temporary workaround could be to load the image in Slicer and export it as another format (for instance I tried with .mhd and it worked, i.e. I could load the image in the ImFusion Suite).

Last question to maybe help us understand what is going on: how did you generate this file in the first place?