本文整理匯總了Python中tvb.core.adapters.abcdisplayer.ABCDisplayer.load_entity_by_gid方法的典型用法代碼示例。如果您正苦於以下問題:Python ABCDisplayer.load_entity_by_gid方法的具體用法?Python ABCDisplayer.load_entity_by_gid怎麽用?Python ABCDisplayer.load_entity_by_gid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tvb.core.adapters.abcdisplayer.ABCDisplayer
的用法示例。
在下文中一共展示了ABCDisplayer.load_entity_by_gid方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_shell_surface_urls
# 需要導入模塊: from tvb.core.adapters.abcdisplayer import ABCDisplayer [as 別名]
# 或者: from tvb.core.adapters.abcdisplayer.ABCDisplayer import load_entity_by_gid [as 別名]
def get_shell_surface_urls(shell_surface=None, project_id=0):
if shell_surface is None:
shell_surface = dao.get_values_of_datatype(project_id, FaceSurface)[0]
if not shell_surface:
raise Exception('No face object found in database.')
shell_surface = ABCDisplayer.load_entity_by_gid(shell_surface[0][2])
face_vertices, face_normals, _, face_triangles = shell_surface.get_urls_for_rendering()
return json.dumps([face_vertices, face_normals, face_triangles])
示例2: compute_sensor_surfacemapped_measure_points
# 需要導入模塊: from tvb.core.adapters.abcdisplayer import ABCDisplayer [as 別名]
# 或者: from tvb.core.adapters.abcdisplayer.ABCDisplayer import load_entity_by_gid [as 別名]
def compute_sensor_surfacemapped_measure_points(project_id, sensors, eeg_cap=None):
"""
Compute sensors positions by mapping them to the ``eeg_cap`` surface
If ``eeg_cap`` is not specified the mapping will use a default.
It returns a url from where to fetch the positions
If no default is available it returns None
:returns: measure points, measure points labels, measure points number
:rtype: tuple
"""
if eeg_cap is None:
eeg_cap = dao.get_values_of_datatype(project_id, EEGCap)[0]
if eeg_cap:
eeg_cap = ABCDisplayer.load_entity_by_gid(eeg_cap[-1][2])
if eeg_cap:
datatype_kwargs = json.dumps({'surface_to_map': eeg_cap.gid})
measure_points = ABCDisplayer.paths2url(sensors, 'sensors_to_surface') + '/' + datatype_kwargs
measure_points_no = sensors.number_of_sensors
measure_points_labels = ABCDisplayer.paths2url(sensors, 'labels')
return measure_points, measure_points_labels, measure_points_no