Metric Test Module Error!

Hi all,

I’m using macOS Mojave. I get this following error when I try to get the MMI value while having a transform file. I tried other transform files too but I get the same error. And no error without a transform file. The transform file is created by Elastix in Slicer and I didn’t change anything as the error suggests.

Metric Test standard error:

HDF5-DIAG: Error detected in HDF5 (1.10.4) thread 0:
#000: /Volumes/D/S/S-0-build/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5F.c line 370 in itk_H5Fis_hdf5(): unable open file
major: File accessibilty
minor: Not an HDF5 file
#001: /Volumes/D/S/S-0-build/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fint.c line 802 in itk_H5F__is_hdf5(): unable to open file
major: Low-level I/O
minor: Unable to initialize object
#002: /Volumes/D/S/S-0-build/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FD.c line 734 in itk_H5FD_open(): open failed
major: Virtual File Layer
minor: Unable to initialize object
#003: /Volumes/D/S/S-0-build/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDsec2.c line 346 in H5FD_sec2_open(): unable to open file: name = ‘/private/var/folders/8b/yp3srf4s2svdnn_j_cwbvnyw0000gn/T/Slicer-hodagh/BGIFF_AxHfaeGHIabfDA.mrml#vtkMRMLLinearTransformNode1’, errno = 2, error message = ‘No such file or directory’, flags = 0, o_flags = 0
major: File accessibilty
minor: Unable to open file
Exception caught!

itk::ExceptionObject (0x7f977a655490)
Location: “unknown”
File: /Volumes/D/S/S-0-build/ITK/Modules/IO/TransformBase/src/itkTransformFileReader.cxx
Line: 128
Description: itk::ERROR: itk::ERROR: TransformFileReaderTemplate(0x7f977a6540e0): Could not create Transform IO object for reading file /private/var/folders/8b/yp3srf4s2svdnn_j_cwbvnyw0000gn/T/Slicer-hodagh/BGIFF_AxHfaeGHIabfDA.mrml#vtkMRMLLinearTransformNode1
File does not exists! Tried to create one of the following:
HDF5TransformIOTemplate
HDF5TransformIOTemplate
MatlabTransformIOTemplate
MatlabTransformIOTemplate
TxtTransformIOTemplate
TxtTransformIOTemplate
You probably failed to set a file suffix, or
set the suffix to an unsupported type.

The problem is that by default (if transform file extension is not specified) then Slicer uses a mini-scene to pass a transform to a CLI module (so that you can get the complete transform tree, not just a single transform). Most CLI modules specify a file extension (such as .h5) and use ITK transform reader without problems. However, there seem to be modules that don’t specify a file extension and still want to use ITK transform reader - this does not work.

I’ve changed the behavior in Slicer to use .h5 file format by default, which will fix this issue. The fix will be available in Slicer Preview Release from tomorrow.

However, you may find that the Metric Test Module is only applicable for a very narrow use case. You may achieve much more with writing a short Python script

1 Like

Thank you very much Andras. Would you elaborate more on what you meant by narrow use case? I mean what can I achieve in addition to the MI value?

It only works for a specific transform type. Also, a single mutual information value is not usable for much: you would need to take many metric samples and analyze the distribution instead. For example, the registration is accurate if you have the optimum near the MI metric minimum; robust if the metric surface is smooth and there are no local minima nearby the global minimum.

1 Like