Skip to contents

Constructs an H5NeuroVol object representing a 3D brain volume stored in an HDF5 file. The HDF5 file is opened in read-only mode.

Usage

H5NeuroVol(file_name)

Arguments

file_name

A character string giving the path to an existing 3D HDF5 neuroimaging file.

Value

A new H5NeuroVol-class instance with an open HDF5 file handle.

Details

This constructor is typically used for reading existing HDF5 files that conform to the H5NeuroVol specification.

Lifecycle Management

When an H5NeuroVol object is created by providing a file_name, it opens the specified HDF5 file and maintains an open handle to it. **It is the user's responsibility to explicitly close this handle** when the object is no longer needed to release system resources. This can be done by calling close(your_h5neurovol_object).

Failure to close the handle may lead to issues such as reaching file handle limits or problems with subsequent access to the file.

See also

close for closing the file handle, NeuroVol-class

Examples

if (FALSE) { # \dontrun{
# Assuming "my_volume.h5" is a valid H5NeuroVol HDF5 file
h5vol <- H5NeuroVol("my_volume.h5")
# ... perform operations with h5vol ...
print(dim(h5vol))
# Important: Close the handle when done
close(h5vol)
} # }