initial_frame = imread(fullfile(directory, '0001.tif')); % Load a frame before settings
stretcher = stretchlim(initial_frame); % Calculation of the limits
minintens = stretcher(1);
maxintens = stretcher(2);
% Setting of the constrast strech in the commandline (in the section of preprocessing settings)