Close an Object
Source:R/all_generic.R
, R/cluster_experiment.R
, R/h5neurovec.R
, and 3 more
close.Rd
Close connections or release resources associated with an object. This generic is used for objects that manage external resources like HDF5 file handles.
This method manually closes the HDF5 file handle stored within the
H5NeuroVec object. It uses the safe_h5_close
helper.
This method manually closes the HDF5 file handle stored within the
H5NeuroVol object. It uses the safe_h5_close
helper.
This method manually closes the HDF5 file handle stored within the LabeledVolumeSet object. It uses the \codesafe_h5_close helper to ensure the handle is valid before attempting to close. After closing, the internal handle reference is nulled to prevent accidental reuse.
Usage
close(con, ...)
# S4 method for class 'H5ParcellatedMultiScan'
close(con, ...)
# S4 method for class 'H5NeuroVec'
close(con, ...)
# S4 method for class 'H5NeuroVecSeq'
close(con, ...)
# S4 method for class 'H5NeuroVol'
close(con, ...)
# S4 method for class 'LabeledVolumeSet'
close(con, ...)
Value
Usually returns NULL invisibly
NULL invisibly
Invisibly returns NULL
.
Invisibly returns NULL
.
Invisibly returns \codeNULL.
Details
**Important:** If this LabeledVolumeSet
object was created from
a file path using read_labeled_vec
, the user is responsible
for calling this close
method when finished with the object to release
the file handle. Failure to do so will leave the file open until the R session ends.
If the object was created using an existing H5File
handle, closing
remains the responsibility of the code that originally opened the handle.
See also
Other H5Parcellated:
$,H5ParcellatedMultiScan-method
,
H5ParcellatedArray-class
,
H5ParcellatedMultiScan
,
H5ParcellatedScan-class
,
H5ParcellatedScanSummary-class
,
cluster_metadata,H5ParcellatedMultiScan-method
,
clusters()
,
h5file,H5ParcellatedArray-method
,
mask()
,
matrix_concat()
,
n_scans,H5ParcellatedMultiScan-method
,
scan_metadata,H5ParcellatedMultiScan-method
,
scan_names,H5ParcellatedMultiScan-method
,
series_concat()
Examples
if (FALSE) { # \dontrun{
# Example with LabeledVolumeSet
if (!is.null(fmristore:::create_minimal_h5_for_LabeledVolumeSet)) {
temp_file <- fmristore:::create_minimal_h5_for_LabeledVolumeSet()
lvs <- read_labeled_vec(temp_file)
# Use the object...
close(lvs) # Close the HDF5 file handle
unlink(temp_file)
}
} # }