def get_points(areas, sections=None): """ Parameters ---------- areas : string or list Brain areas to find sections : list (optional) Sections in which to find areas Returns ------- pts : dict or list list of points if areas was a string dict with keys = areas and values = lists of points """ if isinstance(areas, str): areas = [areas] if sections is None: sections = [section.load(si, areas=areas) for si in default_indices] pts = [] for area in areas: for s in sections: pts.extend([(p.x, p.y, s.get_ap(), area) for p in s.find_area(area, 'skull')]) return numpy.array(pts, dtype=pt_dtype)
def construct_areas(sindexes, areas, epsdir=None, tmpdir=None, ptsdir='pts/'): sections = [section.load(si, areas=areas, epsdir=epsdir, tmpdir=tmpdir) for si in sindexes] pts = {} for area in areas: pts[area] = [] for s in sections: pts[area] += [[p.x, p.y, s.get_ap()] for p in s.find_area(area, 'skull')] return pts
def show_sections(sindexes, areas, epsdir=None, tmpdir=None): for si in sindexes: pylab.figure() s = section.load(si, areas=areas, epsdir=epsdir, tmpdir=tmpdir) s.show() pylab.show()