# Metric Test Module Error!

**URL:** <https://discourse.slicer.org/t/metric-test-module-error/17279>\
**Category:** Support\
**Created:** [April 23, 2021, 3:20pm UTC](https://discourse.slicer.org/t/metric-test-module-error/17279 "2021-04-23T15:20:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HodaGH](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HodaGH](https://discourse.slicer.org/u/HodaGH)\
**Post date:** [April 23, 2021, 3:20pm UTC](https://discourse.slicer.org/t/metric-test-module-error/17279/1 "2021-04-23T15:20:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 8, 2021, 12:39am UTC](https://discourse.slicer.org/t/metric-test-module-error/17279/2 "2021-05-08T00:39:13Z")

</div>

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](https://github.com/Slicer/Slicer/commit/6a9cb52eb1a93b031c7388ee5688a28a709fa7b4), 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

---

<div class="post-metadata">

**Author:** ![HodaGH](https://avatars.discourse-cdn.com/v4/letter/h/858c86/32.png) [@HodaGH](https://discourse.slicer.org/u/HodaGH)\
**Post date:** [May 10, 2021, 4:53pm UTC](https://discourse.slicer.org/t/metric-test-module-error/17279/3 "2021-05-10T16:53:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 11, 2021, 4:36am UTC](https://discourse.slicer.org/t/metric-test-module-error/17279/4 "2021-05-11T04:36:53Z")

</div>

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.
