prompta = {'What is the number of frames ?'};
    dlg_titlea = 'Input crop';
    num_lines = 1;
    defa = {'200'};
    nbf = inputdlg(prompta,dlg_titlea,num_lines,defa);
    nb_frame=str2num(nbf{1});
    
promptb = {'What is the name of the position ?'};
    dlg_titleb = 'Input crop';
    num_lines = 1;
    defb = {'s1'};
    pos = inputdlg(promptb,dlg_titleb,num_lines,defb);
    pos_str=char(pos);
    
promptc = {'What is the name of the fluorescence filter ?'};
    dlg_titlec = 'Input crop';
    num_lines = 1;
    defc = {'gfp'};
    filt = inputdlg(promptc,dlg_titlec,num_lines,defc);
    filt_str=char(filt);    
    
    %% Look for the Frame mat file
message = sprintf('Select the mat file of the first image');
uiwait(msgbox(message));
[filename,pathname] = uigetfile('*.mat','Select the mat-file');
mkdir(pathname,'\norm_tiff');

    %% Import the .mat file in a matrix
for i=1:nb_frame
name=strcat(pathname,'frame',num2str(i),'.mat');
importfilevol(name);
im=imageFlat;

    %% Register as a .tiff in 8 bits
imwrite(im,strcat(pathname,'norm_tiff\',pos_str,'_',filt_str,'_norm_t',num2str(i),'.tif'))
end