I ran fMRIPrep (latest version) with the which generated an .h5 files containing the transforms for warping images from native space to MNI space.
Now, I need to apply this transformation to a functional stat map (a first-level contrast z map created in using Nilearn), but it seems that antsApplyTransforms does not accept .h5 files as direct inputs.
I’m looking for guidance on how to extract the transformation from the .h5 file and apply it correctly.
HDF5-DIAG: Error detected in HDF5 (1.8.17) thread 0:
#000: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5D.c line 358 in itk_H5Dopen2(): not found
major: Dataset
minor: Object not found
#001: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Gloc.c line 430 in itk_H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
#002: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Gtraverse.c line 861 in itk_H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
#003: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Gtraverse.c line 641 in H5G_traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
#004: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Gloc.c line 385 in H5G_loc_find_cb(): object 'TranformFixedParameters' doesn't exist
major: Symbol table
minor: Object not found
Transform reader for /cbica/home/zivma/Functional/derivative/fmriprep_24.1.1_new/fmriprep_t1/sub-CBPD0250/ses-01/anat/sub-CBPD0250_ses-01_acq-hbcd_run-01_from-MNI152NLin2009cAsym_to-T1w_mode-image_xfm.h5 caught an ITK exception:
itk::ExceptionObject (0x12d5c60)
Location: "unknown"
File: /cbica/software/external/ants/centos7/2.3.1/ITKv5/Modules/IO/TransformHDF5/include/itkHDF5TransformIO.hxx
Line: 378
Description: itk::ERROR: HDF5TransformIOTemplate(0x1145a60): H5Dopen2 failed
In the future, please format your code text using the tick marks (or </> in the text editor). You can see I edited your code for you this time for readability.
May you please try a more updated version of ANTs and confirm the paths you defined are correct? Perhaps, try running ANTs using the same fmriprep container, to better ensure version comparability.