sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
1cc2a0bcca4193c8f59f73316742c4d92e5e1f6e79449635446271db99ffb232 | MATLAB | 345 | 9 | function zef_set_color
color_vec = uisetcolor;
item_ind = evalin('base','zef.h_compartment_color.Value');
item_ind = length(evalin('base','zef.compartment_tags')) - item_ind + 1;
compartment_tag = evalin('base',['zef.compartment_tags{' num2str(item_ind) '}']);
evalin('base',['zef.' compartment_tag '_color = [' num2str... |
8733ffb56290148e44c107e1ee5b752bfdbee33826dc10ef505ed42dcf202d59 | MATLAB | 345 | 13 |
zef.aux_data_1 = cell(0);
zef.aux_data_2 = evalin('base',['zef.' zef.current_tag '_transform_name']);
for zef_i = 1 : length(zef.aux_data_2)
zef.aux_data_1{zef_i,1} = zef_i;
zef.aux_data_1{zef_i,2} = zef.aux_data_2{zef_i};
end
zef.h_transform_table.Data = zef.aux_data_1;
zef = rmfield(zef,{'aux_data_1','aux... |
0099dfcf464fb3a230240ac39ecefda9139150606a2a9b00cf9965d737de7e86 | MATLAB | 346 | 13 | % myobj = SetRunName( myobj, 'name' )
%
% Set the run name for the next time files are created
% (either by SetTrgEnable() or by StartRun()).
%
function [s] = SetRunName( s, name )
if( ~ischar( name ) )
error( 'Argument to SetRunName must be a string.' );
end
DoSimpleCmd( s, sprintf( 'SETR... |
496e4a5d5a6f953eb151f4eed8aa112ffddac2ac95d9a8e7ff4f123d843e48b6 | MATLAB | 346 | 16 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
function [c_1] = zef_import_asc(c_0,varargin)
c_1 = str2num(c_0);
n_varargin = length(varargin);
if n_varargin == 2
n_1 = varargin{1};
n_2 = varargin{2};
c_1 = c_1(:,n_1:n_2);
else
c_... |
4bf3d9877bb3b75d5ab5c048e53979f1ba197e627c89ce577d1e9824a04314bd | MATLAB | 346 | 6 | [zef.file zef.file_path] = uigetfile({'*.mat'},'Import interpolation',zef.save_file_path);
if not(isequal(zef.file,0));
[zef.eit_sensitivity_tool_data_2] = load([zef.file_path zef.file]);
zef.eit_sensitivity_tool_file_2 = [zef.file_path zef.file];
set(zef.h_eit_sensitivity_tool_file_2, 'Value', zef.eit_sens... |
bfb1adc57d7ad9e6d99299efcd2d0ea7d06d761b7e57609d58bfaffab6a3882d | MATLAB | 347 | 15 | function zef_toggle_edges
h = get(gcf,'Children');
h = findobj(h,'Tag','axes1');
h = get(h,'Children');
for i = 1 : length(h);
if find(ismember(properties(h(i)),'EdgeColor'));
if isequal(h(i).EdgeColor,[1 1 1])
set(h(i),'edgecolor','none');
else
set(h(i),'edgecolor',[1 1 1])... |
ca6647bb81b41a911ddc244befbef40e4438648ebc109d1b4bc01c1775ce6a71 | MATLAB | 347 | 13 | %create multiframe array
% need MxNx1xK array from MxNxK array
function myMFarr = stack2MFarray( stack )
tic
height = size( stack, 1);
width = size( stack, 2);
frames = size(stack, 3);
myMFarr = zeros(height, width, 1, frames, 'uint8');
for f = 1:frames
myMFarr(:,:,1,f) = stack(:,:,f);
end
disp(append('stack2MFarra... |
be856237058f9c0f06c9089f6c46228a3c1c077ee3b0211e907fd9a606a3fc1b | MATLAB | 348 | 5 | zef.plugin_cell = zef.h_plugin_settings_table.Data;
writecell(zef.plugin_cell,[zef.program_path '/profile/' zef.profile_name '/zeffiro_plugins.ini'],'FileType','text');
for zef_i = 1 : size(zef.h_plugin_settings_table.Data,1)
evalin('base',['zef.' zef.h_plugin_settings_table.Data{zef_i,3} '= zef.h_plugin_settings_t... |
fe755a5761e5c28634ed3f7990ca2c7452cc26b280773fbb5072d16da77d56a1 | MATLAB | 348 | 11 | function [avg_net,net_avg_all] = average_nets(nets) ;
nets_avg = cellfun(@(C) mean(C,3),nets,'UniformOutput',false) ;
for j = 1:size(nets,2)
nets_j = nets_avg(:,j) ;
nets_j = cell2mat(permute(nets_j,[3,2,1])) ;
avg_net{j} = nanmean(nets_j,3) ;
end
% get avg network
net_avg_all = nanmean(cell2mat(perm... |
e69512dc5a8d78d5c8785a4f3d8fc082f98a2a68daa3cc7c5d32bbdeca4a4414 | MATLAB | 350 | 10 | % dstSample = MapSample( myobj, dstStream, srcSample, srcStream )
%
% Returns sample in dst stream corresponding to
% given sample in src stream.
%
function [ret] = MapSample( s, dstStream, srcSample, srcStream )
ret = str2double( DoQueryCmd( s, sprintf( 'MAPSAMPLE %d %ld %d', ...
dstStream, sr... |
b7359a4bd7f493bbf1a2b47661254f23c3ab879f4a8e5a4d9252d14852a0939c | MATLAB | 351 | 15 | function zef = zef_apply_parameter_profile(zef)
if nargin == 0
zef = evalin('base','zef');
end
zef.parameter_profile = eval('readcell([zef.program_path ''/profile/'' zef.profile_name ''/zeffiro_parameters.ini''],''FileType'',''text'',''delimiter'','','');');
zef_init_parameter_profile;
if nargout == 0
assig... |
c16042f548c148c8c372041799d0dcff3f0462d9af013ec8031fbeec34c8e86a | MATLAB | 353 | 8 | function volume_val = zef_find_enclosed_volume(nodes, triangles)
c_t = (1/3)*(nodes(triangles(:,1),:) + nodes(triangles(:,2),:) + nodes(triangles(:,3),:));
n_t = cross(nodes(triangles(:,3),:)'-nodes(triangles(:,1),:)', nodes(triangles(:,2),:)'-nodes(triangles(:,1),:)');
ala = sqrt(sum(n_t.^2))/2;
volume_val = abs((1/3... |
6d421b7f6a58cca1870e3c33835ac46834bb535eea96f71d372697e1080a5cd0 | MATLAB | 354 | 8 | function zef_parameter_profile_table_selection(hObject,eventdata,handles)
parameter_profile_selected = eventdata.Indices(:,1);
parameter_profile_selected = unique(parameter_profile_selected);
parameter_profile_selected = parameter_profile_selected(:)';
evalin('base',['zef.parameter_profile_selected =[' num2str(paramet... |
a7d006013e86b7c8dc13b2dd8da46c53e67856e8dbe66b875665cc11911471da | MATLAB | 354 | 15 |
function [reconstruction,reconstruction_information] = zef_reconstructionTool_import
[importName, importPath]=uigetfile('./', 'select reconstruction file', '*.mat');
reconstruction_information=[];
reconstruction=[];
load(strcat(importPath, importName));
if isempty(reconstruction_information)
reconstruction_inf... |
b104858b8eeeb8d645ae7dc94c22eb3a56df804c7587e94dd79b877ead49381b | MATLAB | 354 | 8 | function tilavuus_vec = zef_eit_sensitivity_tool_volume
nodes = evalin('base','zef.nodes');
tetrahedra = evalin('base','zef.tetra');
tilavuus = zef_tetra_volume(nodes, tetrahedra, true);
tilavuus = tilavuus(:);
tilavuus_vec = accumarray(evalin('base','zef.eit_ind'),tilavuus(evalin('base','zef.brain_ind')),[size(evali... |
faea1c366b289362a2cb40d4811b8b406466b377a7426a1d1040748624318f69 | MATLAB | 359 | 14 | function set_gui_range_limits(app)
num_udf = app.params.num_udf;
app.StimulusEM.Limits = [1 num_udf];
app.StimulusEditField.Limits = [1 num_udf];
app.StimulusEV.Limits=[1 num_udf];
app.Stimulus_PCN.Limits=[1 num_udf];
num_neurons = app.params.num_neurons;
app.HighlightedNode.Limits = [0 num_neurons];
app.HighlightedE... |
cb63a8b1e985e4182605fb9a2f0055e2cb298a4970c4f5fd1514f537f70eded0 | MATLAB | 360 | 8 |
for zef_LeadFieldProcessingTool_TableUpdate_index2=1:size(zef.LeadFieldProcessingTool.app.BankTable.Data,1)
zef.LeadFieldProcessingTool.bank{zef_LeadFieldProcessingTool_TableUpdate_index2}.lf_tag=zef.LeadFieldProcessingTool.app.BankTable.Data{zef_LeadFieldProcessingTool_TableUpdate_index2,1};
end
clear zef_Lead... |
eb5ecf3b277a60cd257abdd772fcf78033873af0be92987ec90e699e55559594 | MATLAB | 360 | 17 | function [U, L, mu] = doPCA(matX)
% Principal component analysis
% Input:
% matX: m x n data matrix
% Output:
% U: m x m Projection matrix
% L: m x 1 Eigen values
% mu: m x 1 mean
[m,n] = size(matX);
mu = mean(matX,2);
Xo = bsxfun(@minus,matX,mu);
S = Xo*Xo'/n;
[U,L] = eig(S);
[L,idx] = sort(diag(L),'descend'... |
b8af9812e5bbc20b9d774191b112b864fac018d16b2d82c8bca23f8e28336e19 | MATLAB | 361 | 15 | function zef = zef_dataBank_update(zef)
if nargin == 0
zef = evalin('base','zef')
end
zef.dataBank.var_starttime = zef.dataBank.app.StarttimeSpinner.Value;
zef.dataBank.var_endtime = zef.dataBank.app.EndtimeSpinner.Value;
zef.dataBank.var_sampling_frequency = zef.dataBank.app.SfreqSpinner.Value;
if nargout == 0
... |
1626e7eea649202575cefb3ce6e510985b4225db75a91ecde4b1193f23cd3cc6 | MATLAB | 362 | 14 | function y = blur2d(x,sigma)
% compare to imgaussfilt()
% we provide this in case the image processing toolbox is absent
[W,H] = size(x);
ix = -W/2:(W/2-1);
iy = -H/2:(H/2-1);
kx = exp(-(ix/sigma).^2);
ky = exp(-(iy/sigma).^2);
k = ky'*kx;
k = k./sum(k,"all");
k = fftshift(k);
... |
df23af579629ffb2c9e4e4f99f9a0950b13f4d9881a7a970b5dadc0c4a2138df | MATLAB | 362 | 9 | function manually_threshold_ensembles_button_pushed(app)
ensemble_id = app.StimulusEditField.Value;
update_log(app, 'Manually Comparing Ensemble');
[ensemble_nodes] = manually_compare_ensembles(app.node_performance, app.ThresholdEditField.Value, ensemble_id);
app.ensemble_nodes{ensemble_id}=ensemble_nodes;
update_log(... |
6328d9e8f57f09fceaaadeafe8297e190809d2792aaba576d189f8bfef8d9b35 | MATLAB | 366 | 9 | function validate_data_button_pushed(app)
update_log(app, 'Validating Data');
wrapped_startup(app);
wrapped_validator(app);
app.NewModelEditField.Value = app.params.name;
plot_parameter_space_structural_learning(app);
plot_parameter_space_parameter_estimation(app);
... |
862d5f9b8bbd08058af7732a625dda72babca452273946cea76e3d58ec8eb559 | MATLAB | 366 | 17 | function COV = eeg2cov(Signal,window,overlap,method_cov)
if nargin < 4
method_cov = 'scm';
end
[Ne Nt] = size(Signal);
Step = window-overlap;
index = 1:Step:Nt-window-1;
I = length(index);
COV = zeros(Ne,Ne,I);
for i=1:I
COV(:,:,i) = covariances(Signal(:,... |
ee58a885ea7bcebe8784ac51df829997b2769bf50e0568df37c8619fc6d193ba | MATLAB | 366 | 12 | function [file_name] = zef_bst_get_settings_file_name(h_parent)
if nargin < 1
h_parent = get(gcbo,'Parent');
end
folder_name = get(h_parent,'folder_name');
settings_file_name = get(h_parent,'settings_file_name');
settings_subfolder_name = get(h_parent,'settings_subfolder_name');
file_name = fullfile(folder_name, sett... |
b70aada4f7fd02d1aaf7d437a9f4b70d38b0700702ebc2d40c8ab7c2186af246 | MATLAB | 367 | 14 | % tuto3_sinus_generator_Uninitialize.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 25 May 2012
%
% The function tuto3_sinus_generator_Uninitialize is called when pressing 'stop' in the scenario.
%
function box_out = tuto3_sinus_generator_Uninitialize(box_in)
disp('Uninitializing ... |
e119dc739381c3a1af62cd564e5c3bf70f9ea95ee3292ca8368a9ba7f0ef243e | MATLAB | 367 | 17 | function C = FPCov(X)
%Fixed Point covariance matrix estimation
N = size(X,1);
M = size(X,2);
C = NormalizedSCM(X);
critere = 1 ;
Max_iter = 50;
iter = 0;
while ((critere)>10^-3)&&(iter<Max_iter)
iter = iter +1;
C_precedant = C;
X2 = X./sqrt(repmat(diag(X*inv(C_precedant)*X'),1,M));
C = (M/N)*(X2')*X2;... |
0e7163d74dddd6c2a14c1d6eff1d11ec92bc3d935a89eaaa26d1f3d094c90347 | MATLAB | 369 | 13 | [zef.yesno] = questdlg('Substitute raw data with measurement data?','Yes','No');
if isequal(zef.yesno,'Yes');
if zef.filter_data_segment > 0
if not(iscell(zef.measurements))
zef.measurements = cell(0);
end
zef.raw_data = zef.measurements{zef.filter_data_segment};
else
... |
5c4b28590d96fbb592f0a58ec8fb35779075d8a3fb3c9aaeaf29c52aadd3723f | MATLAB | 369 | 14 | function zef = zef_dataBank_set_reconstructions(zef,rec_cell,frame_number)
data_tree = zef.dataBank.tree;
rec_ind = 1;
fn = fieldnames(data_tree);
for k=1:numel(fn)
if (strcmp(zef.dataBank.tree.(fn{k}).type, 'reconstruction'))
zef.dataBank.tree.(fn{k}).data.reconstruction{frame_number} = rec_cell{rec_ind}... |
9b3f012aa17eaec6f852011b2e36ba09d7611efdfe0d32f73aa8dc7e4eefa995 | MATLAB | 369 | 17 | classdef LeadFieldTest < matlab.unittest.TestCase
%
% LeadFieldTest
%
% A test class for lead field computations. The methods inside the Test
% methods block of this class specify tests that are run when the run
% method provided by the superclass is invoked.
%
methods (Test)
... |
d1eaaa5e9e545b552104a60f0f56a6d0f5c14ebe2b7048f7a00636a1c4205782 | MATLAB | 369 | 20 | function [app] = pat_map()
basepath = pwd; %current folder
% Add source functions
addpath(genpath(strcat(basepath,'/src')));
% example datasets
addpath(genpath(strcat(basepath,'/example_datasets')));
% test suite
addpath(genpath(strcat(basepath,'/tests')));
% Add experiments
addpath(strcat(basepath, '/experiments... |
b54cbf6b8ea1e0f62350d4e2551ced506e2145487fd1fa7e0e49903034be5f10 | MATLAB | 371 | 13 | % tuto1_signal_filter_Uninitialize.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 25 May 2012
%
% The function tuto1_signal_filter_Uninitialize is called when pressing 'stop' in the scenario.
%
function box_out = tuto1_signal_filter_Uninitialize(box_in)
disp('Matlab uninitialize funct... |
fa14d31b87ae479380be476bbe15ff1af1736972b890c590f3576c8c44684410 | MATLAB | 371 | 5 | examples.studies.decision_making.zef_parameters_focal_epilepsy;
[z_inverse_results, z_inverse_info] = zef_dataBank_get_reconstructions(zef,frame_number);
examples.studies.decision_making.zef_cluster_reconstructions_focal_epilepsy;
examples.studies.decision_making.zef_final_reconstruction_focal_epilepsy;
examples.studie... |
0bed56406e2d2542e0aee042546e25740add01d86fb5a2c55871f910389f2068 | MATLAB | 372 | 11 | warning('off');
zef.lead_field_type = 3;
zef.imaging_method = 3;
zef_delete_original_field;
zef_process_meshes;
zef_lead_field_matrix;
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_filter_quantile);
if zef.source_interpolation_... |
1518b07d41d6e418755303ea64eccc21505c45956b44ccb97ec92bf004e2d422 | MATLAB | 372 | 11 | warning('off');
zef.lead_field_type = 8;
zef.imaging_method = 3;
zef_delete_original_field;
zef_process_meshes;
zef_lead_field_matrix;
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_filter_quantile);
if zef.source_interpolation_... |
87180adc9e89de74b0eaab7d5820e39904063fdee5ac974d99b4d93993eeb204 | MATLAB | 373 | 13 | function obj = preprocess_demean(obj,polynomialord) ;
% Re-reference data to average
if isempty(obj.modality)
return
end
if nargin<2 || isempty(polynomialord)
polynomialord=1 ;
end
obj.data = detrend(obj.data,polynomialord) ;
obj = microstate.functions.process_append(obj,'Det... |
cda88b3a4d69a6f3a1fc8b06ec422d923dfbeb4dc13ca643b230303a09e1a773 | MATLAB | 373 | 11 | function evaluate_node_performance_button_pushed(app)
update_log(app, 'Evaluating Node Performance..');
app.node_performance = calculate_node_performance(app.params, app.log_likelihood_by_frame, app.best_model, app.params.include_testing_in_identify);
update_log(app, 'Finished Evaluating Node Performance');
app... |
efb30d7759dd8f5cec237e8b8c45839b6417c50188b7b513013f838a224eb86c | MATLAB | 373 | 14 | function y = logisticfit(beta,x)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
%define parameters
if length(beta) < 1, L=1; else L = beta(1);end %asymptote
if length(beta) < 2, k=1; else k = beta(2);end %slope
if length(beta) < 3, x0=0; else x0 = beta(3);end %x-offset
%calc... |
f2125f6a362fc01d20dddb76c8b5ddd43953a0945f4ca72e001fffdb6976a438 | MATLAB | 374 | 13 | % myobj = SetDigOut( myobj, bool_flag, channels )
%
% Set digital output on/off. Channel strings have form:
% 'Dev6/port0/line2,Dev6/port0/line5'.
%
function [s] = SetDigOut( s, b, channels )
if( ~isnumeric( b ) )
error( 'SetDigOut arg 2 should be a Boolean value {0,1}.' );
end
DoSimpleCmd... |
1da33dbdfc90e6a342736d85a47a2cbf059e8d257ceffcf606a8c0b1da638b59 | MATLAB | 375 | 16 | function vecY = getBimodalGauss(vecX,vecP)
%getBimodalGauss Fits bimodal gauss
%Syntax: vecY = getBimodalGauss(vecX,vecP)
% [mu1,sigma1,peak1,mu2,sigma2,peak2] = vecP(1:6);
%params
mu1 = vecP(1);
sigma1 = vecP(2);
peak1 = vecP(3);
mu2 = vecP(4);
sigma2 = vecP(5);
peak2 = vecP(6);
vecY = normpdf(vecX,mu... |
3e4324526d6d2e4b590a7edcf85247f4ae4f716b1d082d8585e60b58471aa12b | MATLAB | 375 | 12 | function nA = normArray(A,bounds)
A=single(A);
sz=size(A);
%minA = min(A(bounds/2:sz(1)-bounds/2,bounds/2:sz(2)-bounds/2),[],"all");
%maxA = max(A(bounds/2:sz(1)-bounds/2,bounds/2:sz(2)-bounds/2),[],"all");
P = prctile( ...
A(round(bounds/2):round(sz(1)-bounds/2), ...
round(bounds/2):round(sz(2)-bounds/2)), ...... |
7b90573f190f04a801eb879d160e06e233b58afe501995e4bf89e53aa186d016 | MATLAB | 376 | 16 | function C = geodesic(C1,C2,t,metric)
if (nargin<4)||(isempty(metric))
metric = 'euclid';
end
switch metric
case 'riemann'
C = riemann_geodesic(C1,C2,t);
case 'logeuclid'
C = logeuclidean_geodesic(C1,C2,t);
case 'opttransp'
C = mintransp_geodesic(C1,C2,t);
otherwise %eucli... |
6ec898f62d8390c3a3b16200e5754146abb49812d742131f904d7837fbc9ff3d | MATLAB | 377 | 14 | function dblR2 = getRidgeWrapper(dblLambda)
%getRidgeWrapper Wrapper for doRidge_CV
% dblR2 = getRidgeWrapper(dblLambda)
%% get globals
global gMatX;
global gMatY;
global gIntFolds;
[vecR2_Ridge_CV, sRidge] = doRidge_CV(gMatX, gMatY, gIntFolds, dblLambda);
dblR2 = -mean(vecR2_Ridge_CV); %negative to mini... |
7608bd3a02d0c5f6b784f827711d78927bc9d3f15eec4e98142f3e8d5d0e28e7 | MATLAB | 377 | 23 | function h_surf = zef_plot_sphere(position,radius,color)
h_axes = gca;
hold_state = ishold(h_axes);
if not(hold_state)
hold on;
end
[X,Y,Z] = sphere;
X = X*radius;
Y = Y*radius;
Z = Z*radius;
h_surf = surf(h_axes,X+position(1),Y+position(2),Z+position(3));
set(h_surf,'edgecolor','none','facecolor',color,'facea... |
8988a73d2055d08a589d62de802c1a8b327bf13122e0ebaf9ca394fa4a5b31cc | MATLAB | 378 | 12 | function x = zef_l2_l1_optimizer(L, y, reg_param, options)
H = [ L'*L zeros(size(L,2), size(L,2)) ; zeros(size(L,2), 2*size(L,2)) ];
f = [ - L'*y ; reg_param ];
A = [ eye(size(L,2)) -eye(size(L,2)); -eye(size(L,2)) eye(size(L,2)); zeros(size(L,2)) -eye(size(L,2))];
b = [ zeros(3*size(L,2),1) ];
x = quadprog(H, f, A,... |
6d0c59563ade854fa79b7641ba0c49a36c1f803b23240ce9a48485ffe8c791a7 | MATLAB | 379 | 14 | % openvibe toolbox for Matlab
% OV_getStimulationOutputHeader.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 28/07/2011
% Set the header information on a signal output.
% MEANT TO BE USED IN USER SCRIPT
function OV_getStimulationOutputHeader(box_in, output_index)
%This funct... |
f904bca14db5c29a009054eac3422169ff6f4559968a355b2d9ffc506e4b97ee | MATLAB | 379 | 16 | function vecY = getBimodalGaussCF(vecP,vecX)
%getBimodalGauss Fits bimodal gauss
%Syntax: vecY = getBimodalGaussCF(vecP,vecX)
% [mu1,sigma1,peak1,mu2,sigma2,peak2] = vecP(1:6);
%params
mu1 = vecP(1);
sigma1 = vecP(2);
peak1 = vecP(3);
mu2 = vecP(4);
sigma2 = vecP(5);
peak2 = vecP(6);
vecY = normpdf(vec... |
497e7962280d28df69ac9e94fcfd9506dcfbd550e6aee0770997b9d98acbc976 | MATLAB | 380 | 8 | function GroupMaps = makeGroupMaps ;
% This function makes group-level ground truth microstate maps in
% example3_script
Z = zeros(5,1) ; F = @(x) sign(randn)*(0.5+0.5*rand)*normpdf([2;1;0;1;2]) ;
GroupMaps = [F() , Z , Z , F() ; Z , F() , Z , Z ; Z , Z , F() , Z ;
Z , Z , Z , F()]... |
c7510473f6c5379a1839f9a5d4bc5546995bfcaea3e261292c3c3acc210d080c | MATLAB | 380 | 11 | function [outdata]=bsliang_rmoutlier3sd_rawsham(indata)
% indata is a list
c=3;
%% ÒÔc¸ö±ê×¼²îΪãÐÖµÅųýÖµ
maxindex=indata>=(mean(indata,'omitnan')+c*std(indata,'omitnan'));
minindex=indata<=(mean(indata,'omitnan')-c*std(indata,'omitnan'));
outindex=logical(maxindex+minindex);
indata(o... |
f997fc0c10050e5b13e30faa296b304df3b373bc3d3abad6e2d14cbe3cb64f0d | MATLAB | 380 | 14 | % openvibe toolbox for Matlab
% OV_getStimulationOutputHeader.m
% -------------------------------
% Author : Laurent Bonnet (INRIA)
% Date : 28/07/2011
% Set the header information on a signal output.
% MEANT TO BE USED IN USER SCRIPT
function OV_getStimulationsOutputHeader(box_in, output_index)
%This func... |
3cc264c1a78183d86848e055f73c84f8a8a4cba2fe0d69a9f602728d0a6837c8 | MATLAB | 382 | 16 | function [data_stim] = Extract_StimData(data, descriptor)
data_stim = [];
for i = 1:length(data)
data_i = data{i};
if isfield(data_i, 'Stimuli') && isfield(data_i.Stimuli, 'short_description') && strcmp(data_i.Stimuli.short_description, descriptor)
data_stim = [data_stim {data_i}];
end
end
if isem... |
712bc4c5639addccb16f5f9828e2642b5304eb19a1b8a6e7cfbc37fffd0fb55d | MATLAB | 383 | 16 | function [size1, size2] = zef_size(data, field)
%gives the size of the field in the data. If data is a matObject, it is
%given without loading the data. If data is just a struct, it just gives
%the size
%Works only with 2 dimensions!
if isobject(data)
sizeOfField=size(data, field);
else
sizeOfField=size(data.(... |
2176a0092066e6c87295f91b37d9f402a972302f6d55429d2dea2de7482f35d6 | MATLAB | 386 | 13 | function [version, released] = manopt_version()
% Returns the version of the Manopt package you are running, as a vector.
%
% function [version, released] = manopt_version()
%
% version(1) is the primary version number.
% released is the date this version was released, in the same format as the
% date() function in Mat... |
cc1cb8d02c27b7b8dc851e293facd30afec089031ecd0c5308146df2e9b15457 | MATLAB | 386 | 12 | % chanCounts = GetAcqChanCounts( myobj, streamID )
%
% Returns a vector containing the counts of 16-bit
% words of each class being acquired.
%
% streamID = -1: NI channels: {MN,MA,XA,DW}.
% streamID >= 0: IM channels: {AP,LF,SY}.
%
function [ret] = GetAcqChanCounts( s, streamID )
ret = str2num( D... |
933990b2bbc99377148832b0e1eefe2bff407f4b87a74e5df17e1d78df4c0d5b | MATLAB | 387 | 23 | function weight = EstepWeight(log_lh,post,weight)
log_lh = sum(post.*log_lh,2);
options = optimset('Display','off');
alpha = fminbnd(@(s) target_fun(s,weight,log_lh),0,4,options);
%disp(num2str(alpha))
weight = weight.^alpha;
weight = weight/sum(weight);
end
%%
function val = target_fun(s,weight,p)
weight = weight... |
c215e194bf11d128867e0c013c9451b992388a1b8a1f2b3bac252012f0079f46 | MATLAB | 387 | 8 | function HistEffect=bsliang_historyeffect(resp_var)
% Áé¸ÐÀ´Ô´ÓÚZhong et al., 2019. Nat. Neurosci., fig. 6c£¬
% ¼ÆËãÒ»¸ötrialµÄ·¶³ëÅжÏÊÜǰһ¸ötrialµÄÓ°ÏìµÄ³Ì¶È
resp_pre=resp_var(1:end-1);
resp_post=resp_var(2:end);
sameind=resp_pre==resp_post;
diffind=resp_pre~=resp_post;
HistEffect=(sum(sameind)-sum(diffind))/... |
64fdb3d1fcfa6e9337a73b1e615f8395c1205c0522158abcd697bdb105cbf38d | MATLAB | 388 | 18 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
zef.lf_item_selected = get(zef.h_lf_item_list,'value');
for zef_i = 1:length(zef.lf_bank_storage)
if ismember(zef_i,zef.lf_item_selected)
zef.lf_bank_storage{zef_i}.measurements = zef.m... |
717ea0e1cdda7acd8b935900fe6d93bbcb9c834b53367c2fb404216351ece6d2 | MATLAB | 388 | 17 | function [valueVector,yVector,xVector] = mat2ind(matrix)
[rowNum,columnNum] = size(matrix);
indexMax = rowNum * columnNum;
valueVector = zeros(1,indexMax);
yVector = zeros(1,indexMax);
xVector = zeros(1,indexMax);
index = 0;
for x=1:columnNum
for y=1:rowNum
index = index + 1;
yVector(index) = y;
xVe... |
a6c687950c42d61e67fbb6b5ea65fdd77b0f31eea91b3288436c1042eb27a1ac | MATLAB | 388 | 11 | warning('off');
zef.lead_field_type = 7;
zef.imaging_method = 2;
zef.source_ind = [];
zef = zef_process_meshes(zef);
zef = zef_lead_field_matrix(zef);
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_filter_quantile);
if zef.sourc... |
ed2e1ef61b5964dcc5a31492451aaf3ea71e6805aa3f74ebcd9916e2b8dd6401 | MATLAB | 388 | 11 | warning('off');
zef.lead_field_type = 2;
zef.imaging_method = 2;
zef.source_ind = [];
zef = zef_process_meshes(zef);
zef = zef_lead_field_matrix(zef);
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_filter_quantile);
if zef.sourc... |
09a0f36542192f1b758b36934b142084a73a65cf559fe234bb43b26733fa7779 | MATLAB | 390 | 9 | if isequal(zef.lock_on,0)
zef.h_compartment_table.ColumnEditable(2) = logical(1);
zef.h_menu_lock_on.Text = 'Toggle ''On'' unlocked';
zef.h_menu_lock_on.ForegroundColor = [0 0 0];
elseif isequal(zef.lock_on,1)
zef.h_compartment_table.ColumnEditable(2) = logical(0);
zef.h_menu_lock_on.Text = 'Toggle ... |
3406b826da13f654283097ea0ddec9a857834ab926e43c8b19b594ad887625d2 | MATLAB | 390 | 12 | function output = isint(input)
% ISINT True for variables that are integers (non-fractional).
% ISINT(A) returns true for every element of A that is an integer and false
% otherwise.
%
% Example:
% isint( [0 1i -2 2.2 inf nan])
% returns [1 0 1 0 0 0]
output = isnumeric(input) & (re... |
d38cb1cb1c904f42be6fcef65d90290ca69cb146222c3777b31671181f7851e4 | MATLAB | 391 | 17 |
%--------------------------------------------------------------------------------
% sig.m
%
% Copyright (C) 2024 Takuya Isomura
% (RIKEN Center for Brain Science)
%
% 2024-10-28
%--------------------------------------------------------------------------------
function y = sig(x)
y = 1./(1+exp(-x));
end
%----------... |
f083115df7b903a9da8bc9610cdd1f9030cba3d4ec3221f80c796fbe0fbbf2dc | MATLAB | 391 | 12 | %Copyright © 2018- Sampsa Pursiainen & ZI Development Team
%See: https://github.com/sampsapursiainen/zeffiro_interface
if zef.cp_on
zef.enable_str = 'on';
else
zef.enable_str = 'off';
end;
set(zef.h_edit_cp_a, 'enable', zef.enable_str);
set(zef.h_edit_cp_b, 'enable', zef.enable_str);
set(zef.h_edit_cp_c, 'enab... |
6b32af1aefeb87ba9fe38c45ffa6a78173c228c4d82b1bb612f067f647125ee7 | MATLAB | 393 | 25 | zef = zef_dataBank_delete_uitree(zef)
if nargin == 0
zef = evalin('base','zef')
end
if size(zef.dataBank.app.Tree.SelectedNodes,1)>1
for dbk=1:size(zef.dataBank.app.Tree.SelectedNodes,1)
zef.dataBank.app.Tree.SelectedNodes(dbk).delete;
end
else
zef.dataBank.app.Tree.SelectedNodes.delete;
e... |
68ac7ac781dd652438dc76c6ebb5ec6a93096e1933fc9c4f89308927e716ee13 | MATLAB | 394 | 18 | function[multiclass_results] = perform_multiclass_decoding(params, best_model)
multiclass_results = struct();
%% FULL
full_results = struct();
dataset = [params.x_train;params.x_valid;params.x_test];
indicator_vector = find_labels(dataset, params.num_udf);
prediction = make_predictions(dataset, params.num_udf, best_m... |
74c00b640394de9502b52a52d28c3ccfca89844a86b4c60d7154bf0cd5235204 | MATLAB | 395 | 12 | function [x fname] = loadPic2(picNum) % Load picture
picSearchString = sprintf('p%04d*.m', picNum);
picMFile = dir(picSearchString);
if (~isempty(picMFile))
eval( strcat('x = ',picMFile.name(1:length(picMFile.name)-2),';') );
fname = picMFile.name(1:length(picMFile.name)-2);
else
error = sprintf('Picture f... |
e3d66083988fa8be784d6e8eaa80f493ac2c226e0dd91a285ef0a9b5a3902d84 | MATLAB | 397 | 14 | function plot_roi_dots(app)
%grab and format
rois = app.rois;
numROIs = size(rois,1);
C = jet(numROIs);
S = ones(1,numROIs)*10;
%plots
scatter3(app.roi_preview, rois(:,1),rois(:,2),rois(:,3),S,C, 'MarkerFaceColor','flat','MarkerFaceAlpha',0.5,'MarkerEdgeAlpha', 0.75, 'Marker','o');
%axis(app.roi_preview,'tight');
app... |
0a2295ce197dc67a8e25c29ee76a38f63d99a2ed3cc6094a6af283ae673b3f68 | MATLAB | 399 | 9 | function compare_to_random_ensembles_button_pushed(app)
update_log(app, 'Now Comparing to Random Ensembles');
[app.random_ensemble_performance, app.ensemble_nodes] = compare_random_ensembles(app.params, app.node_performance, app.best_model);
plot_node_performance_distribution(app);
update_log(app, 'Finished Comparing... |
3ac7960096140da11f917d5ed70a9d7e5736a395b283b993a23bb5c41d01bf06 | MATLAB | 399 | 16 | function [ensemble_nodes] = manually_compare_ensembles(node_performance, threshold, ensemble_id)
%EN NODE BECAUSE ONLY ONE ENSEMBLE
%grab
[num_node,num_stim] = size(node_performance);
auc = cell2mat(node_performance);
ii = ensemble_id;
%preallocate
ensemble_nodes = [];
%fill
ensemble_nodes = find(auc(:,ii)>threshold... |
a2815b06642ebb06ce55f95175c8f41f8f8399ae43730d2ee69a38c690ed7b9f | MATLAB | 399 | 19 | function C = lowmem_xcorr(X,maxlag)
T = size(X,1); ndim = size(X,2);
Y = embeddata(X,T,-maxlag:maxlag);
CY = corr(Y);
L = 2*maxlag+1;
I = false(L); for j = 1:L, I(j,L+1-j) = true; end
C = zeros(ndim,ndim,L);
for n1 = 1:ndim
ind1 = (1:L) + (n1-1)*L;
for n2 = 1:ndim
ind2 = (1:L) + (n2-1)*L;
cy =... |
e07ce2d662af325389ae2115abb93700ae382369e1c5695555e1d95580a9c8a2 | MATLAB | 400 | 20 | function zef_ES_plot_data(varargin)
if nargin == 0
zef = evalin('base','zef');
else
zef = varargin{1};
end
switch zef.ES_plot_type
case 1
zef_ES_plot_current_pattern(zef);
case 2
zef_ES_plot_barplot(zef);
case 3
zef_ES_plot_error_chart(zef);
case 4
zef_ES_optimiz... |
6fb3fbce7649f44391f27d618ce387d4c26a2d5d92cf62047a4b04e7b1fbb218 | MATLAB | 402 | 15 | function plot_ensemble_eval_coordinates(app)
if app.roi_style == 0
plot_ensemble_eval_coordinates_style_0(app);
elseif app.roi_style == 1
plot_ensemble_eval_coordinates_style_1(app);
elseif app.roi_style == 2
plot_ensemble_eval_coordinates_style_2(app);
plot_ensemble_graph_structure_style_2(app);
els... |
ceecb07227021fb35137e17fbe446587b1ff8f2c174539ab0cb24fa0d55762c7 | MATLAB | 403 | 10 | %Copyright © 2021- Sampsa Pursiainen & GPU-ToRRe-3D Development Team
%See: https://github.com/sampsapursiainen/GPU-Torre-3D
function [u_data_mat, f_data_mat] = load_jacobian_data(path_data, data_name, torre_dir)
load([torre_dir '/' data_name '/point_' int2str(path_data(1)) '_data.mat'], 'u_data_mat');
load([torre_di... |
18f196409ddc1cdf63c8c0d0f95d03334802bf83ba61da953dfa75de166cb31e | MATLAB | 404 | 8 | function [colormap_vec] = zef_blue_brain_2_colormap(colortune_param, colormap_size)
colormap_vec = [(colormap_size/5)^3 + (colormap_size)^2*[1 : colormap_size] ; (colormap_size/2)^3 + ((colormap_size)/2)*[1:colormap_size].^2 ; ...
(0.7*colormap_size)^3+(0.5*colormap_size)^2*[1:colormap_size]];
colormap_vec = color... |
51c21c348cc35e35e783e82474bbd93d31d44f2f01c6e60ae60d510a8203afdf | MATLAB | 405 | 11 | function vecVar = xvar(matInput,intDim)
%xstd Fast variance calculation. Speed-up is approximately 50% of
%original computation time. Syntax:
% vecVar = xvar(matInput,intDim)
%
% By Dr. Jorrit S. Montijn, 29-11-16 (dd-mm-yy; Universite de Geneve)
intP = size(matInput,intDim);
vecVar = sum(bsxfun(@minus,matIn... |
64ff41361f020a50e6d161d1087cdb726cff275b3bca4b7a9b18293725b66cd4 | MATLAB | 405 | 23 | function I = randpermNK(N,K)
% N is the number of trials/subjects
% K is the number of groups
if K==1,
I = cell(1);
I{1} = randperm(N);
return;
end
np=(N-mod(N,K))/K; % number of elements per group
[~,idx]=sort(rand(N,1));
i=1;
j=1;
I={};
while 1
I{j}=idx(i:i+np-1,1);
if N-(i+np)+1 < np
... |
66c9a9b64a32040123bbd867da31c48830ec41cd7036bb8b01c635732e612c2d | MATLAB | 406 | 21 | function zef = zef_create_finite_element_mesh(zef)
if nargin == 0
zef = evalin('base','zef');
end
if zef.downsample_surfaces == 1
zef = zef_downsample_surfaces(zef);
end
zef = zef_process_meshes(zef);
zef = zef_create_fem_mesh(zef);
zef = zef_postprocess_fem_mesh(zef);
zef.n_sources_mod = 1;
zef.source_ind =... |
81513faffa997d6ed34d8c9bc4ea3b16f853595b7ad421bfcedd34a08e5d4a78 | MATLAB | 406 | 13 | function [vecZ,dblMu,dblSigma] = xzscore(vecX,intDim)
%xzscore Fast zscore calculation.
%time. Syntax:
% [z,mu,sigma] = xzscore(vecX,intDim)
%
% By Dr. Jorrit S. Montijn, 26-11-18 (dd-mm-yy; Netherlands Institute for Neuroscience)
% Compute X's mean and sd, and standardize it
dblMu = xmean(vecX,intDim);
dblSi... |
5383b19bc263a893ed936c2b55b24c166c104f035ad36b81d3cb0914ba0ecb13 | MATLAB | 408 | 13 | function [z] = zef_normalizeInverseReconstruction(z)
%zef_normalizeInverseReconstruction normalized the postProcessed inverse
%output z for the later plotting
aux_norm_vec = 0;
for f_ind = 1 : length(z)
aux_norm_vec = max(sqrt(sum(reshape(z{f_ind}, 3, length(z{f_ind})/3).^2)),aux_norm_vec);
end
... |
a04e91e26d3f3104281ef7f8a797fe1bf55fa48f36d356c8a9d01c1e5122b72c | MATLAB | 408 | 17 |
%--------------------------------------------------------------------------------
% logit.m
%
% Copyright (C) 2024 Takuya Isomura
% (RIKEN Center for Brain Science)
%
% 2024-10-28
%--------------------------------------------------------------------------------
function y = logit(x)
y = log((x+10^-4)./(1-x+10^-4));
... |
f6dda85acaf43e1593e813f4172121fa9a30bce7e304845966b2bbe46c9db416 | MATLAB | 408 | 15 | function vecCoM = calcCenterOfMass(matData,intDim)
%calcCenterOfMass Gives center of mass for 2D images/matrices
% vecCoM = calcCenterOfMass(matData)
[mat1,mat2] = ndgrid(1:size(matData,1),1:size(matData,2));
dblSum=sum(matData(:));
vecCoM = zeros(1,2);
vecCoM(1) = sum(sum(matData.*mat1))/dblSum;
vecCoM(2) =... |
f6f0f4c26210039a98f7eaabf10c2ff6c53a9ab0efdf979aa04450a2cf5bc84c | MATLAB | 408 | 7 |
zef.reconstructionTool.bankReconstruction = zef.reconstructionTool.bankReconstruction(~cell2mat( zef.reconstructionTool.bankInfo(:,7)), :);
zef.reconstructionTool.bankInfo=zef.reconstructionTool.bankInfo(~cell2mat( zef.reconstructionTool.bankInfo(:,7)),:);
zef.reconstructionTool.bankSize=size(zef.reconstructionTool.b... |
ba55536ec0334600e9491b4cdc6e948b9b0af221333203902b5564dc223a85fb | MATLAB | 409 | 13 | function [d] = zef_distance_to_resection(points, mesh_points, mesh_triangles)
if nargin == 2
[~, d]=knnsearch(mesh_points, points);
else
d=nan(size(points,1),1);
inside_index=zef_tetra_in_compartment(mesh_points, mesh_triangles, points);
not_inside=setdiff(1:size(points, 1), inside_index);
d(inside... |
bfd6dd46925915885cf17592442d2a39eb440768e42c2c31fa5bf5eb99f8ab1e | MATLAB | 409 | 15 | function set_common_plot_settings_white(app_plot)
% sets settings common to gui plots
app_plot.Title.FontName = 'Arial';
app_plot.Title.FontSize = 12;
app_plot.TitleFontWeight='bold';
app_plot.TitleFontSizeMultiplier=1;
app_plot.LabelFontSizeMultiplier=1;
app_plot.FontName='Arial';
app_plot.FontSize=12;
disableDefault... |
eb83792c44dee022e97a28b1c21a59cf33792bb6937633d38fa2c50e983345e6 | MATLAB | 409 | 10 | function zef = zef_parcellation_roi_add(zef)
zef.parcellation_roi_selected = 1;
zef.parcellation_roi_center = [0 0 0; zef.parcellation_roi_center];
zef.parcellation_roi_radius = [10 zef.parcellation_roi_radius];
zef.parcellation_roi_color = [0.56078 0.91373 1; zef.parcellation_roi_color];
zef.parcellation_roi_name = [... |
45c07a341fa326a45e91c1ff52a74696c56d5b515f4b3ab96b02fcc8144ef98c | MATLAB | 410 | 15 | function update_log(app, new_text)
%% Documentation Contents
% Darik O'Neil Updated 1-11-2022
% Logging Updater
%% Function Contents
new_text = add_timestamp(new_text);
app.LogTextArea.Value = [{new_text}; app.LogTextArea.Value];
drawnow;
%app.log_line = app.log_line + 1;
%app.log = [s... |
29bee9f967271d86e3246fbabcafb5e19adec902ad5212fbcb5ebd26ab4de20d | MATLAB | 411 | 17 | % Pnm : the m first zeros of the n-bessel (Jn) functions
% Seyed Ebrahim Chalangar, Sharif University of Technology, Tehran, Iran
function Pnm=besselzero(n,m)
B=@(X)besselj(n,X);
x0=1;
Pnm(1:m)=0;
Pnmn(1:m)=0;
for t=1:m
while Pnm(t)<0.001
Pnm(t) = fzero(B,x0);
while (Pnmn(t)-Pnm(t))<0.001
... |
32aa2033e86e44387b4d7ee2970d04fd7b428153230fbd6ba7c5f60b5600c3c9 | MATLAB | 411 | 16 | function strip_struct = zef_get_strip_parameters(strip_struct)
if isequal(strip_struct.strip_model,1)
strip_struct.strip_radius = 0.635;
strip_struct.strip_n_contacts = 4;
elseif isequal(strip_struct.strip_model,2)
strip_struct.strip_radius = 0.635;
strip_struct.strip_n_contacts = 8;
elseif isequal(strip_struct.strip_... |
3cb28a651797ef2940dc14588ac9ade55b1e32727c0856a754e38983b009969b | MATLAB | 412 | 21 | function dblError = gnmerrfunc(vecLinCoeffs)
%gnmerrfunc Wrapper for fminsearch()
% dblError = gnmerrfunc(vecLinCoeffs);
%
%Error is scalar, and calculated as sum of squares
%% get globals
global gMatX;
global gVecY;
matX = gMatX;
vecY = gVecY;
%% get predicted values
vecPredY = gnmlinfunc(vecLinCoeffs... |
daabe4d9fd78056a4cc97061a226a7216949b79c87caf24944a9233a652f5101 | MATLAB | 412 | 14 | [zef.yesno] = questdlg('Substitute measurement data with processed data?','Yes','No');
if isequal(zef.yesno,'Yes');
zef_filter_raw_data;
if zef.filter_data_segment > 0
if not(iscell(zef.measurements))
zef.measurements = cell(0);
end
zef.measurements{zef.filter_data_segment} ... |
2ba18b3a4a6a27efe09c428fde5fd0faadaad2230caf6bb557666873a3a426b7 | MATLAB | 413 | 14 |
fh=gcf;
set(fh,'color','w','paperpositionmode','auto');
lns= findobj(gca,'type','line');
set (lns,'linewidth', 2);
xs= findobj(gco,'type','axes');
set (gca,'linewidth', 2,'FontSize', 14,'FontName', 'Arial','box','off')
txt=findall(gca,'type','text');
set (txt,'FontSize',16,'FontName', 'Arial');
set(gca,'TickDir','ou... |
232f914b91a75618ec62576973c3ca7290907c07ac2c1e0a927016fa6a205231 | MATLAB | 414 | 16 | function [tree] = zef_dataBank_saveTreeNodes(tree, folder)
%changes the data in the nodes of the tree from
% struct to matFileObject by saving to folder
dbFieldNames=fieldnames(tree);
for i=1:length(dbFieldNames)
nodeData=tree.(dbFieldNames{i}).data;
folderName=strcat(folder, dbFieldNames{i});
save(folde... |
9eeafe83233bd11af2b72ef3562da1e01b0a1858584e8b3b44b4b9bebe3ea975 | MATLAB | 416 | 12 | warning('off');
zef.lead_field_type = 9;
zef.imaging_method = 1;
zef_delete_original_field;
zef_process_meshes;
zef_attach_sensors_volume(zef,zef.sensors);
zef_lead_field_matrix;
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_fi... |
fdb3239ea1291727865d0a737170813d21dd43a861092a50aa9c072fac4e98c4 | MATLAB | 416 | 12 | warning('off');
zef.lead_field_type = 4;
zef.imaging_method = 1;
zef_delete_original_field;
zef_process_meshes;
zef_attach_sensors_volume(zef,zef.sensors);
zef_lead_field_matrix;
[zef.L,zef.source_positions,zef.source_directions] = zef_lead_field_filter(zef.L,zef.source_positions,zef.source_directions,zef.lead_field_fi... |
18e8e6b8cd8ec8b9163793f2fda658550962b8818a34d64e9962db491fd2c700 | MATLAB | 418 | 11 | function vecSD = xstd(matInput,intDim)
%xstd Fast standard deviation calculation. Speed-up is approximately
%50% of original computation time. Syntax:
% vecSD = xstd(matInput,intDim)
%
% By Dr. Jorrit S. Montijn, 29-11-16 (dd-mm-yy; Universite de Geneve)
intP = size(matInput,intDim);
vecSD = sqrt(sum(bsxfun(... |
bfda00f99d93c20ff7408d9262109180d23eaaa004112f5c2ebbb3962bd8f4f1 | MATLAB | 418 | 14 | function zef_bst_settings_file
h_parent = get(gcbo,'Parent');
h_text_1 = findobj(h_parent.Children,'Tag','settings_file');
folder_name = get(h_parent,'folder_name');
settings_subfolder_name = get(h_parent,'settings_subfolder_name');
[file_name] = uigetfile('*.m','Select settings file', fullfile(folder_name,settings_... |
861d5cbbfd7acde0b864ec7713ab0edcfe58a3c41d0a94c02b662ecf7413aeb8 | MATLAB | 419 | 11 | function vecYhat = gnmval(cellCoeffs,matXwithBias,cellFunctions)
%gnmval Calculates predicted values vecYhat given fitted model coefficients
% vecYhat = gnmval(cellCoeffs,matXwithBias,cellFunctions);
%% run
%transform cell to linear coeffs
[vecLinCoeffs,vecLinCoeffFunctions] = gnmcell2lin(cellCoeffs);
%get pr... |
f54506c52917f570330d08a94489ca3f347b562b0926195bd71ef72db9468713 | MATLAB | 422 | 13 | function [smoothed_traces] = smooth_traces(traces, gradient_threshold)
num_samples = size(traces, 1);
num_neurons = size(traces, 2);
smoothed_traces = zeros(num_samples, num_neurons);
for neuron = 1:num_neurons
threshold = range(traces(:, neuron))*(gradient_threshold/100);
smoothed_traces(:, neuron) = imdiff... |
1634c35417518074945fe307db6e3936d5a9a7e411fef909701139907c7f5946 | MATLAB | 423 | 9 | function zef = zef_parcellation_roi_pick_center(zef)
if isempty(findobj(allchild(zef.h_axes1),'Type','DataTip'))~=1
zef.h_datatip = findobj(allchild(zef.h_axes1),'Type','DataTip');
zef.parcellation_roi_center(zef.parcellation_roi_selected,:) = [h_datatip(1).X h_datatip(1).Y h_datatip(1).Z];
zef.h_parcellat... |
273ee8ef39537c5f7e3f87e94af72c1402ef307ec4a9294b2b2e691fc14c160a | MATLAB | 424 | 13 | zef = zef_process_meshes(zef,zef.explode_everything);
zef.on_screen = 2;
zef_update_fig_details;zef_plot_meshes([]);
zef.stop_movie = 0;
zef.frame_start=str2double(zef.h_frame_start.Value);
zef.frame_stop=str2double(zef.h_frame_stop.Value);
set(zef.h_stop_movie,'value',zef.stop_movie);
set(zef.h_stop_movie,'foregroun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.