modelarrayio.cli.h5_to_mif.h5_to_mif

modelarrayio.cli.h5_to_mif.h5_to_mif(example_mif, in_file, analysis_name, compress, output_dir)[source]

Writes the contents of an hdf5 file to a fixels directory.

The in_file parameter should point to an HDF5 file that contains at least two datasets. There must be one called results/results_matrix, that contains a matrix of fixel results. Each column contains a single result and each row is a fixel. This matrix should be of type float. The second required dataset must be named results/has_names. This data can be of any type and does not need to contain more than a single row of data. Instead, its attributes are read to get column names for the data represented in results/results_matrix. The function takes the example mif file as a template header. Then each column in results/results_matrix is extracted to fill the data of a new MifImage and named according to the corresponding item in results/has_names.

Parameters:
  • example_mif (str) – abspath to a scalar mif file. Its header is used as a template

  • in_file (str) – abspath to an h5 file that contains statistical results and their metadata.

  • analysis_name (str) – the name for the analysis results to be saved

  • compress (bool) – whether to compress output MIF files

  • output_dir (str) – abspath to where the output fixel data will go. the index and directions mif files should already be copied here.

  • Outputs

  • -------

  • None