allensdk.internal.mouse_connectivity.interval_unionize.interval_unionizer module

class allensdk.internal.mouse_connectivity.interval_unionize.interval_unionizer.IntervalUnionizer(exclude_structure_ids=None)[source]

Bases: object

direct_unionize(self, data_arrays, pre_sorted=False, **kwargs)[source]

Obtain unionize records from directly annotated regions.

Parameters:
data_arrays : dict

Keys identify types of data volume. Values are flattened arrays.

sorted : bool, optional

If False, data arrays will be sorted.

extract_data(self, data_arrays, low, high, **kwargs)[source]

Given flattened data arrays and a specified interval, generate summary data

Parameters:
data_arrays : dict

Keys identify types of data volume. Values are flattened, sorted arrays.

low : int

Index at which interval of interest begins. Inclusive.

high : int

Index at which interval of interest ends. Exclusive.

postprocess_unionizes(self, raw_unionizes, **kwargs)[source]

Carry out additional calculations/formatting derivative of core unionization.

Parameters:
raw_unionizes : list of unionizes

Each entry is a unionize record.

classmethod propagate_record(child_record, ancestor_record, copy_all=False)[source]

Updates one unionize corresponding to a rootward structure with information from a unionize corresponding to a leafward structure

Parameters:
child_record : unionize

Data will be drawn from this record

ancestor_record : unionize

This record will be updated

classmethod propagate_to_bilateral(lateral_unionizes)[source]
classmethod propagate_unionizes(direct_unionizes, ancestor_id_map)[source]

Structures are arranged in a tree, whose leafward-oriented edges indicate physical containment. This method updates rootward unionize records with information from leafward ones.

Parameters:
direct_unionizes : list of unionizes

Each entry is a unionize record produced from a collection of directly labeled voxels in the segmentation volume.

ancestor_id_map : dict

Keys are structure ids. Values are ids of all structures rootward in

the tree, including the key node
Returns:
output_unionizes : list of unionizes

Contains completed unionize records at all depths in the structure tree

classmethod record_cb()[source]
setup_interval_map(self, annotation)[source]

Build a map from structure ids to intervals in the sorted flattened reference space.

Parameters:
annotation : np.ndarray

Segmentation label array.

sort_data_arrays(self, data_arrays)[source]

Apply the precomputed sort to flattened data arrays

Parameters:
data_arrays : dict

Keys identify types of data volume. Values are flattened, unsorted arrays.

Returns:
dict :

As input, but values are sorted