siibra.commons

Constants, functions, and classes used commonly across siibra.

Functions

MI(arr1, arr2[, nbins, normalized])

Compute the mutual information between two 3D arrays, which need to have the same shape.

affine_scaling(affine)

Estimate approximate isotropic scaling factor of an affine matrix.

argmax_dim4(img[, dim])

Given a nifti image object with four dimensions, returns a modified object with 3 dimensions that is obtained by taking the argmax along one of the four dimensions (default: the last one).

clear_name(name)

clean up a region name to the for matching

compare_maps(map1, map2)

Compare two maps, given as Nifti1Image objects.

create_gaussian_kernel([sigma, sigma_point])

Compute a 3D Gaussian kernel of the given bandwidth.

create_key(name)

Creates an uppercase identifier string that includes only alphanumeric characters and underscore from a natural language name.

is_mesh(structure)

iterate_connected_components(img)

Provide an iterator over masks of connected components in the given image.

merge_meshes(meshes[, labels])

nonzero_coordinates(arr)

set_log_level(level)

siibra_tqdm([iterable])

snake2camel(s)

Converts a string in snake_case into CamelCase.

unify_stringlist(L)

Adds asterisks to strings that appear multiple times, so the resulting list has only unique strings but still the same length, order, and meaning. For example: unify_stringlist(['a','a','b','a','c']) -> ['a','a*','b','a**','c'].

Classes

CompareMapsResult(intersection_over_union, ...)

InstanceTable([matchfunc, elements])

Lookup table for instances of a given class by name/id.

LoggingContext(level)

MapIndex([volume, label, fragment])

Identifies a unique region in a ParcellationMap, combining its labelindex (the "color") and mapindex (the number of the 3Dd map, in case multiple are provided).

MapType(value)

An enumeration.

PolyLine(pts)

Simple polyline representation which allows equidistant sampling..

Species(value)

An enumeration.

TypePublication(*args, **kwargs)