Skip to content

Commit

Permalink
Zeffiro developer: A regular push adding the changes made in the curr…
Browse files Browse the repository at this point in the history
…ent local repository to the remote origin. Contents of the folders ./data/ and ./profile/ are ignored. The update necessitates creating a personal access token.
  • Loading branch information
sampsapursiainen committed Sep 29, 2024
1 parent 1e6f84b commit d877f7e
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 17 deletions.
3 changes: 3 additions & 0 deletions m/mesh/zef_process_meshes.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
reuna_p_inf = cell(0);
reuna_submesh_ind = cell(0);
reuna_type = cell(0);
reuna_mesh_ind = [];

compartment_tags = eval('zef.compartment_tags');
for k = 1 : length(compartment_tags)
Expand Down Expand Up @@ -55,6 +56,7 @@
reuna_type{i,4} = compartment_tags{k};
reuna_submesh_ind{i} = eval(var_11);
mean_vec = repmat(mean(reuna_p{i},1),size(reuna_p{i},1),1);
reuna_mesh_ind(i) = k;

for t_ind = 1 : length(eval(var_1))

Expand Down Expand Up @@ -330,6 +332,7 @@
zef.reuna_p_inf = reuna_p_inf;
zef.reuna_submesh_ind = reuna_submesh_ind;
zef.reuna_type = reuna_type;
zef.reuna_mesh_ind = reuna_mesh_ind;

if nargout == 0
assignin('base','zef',zef);
Expand Down
10 changes: 5 additions & 5 deletions m/zef_choose_domain_labels.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

submesh_vec = cell2mat(zef.reuna_submesh_ind);
n_subcompartments = length(submesh_vec);
n_compartments = length(zef.compartment_tags);
n_compartments = length(zef.reuna_mesh_ind);
subcompartment_labeling_priority_vec = zeros(n_subcompartments,1);
compartment_labeling_priority_vec = zeros(n_compartments,1);
compartment_labeling_priority_vec = zeros(length(zef.reuna_mesh_ind),1);

priority_vec = flipud([1:n_subcompartments]');
priority_vec_compartments = flipud([1:n_compartments]');
Expand All @@ -25,12 +25,12 @@

for i = 1 : length(zef.reuna_p)

compartment_labeling_priority_vec(i) = zef.([zef.compartment_tags{i} '_labeling_priority']);
compartment_labeling_priority_vec(i) = zef.([zef.compartment_tags{zef.reuna_mesh_ind(i)} '_labeling_priority']);

for j = 1 : length(zef.reuna_submesh_ind{i})

counter_ind = counter_ind + 1;
subcompartment_labeling_priority_vec(counter_ind) = zef.([zef.compartment_tags{i} '_labeling_priority']);
subcompartment_labeling_priority_vec(counter_ind) = zef.([zef.compartment_tags{zef.reuna_mesh_ind(i)} '_labeling_priority']);

end
end
Expand All @@ -53,7 +53,7 @@
labeling_priority_vec_aux = subcompartment_labeling_priority_vec(label_array);
for i = 1 : ordinal_index-1
[priority_val priority_ind] = min(labeling_priority_vec_aux,[],2);
labelin_priority_vec_aux(ind_vec_aux + (priority_ind-1)*n_labels) = NaN;
labeling_priority_vec_aux(ind_vec_aux + (priority_ind-1)*n_labels) = NaN;
end
[priority_val priority_ind] = min(labeling_priority_vec_aux,[],2);
priority_ind = sub2ind(size(label_array),[1:size(label_array,1)]',priority_ind);
Expand Down
1 change: 1 addition & 0 deletions m/zef_fix_sensors_get_functions_array_size.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
end
zef.([zef.current_sensors '_get_functions_aux']) = cell(1,n_sensors);
zef.([zef.current_sensors '_get_functions_aux_ind']) = setdiff([1:size(zef.([zef.current_sensors '_get_functions']),2)],find(cellfun(@isempty, zef.([zef.current_sensors '_get_functions']))));
zef.([zef.current_sensors '_get_functions_aux'])(zef.([zef.current_sensors '_get_functions_aux_ind'])) = zef.([zef.current_sensors '_get_functions'])(zef.([zef.current_sensors '_get_functions_aux_ind']));
zef.([zef.current_sensors '_get_functions']) = zef.([zef.current_sensors '_get_functions_aux']);

zef = rmfield(zef,[zef.current_sensors '_get_functions_aux']);
Expand Down
1 change: 1 addition & 0 deletions m/zef_init.m
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@
zef_data.distance_smoothing_on = 1;
zef_data.smoothing_steps_dist = 0.9;
zef_data.reuna_submesh_ind = cell(0);
zef_data.reuna_mesh_ind = [];

zef.fieldnames = fieldnames(zef_data);

Expand Down
2 changes: 1 addition & 1 deletion m/zef_open_forward_and_inverse_options.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

zef.h_menu_move_one_step_up_in_labeling_priority.MenuSelectedFcn = 'zef = zef_update_labeling_priority(zef,''one step up'');';
zef.h_menu_move_one_step_down_in_labeling_priority.MenuSelectedFcn = 'zef = zef_update_labeling_priority(zef,''one step down'');';
zef.h_menu_move_to_bottom_in_labeling_priority.MenuSelectedFcn = 'zef = zef_update_labeling_priority(zef,''top'');';
zef.h_menu_move_to_top_in_labeling_priority.MenuSelectedFcn = 'zef = zef_update_labeling_priority(zef,''top'');';
zef.h_menu_move_to_bottom_in_labeling_priority.MenuSelectedFcn = 'zef = zef_update_labeling_priority(zef,''bottom'');';

zef.h_refinement_volume_on.Value = zef.refinement_volume_on;
Expand Down
27 changes: 17 additions & 10 deletions m/zef_update_labeling_priority.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,39 @@
use_settings = 1;
end

n_compartments = length(zef.reuna_mesh_ind);

if use_settings

item_selected = zef.h_labeling_priority_order.Value;
[~,~,labeling_priority_vec] = zef_choose_domain_labels(zef,[],1);
labeling_priority_vec = labeling_priority_vec(:)';
[~, labeling_priority_vec] = sort(labeling_priority_vec);

labeling_priority_vec = (labeling_priority_vec(:)');

if isequal(update_type,'one step up')
if item_selected > 1
labeling_priority_vec = [labeling_priority_vec(1:item_selected-2) labeling_priority_vec(item_selected) labeling_priority_vec(item_selected-1) labeling_priority_vec(item_selected+1:end)];
end
elseif isequal(update_type,'one step down')
if item_selected < length(labeling_priority_vec)
if item_selected < length(labeling_priority_vec)
labeling_priority_vec = [labeling_priority_vec(1:item_selected-1) labeling_priority_vec(item_selected+1) labeling_priority_vec(item_selected) labeling_priority_vec(item_selected+2:end)];
end
elseif isequal(update_type,'top')
labeling_priority_vec = [labeling_priority_vec(item_selected) labeling_priority_vec(1:item_selected-1) labeling_priority_vec(1:item_selected+1)];
end
elseif isequal(update_type,'top')
labeling_priority_vec = [labeling_priority_vec(item_selected) labeling_priority_vec(1:item_selected-1) labeling_priority_vec(item_selected+1:end)];
elseif isequal(update_type,'bottom')
labeling_priority_vec = [labeling_priority_vec(1:item_selected-1) labeling_priority_vec(1:item_selected+1) labeling_priority_vec(item_selected)];
labeling_priority_vec = [labeling_priority_vec(1:item_selected-1) labeling_priority_vec(item_selected+1:end) labeling_priority_vec(item_selected)];
end

end

items = cell(length(zef.compartment_tags),1);
for i = 1 : length(zef.compartment_tags)
zef.([zef.compartment_tags{labeling_priority_vec(i)} '_labeling_priority']) = i;
items{i} = zef.([zef.compartment_tags{labeling_priority_vec(i)} '_name']);
%labeling_priority_vec_1 = fliplr(labeling_priority_vec);
%labeling_priority_vec = labeling_priority_vec_2(labeling_priority_vec_1);

items = cell(n_compartments,1);
for i = 1 : n_compartments
zef.([zef.compartment_tags{zef.reuna_mesh_ind(labeling_priority_vec(i))} '_labeling_priority']) = i;
items{i} = zef.([zef.compartment_tags{zef.reuna_mesh_ind(labeling_priority_vec(i))} '_name']);
end

if use_settings
Expand Down
2 changes: 1 addition & 1 deletion plugins/StripTool/zef_strip_tool_plot.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function zef_strip_tool_plot(zef)
for i = 1 : strip_struct.strip_n_contacts

[contacts, ~, triangle_ind_aux] = zef_get_strip_contacts(i,strip_struct,zef);
h_strip_contact = trimesh(contacts(:,2:4),points{1}(:,1),points{1}(:,2),points{1}(:,3));
h_strip_contact = trimesh(contacts(:,1:3),points{1}(:,1),points{1}(:,2),points{1}(:,3));
h_strip_contact.FaceColor = [0 0 0];
h_strip_contact.EdgeColor = 'none';
h_strip_contact.Tag = 'additional: strip contact';
Expand Down

0 comments on commit d877f7e

Please sign in to comment.