kwneuro.util module¶
Common utility functions
- kwneuro.util.create_estimate_volume_resource(array, reference_volume, intent_name)¶
Creates an InMemoryVolumeResource from a numpy array of scalar estimates, using the affine and metadata of a reference volume.
- Parameters:
- Return type:
- kwneuro.util.deep_equal_allclose(obj1, obj2)¶
Recursively compares two objects, including nested lists, tuples, and dicts. Uses np.allclose for numpy arrays. NaN’s are considered equal.
- kwneuro.util.normalize_path(path_input)¶
Accepts a path as a string or Path object, expands the tilde (~), and returns a resolved, absolute Path object.
- kwneuro.util.update_volume_metadata(metadata, volume_data_array, intent_code=None, intent_params=(), intent_name='')¶
Use the convenience of nibabel’s header class to update volume metadata. If intent_code is not provided then we don’t modify the intent parameters.