Error uploading an example image file

Error uploading an example image file  

  By: shiveshc on June 24, 2024, 1:53 a.m.

Hi all

I am trying to test my container by uploading an example image file but I am always getting an error like this below. Does anyone know how to solve this?

w2s_noisy_0.tiff We could not import this file using any image builder, the error for each image builder is: Mhd image builder: Could not validate or parse ITK header. Line length is too long NifTI image builder: Not a NifTI image file NRRD image builder: Not a NRRD image file Dicom image builder: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the header. Use force=True to force reading. TIFF image builder: Could not open file with tifffile. TIFF image builder: Could not open file with OpenSlide. TIFF image builder: Validation error: Not a valid tif: Voxel width could not be determined. OCT image builder: Not a valid OCT file (supported formats: .fds,.fda,.e2e) Fallback image builder: Not a valid image file

Re: Error uploading an example image file  

  By: fikriyomarosyidan01 on June 24, 2024, 6:23 a.m.

Hello shiveshc,

Let me answer here with my experience when sending submissions. This error occurs because basically the w2s dataset that we get has the following metadata:

# Prepare ImageJ metadata, set ‘True’
slices, channels, height, width = noisy_stack.shape
images = slices * channels  # Total number of 2D images in the stack

metadata = {
        'ImageJ': '1.11a',
        'images': images,
        'channels': channels,
        'slices': slices,
        'hyperstack': True
    }

Which causes the first error that is displayed is ‘Mhd image builder: Could not validate or parse ITK header’. The subsequent errors are derivatives of this first error. My suggestion is that you immediately send the submission without testing it yourself, because the committee somehow has w2s data that is able to circumvent this error 'Mhd image builder: Could not validate or parse ITK header'. If your inference uses ‘tifffile.TiffWriter()’, then my advice is not to use ‘tifffile.TiffWriter(…,imagej=True)’. This always makes my submissions fail because imagej appears as the metadata.

Re: Error uploading an example image file  

  By: jmsmkn on June 24, 2024, 6:46 a.m.

The error does not have anything to do with the MHD image loader. You are uploading a TIFF file and expect it to be parsed as a TIFF file, not as an MHD file. The relevant error is:

TIFF image builder: Validation error: Not a valid tif: Voxel width could not be determined.

You can fix this by setting a voxel width in your TIFF file (e.g. XResolution and YResolution should be set). This library is used for parsing image data, you can run it locally to see the errors directly.