modelarrayio.cli.h5_to_cifti.h5_to_cifti

modelarrayio.cli.h5_to_cifti.h5_to_cifti(example_cifti, in_file, analysis_name, output_dir)[source]

Write 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 and converts it to Nifti2 to get a header. Then each column in results/results_matrix is extracted to fill the data of a new Nifti2 file that gets converted to mif and named according to the corresponding item in results/has_names.

Parameters:
  • example_cifti (pathlike) – abspath to a scalar cifti 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

  • fixel_output_dir (str) – abspath to where the output cifti files will go.

  • Outputs

  • -------

  • None