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_arrays(arr1, affine1, arr2, affine2)

Compare two arrays in physical space as defined by the given affine matrices.

connected_components(imgdata[, background, ...])

Provide an iterator over connected components in the array.

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.

generate_uuid(string)

is_mesh(structure)

merge_meshes(meshes[, labels])

nonzero_coordinates(arr)

resample_img_to_img(source_img, target_img)

Resamples to source image to match the target image according to target's affine.

set_log_level(level)

siibra_tqdm([iterable])

snake2camel(s)

Converts a string in snake_case into CamelCase.

translation_matrix(tx, ty, tz)

Construct a 3D homoegneous translation matrix.

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'].

y_rotation_matrix(alpha)

Construct a 3D y axis rotation matrix.

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)