Skip to content

Commit 8779cf5

Browse files
author
Usseglio-Viretta
committed
Ellipsoid generation GUI sligthly improved + scaling on
Ellipsoid generation: - cosmetic: added some text on the two last tabs. - fixed: scaling is now performed at the end of each generation if asked Documentation: - add explanation on how to keep the documentation link when packaging the app
1 parent e0a541e commit 8779cf5

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed
Binary file not shown.
Binary file not shown.

src/Main_menu/Main_menu.mlapp

55 Bytes
Binary file not shown.
Binary file not shown.

src/Microstructure_generation/microstructure_generation_ellipsoids_GUI.m

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
parameter_table_position_tab2 = [0.01 0.74 0.54 0.13];
235235
parameter_table_tab2 = uitable('Parent',tab_particlesize,'Units','normalized','Position',parameter_table_position_tab2,'Visible','off','Enable','off','CellEditCallBack',@parameters_callback);
236236

237-
Diameter_Dz_along_3rd_axis = uicontrol('Parent',tab_particlesize,'Style','text','String','Diameter Dx along 3rd axis','Units','normalized','Position',[0.01 0.55 0.25 0.15],'Visible','off');
237+
Diameter_Dz_along_3rd_axis = uicontrol('Parent',tab_particlesize,'Style','text','String','Diameter Dz along 3rd axis','Units','normalized','Position',[0.01 0.55 0.25 0.15],'Visible','off');
238238
Diameter_Dz_3rdaxis_table = uitable('Parent',tab_particlesize,'Units','normalized','Position',[0.01 0.53 0.25 0.15],'Visible','off','Enable','off','CellEditCallBack',@Dia_Dz_3rdaxis_table);
239239
Diameter_Dz_3rdaxis_table.RowName = [];
240240

@@ -465,6 +465,11 @@
465465
Post_processing_table.ColumnEditable = [false true];
466466

467467
%% Run Code tab 6
468+
Title_tab6 = uicontrol('Parent',tab_run,'Style','text','String','Numerical generation','FontName',font_name_GUI,'FontSize',font_size_large_GUI,...
469+
'BackgroundColor',background_description_tab,'ForegroundColor',ForegroundColor_description_tab,'Units','normalized','Position',[0,0.96,1,0.04]); % Heading
470+
471+
Display_run_text = uicontrol('Parent',tab_run,'Style','text','String','How many times do you want to generate the microstructure with the same parameters?','FontSize',font_size_medium_GUI,'FontName',font_name_GUI,'FontWeight','bold',...
472+
'HorizontalAlignment','left','Units','normalized','Position', [0.01 0.9 0.9 0.04]);
468473

469474
Num_of_run_text = uicontrol('Parent',tab_run,'Style','text','String','Number of Runs','FontSize',font_size_medium_GUI,'FontName',font_name_GUI,'Units','normalized','Position',[0.01,0.8,0.1,0.025],'Visible','on','Enable','on');
470475
Num_of_run_box = uicontrol('Parent',tab_run,'Style','edit','String',[],'FontSize',font_size_medium_GUI,'FontName',font_name_GUI,'Units','normalized','Position',[0.11,0.8,0.05,0.03],'Visible','on','Enable','on','CallBack',@callback_num_of_runs);
@@ -482,13 +487,18 @@
482487
'String','Error message','Visible','off');
483488

484489
%% Generate Microstructure tab 7
490+
Title_tab7 = uicontrol('Parent',tab_Generated_micro,'Style','text','String','Results','FontName',font_name_GUI,'FontSize',font_size_large_GUI,...
491+
'BackgroundColor',background_description_tab,'ForegroundColor',ForegroundColor_description_tab,'Units','normalized','Position',[0,0.96,1,0.04]); % Heading
492+
493+
Display_results_text = uicontrol('Parent',tab_Generated_micro,'Style','text','String','Table will be updated for each finished run','FontSize',font_size_medium_GUI,'FontName',font_name_GUI,'FontWeight','bold',...
494+
'HorizontalAlignment','left','Units','normalized','Position', [0.01 0.9 0.9 0.04]);
485495

486496
% Table 1
487-
ltable_direction = [0.3 0.5 0.35 0.15];
497+
ltable_direction = [0.1 0.25 0.8 0.65];
488498
table_output = uitable('Parent',tab_Generated_micro,'Units','normalized','Position',ltable_direction,'FontName',font_name_GUI,'FontSize',font_size_small_GUI,'CellEditCallBack',@edit_table_output,'Visible','off','Enable','off');
489499
table_output.ColumnName = {'Attempt','Volume fraction','Tortuosity factor','Elapsed time'};
490500
table_output.RowName = [];
491-
table_output.ColumnWidth = {ltable*0.15, ltable*0.2, ltable*0.2, ltable*0.15};
501+
table_output.ColumnWidth = {ltable*0.4, ltable*0.4, ltable*0.4, ltable*0.4};
492502
%% CALLBACK FUNCTIONS for Phase and Volume Fraction Calculation tab1
493503

494504
% Callback function for voxel size and scaling factor
@@ -1878,13 +1888,13 @@ function Generate_Micro_Struct(~,~)
18781888
function_save_tif( uint8(microstructure3D.phase),[str_filename '_phase.tif']);
18791889
function_save_tif( uint16(microstructure3D.particle_id),[str_filename '_particle.tif']);
18801890

1881-
% % Rescale
1882-
% parameters_scaling.scaling_factor = 1/(str2double(Edit_Scalingfactor.String)); % Get scaling factor
1883-
% parameters_scaling.label_or_greylevel = 'Label';
1884-
% parameters_scaling.background = 0;
1885-
% [Microstructure_resized] = uint8(function_scaling(uint8(microstructure3D.phase),parameters_scaling));
1886-
% str_filename = [Text_savefolder.String 'Volume_' num2str(k) '_phase_rescaled.tif'];
1887-
% function_save_tif(Microstructure_resized,str_filename);
1891+
% Rescale
1892+
parameters_scaling.scaling_factor = 1/(str2double(Edit_Scalingfactor.String)); % Get scaling factor
1893+
parameters_scaling.label_or_greylevel = 'Label';
1894+
parameters_scaling.background = 0;
1895+
[Microstructure_resized] = uint8(function_scaling(uint8(microstructure3D.phase),parameters_scaling));
1896+
str_filename = [Text_savefolder.String 'Volume_' num2str(k) '_phase_rescaled.tif'];
1897+
function_save_tif(Microstructure_resized,str_filename);
18881898
end
18891899

18901900

0 commit comments

Comments
 (0)