• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python mmvt_utils.get_user_fol函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中mmvt_utils.get_user_fol函数的典型用法代码示例。如果您正苦于以下问题:Python get_user_fol函数的具体用法?Python get_user_fol怎么用?Python get_user_fol使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_user_fol函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _connections_origin_update

def _connections_origin_update():
    if bpy.context.scene.connections_origin == 'rois':
        bpy.context.scene.connections_file = op.join(mu.get_user_fol(), 'rois_con.npz')
    elif bpy.context.scene.connections_origin == 'electrodes':
        bpy.context.scene.connections_file = op.join(mu.get_user_fol(), 'electrodes', 'electrodes_con.npz')
    else:
        print('Wrong connection type!!!')
    if ConnectionsPanel.d == {}:
        load_connections_file()
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:9,代码来源:connections_panel.py


示例2: eeg_data_and_meta

def eeg_data_and_meta():
    if DataMakerPanel.eeg_data is None:
        data_fname = op.join(mu.get_user_fol(), 'eeg', 'eeg_data.npy')
        meta_fname = op.join(mu.get_user_fol(), 'eeg', 'eeg_data_meta.npz')
        if op.isfile(data_fname) and op.isfile(meta_fname):
            DataMakerPanel.eeg_data = np.load(data_fname, mmap_mode='r')
            DataMakerPanel.eeg_meta = np.load(meta_fname)
        else:
            DataMakerPanel.eeg_data = DataMakerPanel.eeg_meta = None
    return DataMakerPanel.eeg_data, DataMakerPanel.eeg_meta
开发者ID:pelednoam,项目名称:mmvt,代码行数:10,代码来源:data_panel.py


示例3: fmri_files_update

def fmri_files_update(self, context):
    #todo: there are two frmi files list (the other one in fMRI panel)
    user_fol = mu.get_user_fol()
    for hemi in mu.HEMIS:
        fname = op.join(user_fol, 'fmri', 'fmri_{}_{}.npy'.format(bpy.context.scene.fmri_files, hemi))
        ColoringMakerPanel.fMRI[hemi] = np.load(fname)
    fmri_data_maxmin_fname = op.join(mu.get_user_fol(), 'fmri', 'fmri_activity_map_minmax_{}.pkl'.format(
        bpy.context.scene.fmri_files))
    if op.isfile(fmri_data_maxmin_fname):
        data_min, data_max = mu.load(fmri_data_maxmin_fname)
        ColoringMakerPanel.fmri_activity_colors_ratio = 256 / (data_max - data_min)
        ColoringMakerPanel.fmri_activity_data_min = data_min
        ColoringMakerPanel.fmri_activity_data_max = data_max
开发者ID:pelednoam,项目名称:mmvt,代码行数:13,代码来源:coloring_panel.py


示例4: import_brain

def import_brain(context=None):
    # self.brain_layer = DataMakerPanel.addon.BRAIN_EMPTY_LAYER
    # self.current_root_path = mu.get_user_fol()  # bpy.path.abspath(bpy.context.scene.conf_path)
    if _addon() is None:
        print('addon is None!')
        return
    user_fol = mu.get_user_fol()
    print("importing ROIs")
    import_rois(user_fol)
    import_hemis_for_functional_maps(user_fol)
    import_subcorticals(op.join(user_fol, 'subcortical'))
    # if op.isdir(op.join(user_fol, 'cerebellum')):
    #     import_subcorticals(op.join(user_fol, 'cerebellum'), 'Cerebellum')
    if context:
        last_obj = context.active_object.name
        print('last obj is -' + last_obj)
    # create_inflating_morphing()
    if bpy.data.objects.get(' '):
        bpy.data.objects[' '].select = True
        if context:
            context.scene.objects.active = bpy.data.objects[' ']
    if context:
        bpy.data.objects[last_obj].select = False
    DataMakerPanel.addon.show_rois()
    bpy.types.Scene.brain_imported = True
    print('cleaning up')
    for obj in bpy.data.objects['Subcortical_structures'].children:
        # print(obj.name)
        if obj.name[-1] == '1':
            obj.name = obj.name[0:-4]
    bpy.ops.object.select_all(action='DESELECT')
    print('Brain importing is Finished ')
开发者ID:pelednoam,项目名称:mmvt,代码行数:32,代码来源:data_panel.py


示例5: plot_activity

def plot_activity(map_type, faces_verts, threshold, meg_sub_activity=None,
        plot_subcorticals=True, override_current_mat=True, clusters=False):
    current_root_path = mu.get_user_fol() # bpy.path.abspath(bpy.context.scene.conf_path)
    not_hiden_hemis = [hemi for hemi in HEMIS if not bpy.data.objects[hemi].hide]
    frame_str = str(bpy.context.scene.frame_current)

    loop_indices = {}
    for hemi in not_hiden_hemis:
        colors_ratio, data_min = None, None
        if map_type == 'MEG':
            fname = op.join(current_root_path, 'activity_map_' + hemi, 't' + frame_str + '.npy')
            if op.isfile(fname):
                f = np.load(fname)
                if _addon().colorbar_values_are_locked():
                    data_max, data_min = _addon().get_colorbar_max_min()
                    colors_ratio = 256 / (data_max - data_min)
                else:
                    colors_ratio = ColoringMakerPanel.meg_activity_colors_ratio
                    data_min = ColoringMakerPanel.meg_activity_data_min
                    data_max = ColoringMakerPanel.meg_activity_data_max
                    _addon().set_colorbar_max_min(data_max, data_min)
                _addon().set_colorbar_title('MEG')
            else:
                print("Can't load {}".format(fname))
                return False
        elif map_type == 'FMRI':
            if not ColoringMakerPanel.fmri_activity_data_min is None and \
                    not ColoringMakerPanel.fmri_activity_data_max is None:
                if _addon().colorbar_values_are_locked():
                    data_max, data_min = _addon().get_colorbar_max_min()
                    colors_ratio = 256 / (data_max - data_min)
                else:
                    colors_ratio = ColoringMakerPanel.fmri_activity_colors_ratio
                    data_min = ColoringMakerPanel.fmri_activity_data_min
                    data_max = ColoringMakerPanel.fmri_activity_data_max
                    _addon().set_colorbar_max_min(data_max, data_min)
                _addon().set_colorbar_title('fMRI')
            if clusters:
                f = [c for h, c in ColoringMakerPanel.fMRI_clusters.items() if h == hemi]
            else:
                f = ColoringMakerPanel.fMRI[hemi]
        if bpy.context.scene.coloring_both_pial_and_inflated:
            for cur_obj in [bpy.data.objects[hemi], bpy.data.objects['inflated_{}'.format(hemi)]]:
                activity_map_obj_coloring(cur_obj, f, faces_verts[hemi], threshold, override_current_mat, data_min,
                                          colors_ratio)
        else:
            if _addon().is_pial():
                cur_obj = bpy.data.objects[hemi]
            elif _addon().is_inflated():
                cur_obj = bpy.data.objects['inflated_{}'.format(hemi)]
            activity_map_obj_coloring(cur_obj, f, faces_verts[hemi], threshold, override_current_mat, data_min, colors_ratio)

    if plot_subcorticals and not bpy.context.scene.objects_show_hide_sub_cortical and not meg_sub_activity is None:
        if map_type == 'MEG':
            if not bpy.data.objects['Subcortical_meg_activity_map'].hide:
                color_object_homogeneously(meg_sub_activity, '_meg_activity', threshold)
        if map_type == 'FMRI':
            fmri_subcortex_activity_color(threshold, override_current_mat)

    return True
开发者ID:pelednoam,项目名称:mmvt,代码行数:60,代码来源:coloring_panel.py


示例6: load_faces_verts

def load_faces_verts():
    faces_verts = {}
    current_root_path = mu.get_user_fol()
    faces_verts['lh'] = np.load(op.join(current_root_path, 'faces_verts_lh.npy'))
    faces_verts['rh'] = np.load(op.join(current_root_path, 'faces_verts_rh.npy'))
    # faces_verts['cortex'] = np.load(op.join(current_root_path, 'faces_verts_cortex.npy'))
    return faces_verts
开发者ID:pelednoam,项目名称:mmvt,代码行数:7,代码来源:coloring_panel.py


示例7: draw

    def draw(self, context):
        layout = self.layout
        # layout.prop(context.scene, 'conf_path')
        col = self.layout.column(align=True)
        col.prop(context.scene, 'atlas', text="Atlas")
        # if not bpy.types.Scene.brain_imported:
        # col.operator("ohad.anatomy_preproc", text="Run Preporc", icon='BLENDER')
        col.operator("ohad.brain_importing", text="Import Brain", icon='MATERIAL_DATA')
        # if not bpy.types.Scene.electrodes_imported:
        electrodes_positions_files = glob.glob(op.join(mu.get_user_fol(), 'electrodes', 'electrodes*positions*.npz'))
        if len(electrodes_positions_files) > 0:
            col.prop(context.scene, 'bipolar', text="Bipolar")
            col.prop(context.scene, 'electrodes_radius', text="Electrodes' radius")
            col.prop(context.scene, 'electrodes_positions_files', text="")
            col.operator("ohad.electrodes_importing", text="Import Electrodes", icon='COLOR_GREEN')

        # if bpy.types.Scene.brain_imported and (not bpy.types.Scene.brain_data_exist):
        col = self.layout.column(align=True)
        col.operator(AddDataToBrain.bl_idname, text="Add data to Brain", icon='FCURVE')
        col.prop(context.scene, 'brain_no_conds_stat', text="")
        col.operator(AddDataNoCondsToBrain.bl_idname, text="Add no conds data to Brain", icon='FCURVE')
        col.prop(context.scene, 'import_unknown', text="Import unknown")
        # if bpy.types.Scene.electrodes_imported and (not bpy.types.Scene.electrodes_data_exist):
        col.operator("ohad.electrodes_add_data", text="Add data to Electrodes", icon='FCURVE')
        if len(DataMakerPanel.evoked_files) > 0:
            layout.label(text='External MEG evoked files:')
            layout.prop(context.scene, 'meg_evoked_files', text="")
            layout.operator(AddOtherSubjectMEGEvokedResponse.bl_idname, text="Add MEG evoked response", icon='FCURVE')
            if len(DataMakerPanel.externals) > 0:
                layout.prop(context.scene, 'evoked_objects', text="")
                select_text = 'Deselect' if get_external_meg_evoked_selected() else 'Select'
                select_icon = 'BORDER_RECT' if select_text == 'Select' else 'PANEL_CLOSE'
                layout.operator(SelectExternalMEGEvoked.bl_idname, text=select_text, icon=select_icon)
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:33,代码来源:data_panel.py


示例8: invoke

 def invoke(self, context, event=None):
     input_file = op.join(mu.get_user_fol(), 'electrodes',
                          '{}.npz'.format(bpy.context.scene.electrodes_positions_files))
     import_electrodes(input_file, _addon().ELECTRODES_LAYER)
     bpy.types.Scene.electrodes_imported = True
     print('Electrodes importing is Finished ')
     return {"FINISHED"}
开发者ID:pelednoam,项目名称:mmvt,代码行数:7,代码来源:data_panel.py


示例9: plot_activity

def plot_activity(map_type, faces_verts, threshold, meg_sub_activity=None,
        plot_subcorticals=True, override_current_mat=True, clusters=False):
    current_root_path = mu.get_user_fol() # bpy.path.abspath(bpy.context.scene.conf_path)
    hemispheres = [hemi for hemi in HEMIS if not bpy.data.objects[hemi].hide]
    frame_str = str(bpy.context.scene.frame_current)

    # loop_indices = {}
    for hemi in hemispheres:
        if map_type == 'MEG':
            fname  = op.join(current_root_path, 'activity_map_' + hemi, 't' + frame_str + '.npy')
            if op.isfile(fname):
                f = np.load(fname)
            else:
                print("Can't load {}".format(fname))
                return False
        elif map_type == 'FMRI':
            # fname = op.join(current_root_path, 'fmri_{}{}.npy'.format('clusters_' if clusters else '', hemi))
            # f = np.load(fname)
            if clusters:
                f = [c for h, c in ColoringMakerPanel.fMRI_clusters.items() if h == hemi]
            else:
                f = ColoringMakerPanel.fMRI[hemi]
        cur_obj = bpy.data.objects[hemi]
        # loop_indices[hemi] =
        activity_map_obj_coloring(cur_obj, f, faces_verts[hemi], threshold, override_current_mat)

    if plot_subcorticals and not bpy.context.scene.objects_show_hide_sub_cortical:
        if map_type == 'MEG':
            if not bpy.data.objects['Subcortical_meg_activity_map'].hide:
                color_object_homogeneously(meg_sub_activity, '_meg_activity', threshold)
        if map_type == 'FMRI':
            fmri_subcortex_activity_color(threshold, override_current_mat)

    return True
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:34,代码来源:coloring_panel.py


示例10: fmri_files_update

def fmri_files_update(self, context):
    #todo: there are two frmi files list (the other one in fMRI panel)
    user_fol = mu.get_user_fol()
    # fmri_files = glob.glob(op.join(user_fol, 'fmri', '*_lh.npy'))
    for hemi in mu.HEMIS:
        fname = op.join(user_fol, 'fmri', 'fmri_{}_{}.npy'.format(bpy.context.scene.fmri_files, hemi))
        ColoringMakerPanel.fMRI[hemi] = np.load(fname)
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:7,代码来源:coloring_panel.py


示例11: init

def init(addon):
    user_fol = mu.get_user_fol()
    clusters_labels_files = glob.glob(op.join(user_fol, 'fmri', 'clusters_labels_*.pkl'))
    # old code was saving those files as npy instead of pkl
    clusters_labels_files.extend(glob.glob(op.join(user_fol, 'fmri', 'clusters_labels_*.npy')))
    # fmri_blobs = glob.glob(op.join(user_fol, 'fmri', 'blobs_*_rh.npy'))
    fMRI_clusters_files_exist = len(clusters_labels_files) > 0 # and len(fmri_blobs) > 0
    if not fMRI_clusters_files_exist:
        return None
    fMRIPanel.addon = addon
    fMRIPanel.lookup, fMRIPanel.clusters_labels = {}, {}
    fMRIPanel.cluster_labels = {}
    files_names = [mu.namebase(fname)[len('clusters_labels_'):] for fname in clusters_labels_files]
    clusters_labels_items = [(c, c, '', ind) for ind, c in enumerate(files_names)]
    bpy.types.Scene.fmri_clusters_labels_files = bpy.props.EnumProperty(
        items=clusters_labels_items, description="fMRI files", update=fmri_clusters_labels_files_update)
    bpy.context.scene.fmri_clusters_labels_files = files_names[0]
    for file_name, clusters_labels_file in zip(files_names, clusters_labels_files):
        fMRIPanel.clusters_labels[file_name] = np.load(clusters_labels_file)
        fMRIPanel.clusters_labels[file_name] = support_old_verions(fMRIPanel.clusters_labels[file_name])
        fMRIPanel.lookup[file_name] = create_lookup_table(fMRIPanel.clusters_labels[file_name])

    bpy.context.scene.fmri_cluster_val_threshold = 3
    bpy.context.scene.fmri_cluster_size_threshold = 50
    bpy.context.scene.search_closest_cluster_only_in_filtered = True
    bpy.context.scene.fmri_what_to_plot = 'blob'
    bpy.context.scene.fmri_how_to_sort = 'tval'

    update_clusters()
    # addon.clear_cortex()
    register()
    fMRIPanel.init = True
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:32,代码来源:fMRI_panel.py


示例12: load_meg_subcortical_activity

def load_meg_subcortical_activity():
    meg_sub_activity = None
    current_root_path = mu.get_user_fol() # bpy.path.abspath(bpy.context.scene.conf_path)
    subcortical_activity_file = op.join(current_root_path,'subcortical_meg_activity.npz')
    if op.isfile(subcortical_activity_file):
        meg_sub_activity = np.load(subcortical_activity_file)
    return meg_sub_activity
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:7,代码来源:coloring_panel.py


示例13: grab_camera

def grab_camera(self=None, do_save=True):
    RenderFigure.update_camera = False
    bpy.context.scene.X_rotation = X_rotation = math.degrees(bpy.data.objects['Camera'].rotation_euler.x)
    bpy.context.scene.Y_rotation = Y_rotation = math.degrees(bpy.data.objects['Camera'].rotation_euler.y)
    bpy.context.scene.Z_rotation = Z_rotation = math.degrees(bpy.data.objects['Camera'].rotation_euler.z)
    bpy.context.scene.X_location = X_location = bpy.data.objects['Camera'].location.x
    bpy.context.scene.Y_location = Y_location = bpy.data.objects['Camera'].location.y
    bpy.context.scene.Z_location = Z_location = bpy.data.objects['Camera'].location.z
    if do_save:
        if op.isdir(op.join(mu.get_user_fol(), 'camera')):
            camera_fname = op.join(mu.get_user_fol(), 'camera', 'camera.pkl')
            mu.save((X_rotation, Y_rotation, Z_rotation, X_location, Y_location, Z_location), camera_fname)
            print('Camera location was saved to {}'.format(camera_fname))
        else:
            mu.message(self, "Can't find the folder {}".format(mu.get_user_fol(), 'camera'))
    RenderFigure.update_camera = True
开发者ID:pelednoam,项目名称:mmvt,代码行数:16,代码来源:render_panel.py


示例14: invoke

 def invoke(self, context, event=None):
     closest_mesh_name, vertex_ind, vertex_co = self.find_vertex_index_and_mesh_closest_to_cursor()
     print(vertex_co)
     self.create_empty_in_vertex_location(vertex_co)
     data_path = mu.get_user_fol()
     self.keyframe_empty_test('Activity_in_vertex', closest_mesh_name, vertex_ind, data_path)
     return {"FINISHED"}
开发者ID:pelednoam,项目名称:mmvt,代码行数:7,代码来源:vertex_data_panel.py


示例15: combine_four_brain_perspectives

def combine_four_brain_perspectives():
    data_min, data_max = _addon().get_colorbar_max_min()
    background = bpy.context.scene.background_color
    figure_name = 'splitted_lateral_medial_{}_{}.png'.format(
        'inflated' if _addon().is_inflated() else 'pial', background)
    figure_fname = op.join(mu.get_user_fol(), 'figures', figure_name)
    colors_map = _addon().get_colormap_name().replace('-', '_')
    x_left_crop, x_right_crop, y_top_crop, y_buttom_crop = (300, 300, 0, 0)
    w_fac, h_fac = (1.5, 1)
    cmd = '{} -m src.utils.figures_utils '.format(bpy.context.scene.python_cmd) + \
        '-f combine_four_brain_perspectives,combine_brain_with_color_bar --fol {} --data_max {} --data_min {} '.format(
        op.join(mu.get_user_fol(), 'figures'), data_max, data_min) + \
        '--figure_fname {} --colors_map {} --x_left_crop {} --x_right_crop {} --y_top_crop {} --y_buttom_crop {} '.format(
        figure_fname, colors_map, x_left_crop, x_right_crop, y_top_crop, y_buttom_crop) + \
        '--w_fac {} --h_fac {} --facecolor {}'.format(w_fac, h_fac, background)
    mu.run_command_in_new_thread(cmd, False)
开发者ID:pelednoam,项目名称:mmvt,代码行数:16,代码来源:render_panel.py


示例16: invoke

 def invoke(self, context, event=None):
     root = mu.get_user_fol()
     if bpy.context.scene.fMRI_files_exist and bpy.context.scene.freeview_load_fMRI:
         sig_fnames = glob.glob(op.join(root, 'freeview', '*{}*.mgz'.format(bpy.context.scene.fmri_files))) + \
                      glob.glob(op.join(root, 'freeview', '*{}*.nii'.format(bpy.context.scene.fmri_files)))
         if len(sig_fnames) > 0:
             sig_fname = sig_fnames[0]
             sig_cmd = '-v "{}":colormap=heat:heatscale=2,3,6'.format(sig_fname) if op.isfile(sig_fname) else ''
         else:
             sig_cmd = ''
     else:
         sig_cmd = ''
     T1 = op.join(root, 'freeview', 'T1.mgz')  # sometimes 'orig.mgz' is better
     aseg = op.join(root, 'freeview', '{}+aseg.mgz'.format(bpy.context.scene.atlas))
     lut = op.join(root, 'freeview', '{}ColorLUT.txt'.format(bpy.context.scene.atlas))
     electrodes_cmd = self.get_electrodes_command(root)
     cmd = '{} {} "{}":opacity=0.3 "{}":opacity=0.05:colormap=lut:lut="{}"{}{}{}'.format(
         FreeviewPanel.addon_prefs.freeview_cmd, sig_cmd, T1, aseg, lut, electrodes_cmd,
         ' -verbose' if FreeviewPanel.addon_prefs.freeview_cmd_verbose else '',
         ' -stdin' if FreeviewPanel.addon_prefs.freeview_cmd_stdin else '')
     print(cmd)
     FreeviewPanel.freeview_in_queue, FreeviewPanel.freeview_out_queue = mu.run_command_in_new_thread(cmd)
     context.window_manager.modal_handler_add(self)
     self._updating = False
     self._timer = context.window_manager.event_timer_add(0.1, context.window)
     return {'RUNNING_MODAL'}
开发者ID:pelednoam,项目名称:mmvt,代码行数:26,代码来源:freeview_panel.py


示例17: import_brain

def import_brain(context=None):
    # self.brain_layer = DataMakerPanel.addon.BRAIN_EMPTY_LAYER
    # self.current_root_path = mu.get_user_fol()  # bpy.path.abspath(bpy.context.scene.conf_path)
    user_fol = mu.get_user_fol()
    print("importing ROIs")
    import_rois(user_fol)
    import_hemis_for_functional_maps(user_fol)
    import_subcorticals(op.join(user_fol, 'subcortical'))
    if context:
        last_obj = context.active_object.name
        print('last obj is -' + last_obj)

    if bpy.data.objects.get(' '):
        bpy.data.objects[' '].select = True
        if context:
            context.scene.objects.active = bpy.data.objects[' ']
    if context:
        bpy.data.objects[last_obj].select = False
    DataMakerPanel.addon.show_rois()
    bpy.types.Scene.brain_imported = True
    print('cleaning up')
    for obj in bpy.data.objects['Subcortical_structures'].children:
        # print(obj.name)
        if obj.name[-1] == '1':
            obj.name = obj.name[0:-4]
    print('Brain importing is Finished ')
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:26,代码来源:data_panel.py


示例18: draw

 def draw(self, context):
     layout = self.layout
     user_fol = mu.get_user_fol()
     aparc_name = bpy.context.scene.atlas
     faces_verts_exist = mu.hemi_files_exists(op.join(user_fol, 'faces_verts_{hemi}.npy'))
     fmri_files = glob.glob(op.join(user_fol, 'fmri', '*_lh.npy'))  # mu.hemi_files_exists(op.join(user_fol, 'fmri_{hemi}.npy'))
     # fmri_clusters_files_exist = mu.hemi_files_exists(op.join(user_fol, 'fmri', 'fmri_clusters_{hemi}.npy'))
     meg_files_exist = mu.hemi_files_exists(op.join(user_fol, 'activity_map_{hemi}', 't0.npy'))
     meg_labels_files_exist = op.isfile(op.join(user_fol, 'labels_vertices_{}.pkl'.format(aparc_name))) and \
         mu.hemi_files_exists(op.join(user_fol, 'meg_labels_coloring_{hemi}.npz'))
     electrodes_files_exist = op.isfile(op.join(mu.get_user_fol(), 'electrodes', 'electrodes_data_{}.npz'.format(
         'avg' if bpy.context.scene.selection_type == 'conds' else 'diff')))
     electrodes_stim_files_exist = len(glob.glob(op.join(
         mu.get_user_fol(), 'electrodes', 'stim_electrodes_*.npz'))) > 0
     electrodes_labels_files_exist = len(glob.glob(op.join(
         mu.get_user_fol(), 'electrodes', '*_labels_*.npz'))) > 0 and \
         len(glob.glob(op.join(mu.get_user_fol(), 'electrodes', '*_subcortical_*.npz'))) > 0
     manually_color_files_exist = len(glob.glob(op.join(user_fol, 'coloring', '*.csv'))) > 0
     manually_groups_file_exist = op.isfile(op.join(mu.get_parent_fol(user_fol),
         '{}_groups.csv'.format(bpy.context.scene.atlas)))
     volumetric_coloring_files_exist = len(glob.glob(op.join(user_fol, 'coloring', 'volumetric', '*.csv')))
     layout.prop(context.scene, 'coloring_threshold', text="Threshold")
     if faces_verts_exist:
         if meg_files_exist:
             layout.operator(ColorMeg.bl_idname, text="Plot MEG ", icon='POTATO')
         # if meg_labels_files_exist:
         #     layout.operator(ColorMegLabels.bl_idname, text="Plot MEG Labels ", icon='POTATO')
         if len(fmri_files) > 0:
             layout.prop(context.scene, "fmri_files", text="")
             layout.operator(ColorFmri.bl_idname, text="Plot fMRI ", icon='POTATO')
         if manually_color_files_exist:
             layout.prop(context.scene, "coloring_files", text="")
             layout.operator(ColorManually.bl_idname, text="Color Manually", icon='POTATO')
         if manually_groups_file_exist:
             layout.prop(context.scene, 'labels_groups', text="")
             layout.operator(ColorGroupsManually.bl_idname, text="Color Groups", icon='POTATO')
         if volumetric_coloring_files_exist:
             layout.prop(context.scene, "vol_coloring_files", text="")
             layout.operator(ColorVol.bl_idname, text="Color Volumes", icon='POTATO')
     if electrodes_files_exist:
         layout.operator(ColorElectrodes.bl_idname, text="Plot Electrodes", icon='POTATO')
     if electrodes_labels_files_exist:
         layout.prop(context.scene, "electrodes_sources_files", text="")
         layout.operator(ColorElectrodesLabels.bl_idname, text="Plot Electrodes Sources", icon='POTATO')
     if electrodes_stim_files_exist:
         layout.operator(ColorElectrodesStim.bl_idname, text="Plot Electrodes Stimulation", icon='POTATO')
     layout.operator(ClearColors.bl_idname, text="Clear", icon='PANEL_CLOSE')
开发者ID:ofek-schechner,项目名称:mmvt,代码行数:47,代码来源:coloring_panel.py


示例19: get_meg_labels_data

def get_meg_labels_data():
    meg_data, meg_colors = OrderedDict(), OrderedDict()
    for hemi in HEMIS:
        labels_data = np.load(os.path.join(mu.get_user_fol(), 'meg_labels_coloring_{}.npz'.format(hemi)))
        for label_data, label_colors, label_name in zip(labels_data['data'], labels_data['colors'], labels_data['names']):
            meg_data[label_name] = label_data
            meg_colors[label_name] = label_colors
    return meg_data, meg_colors
开发者ID:pelednoam,项目名称:mmvt,代码行数:8,代码来源:play_panel.py


示例20: render_lateral_medial_split_brain

def render_lateral_medial_split_brain(data_type='', quality=20, overwrite=True):
    image_name = ['lateral_lh', 'lateral_rh', 'medial_lh', 'medial_rh']
    camera = [op.join(mu.get_user_fol(), 'camera', 'camera_{}{}.pkl'.format(
        camera_name, '_inf' if _addon().is_inflated() else '')) for camera_name in image_name]
    image_name = ['{}{}_{}_{}'.format('{}_'.format(data_type) if data_type != '' else '', name, 'inflated_{}'.format(
        _addon().get_inflated_ratio()) if _addon().is_inflated() else 'pial', bpy.context.scene.background_color)
                  for name in image_name]
    render_image(image_name, quality=quality, camera_fname=camera, hide_subcorticals=True, overwrite=overwrite)
开发者ID:pelednoam,项目名称:mmvt,代码行数:8,代码来源:render_panel.py



注:本文中的mmvt_utils.get_user_fol函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python mn_execution.allowCompiling函数代码示例发布时间:2022-05-27
下一篇:
Python web.start函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap