GroupStatistics

Create some statistics to test significant changes in voxelized and labeled data.

color_p_values(pvals, psign, positive=[1, 0], negative=[0, 1], p_cutoff=None, positive_trend=[0, 0, 1, 0], negative_trend=[0, 0, 0, 1], pmax=None)[source]
count_points_group_in_regions(point_group, annotation_file='/home/ckirst/Programs/ClearMap2/ClearMap/Resources/Atlas/ABA_25um_annotation.tif', weight_group=None, invalid=0, hierarchical=True)[source]

Generates a table of counts for the various point datasets in pointGroup

cutoff_p_values(pvals, p_cutoff=0.05)[source]

cutt of p-values above a threshold.

Arguments

p_valiuesarray

The p values to truncate.

p_cutofffloat or None

The p-value cutoff. If None, do not cut off.

Returns

p_valuesarray

Cut off p-values.

mean(group, **args)[source]
read_group(sources, combine=True, **args)[source]

Turn a list of sources for data into a numpy stack.

Arguments

sourceslist of str or sources

The sources to combine.

combinebool

If true combine the sources to ndarray, oterhwise return a list.

Returns

grouparray or list

The gorup data.

std(group, **args)[source]
t_test_region_countss(counts1, counts2, annotation_file='/home/ckirst/Programs/ClearMap2/ClearMap/Resources/Atlas/ABA_25um_annotation.tif', signed=False, remove_nan=True, p_cutoff=None, equal_var=False)[source]

t-Test on differences in counts of points in labeled regions

t_test_voxelization(group1, group2, signed=False, remove_nan=True, p_cutoff=None)[source]

t-Test on differences between the individual voxels in group1 and group2

Arguments

group1, group2array of arrays

The group of voxelizations to compare.

signedbool

If True, return also the direction of the changes as +1 or -1.

remove_nanbool

Remove Nan values from the data.

p_cutoffNone or float

Optional cutoff for the p-values.

Returns

p_valuesarray

The p values for the group wise comparison.

test_completed_cumulatives(data, method='AndersonDarling', offset=None, plot=False)[source]

Test if data sets have the same number / intensity distribution by adding max intensity counts to the smaller sized data sets and performing a distribution comparison test

test_completed_cumulatives_in_spheres(points1, intensities1, points2, intensities2, shape='/home/ckirst/Programs/ClearMap2/ClearMap/Resources/Atlas/ABA_25um_annotation.tif', radius=100, method='AndresonDarling')[source]

Performs completed cumulative distribution tests for each pixel using points in a ball centered at that cooridnates, returns 4 arrays p value, statistic value, number in each group

test_completed_inverted_cumulatives(data, method='AndersonDarling', offset=None, plot=False)[source]

Test if data sets have the same number / intensity distribution by adding zero intensity counts to the smaller sized data sets and performing a distribution comparison test on the reversed cumulative distribution

var(group, **args)[source]
weights_from_precentiles(intensities, percentiles=[25, 50, 75, 100])[source]