get_domain_map¶
-
seas.domains.get_domain_map(components: dict, blur: int = 21, min_size_ratio: float = 0.1, map_only: bool = True, apply_filter_mean: bool = True, max_loops: int = 2, ignore_small: bool = True)[source]¶ Creates a domain map from extracted independent components. A pixelwise maximum projection of the blurred signal components is taken through the n_components axis, to create a flattened representation of where a domain was maximally significant across the cortical surface. Components with multiple noncontiguous significant regions are counted as two distinct domains.
- Parameters
components – The dictionary of components returned from seas.ica.project. Domains are most interesting if artifacts has already been assigned through seas.gui.run_gui.
blur – An odd integer kernel Gaussian blur to run before segmenting. Domains look smoother with larger blurs, but you can lose some smaller domains.
map_only – If true, compute the map only, do not rebuild time courses under each domain.
apply_filter_mean – Whether to compute the filtered mean when calculating ROI rebuild timecourses.
min_size_ratio – The minimum size ratio of the mean component size to allow for a component. If a the size of a component is under (min_size_ratio x mean_domain_size), and the next most significant domain over the pixel would result in a larger size domain, this next domain is chosen.
max_loops – The number of times to check if the next most significant domain would result in a larger domain size. To entirely disable this, set max_loops to 0.
ignore_small – If True, assign undersize domains that were not reassigned during max_loops to np.nan.
- Returns
- a dictionary containing the results of the operation, containing the following keys
- domain_blur:
The Gaussian blur value used when generating the map
- component_assignment:
A map showing the index of which component was maximally significant over a given pixel. Here, This is in contrast to the domain map, where each domain is a unique integer.
- domain_ROIs:
The computed np.array domain map (x,y). Each domain is represented by a unique integer, and represents a discrete continuous unit. Values that are masked, or where large enough domains were not detected are set to np.nan.
- if not map_only, the following are also included in the output dictionary:
- ROI_timecourses:
The time courses rebuilt from the video under each ROI. The frame mean is not included in this calculation, and must be re-added from mean_filtered.
- mean_filtered:
The frame mean, filtered by the default method.
- Return type
output