118 lines
4.2 KiB
Matlab
118 lines
4.2 KiB
Matlab
%% ===== BEC-Droplets Settings =====
|
|
|
|
% Specify data location to run analysis on
|
|
dataSources = {
|
|
struct('sequence', 'StructuralPhaseTransition', ...
|
|
'date', '2025/08/13', ...
|
|
'runs', [62]) % specify run numbers as a string in "" or just as a numeric value
|
|
};
|
|
|
|
options = struct();
|
|
|
|
% File / paths
|
|
options.baseDataFolder = '//DyLabNAS/Data';
|
|
options.savefileName = 'BECToDroplets';
|
|
scriptFullPath = mfilename('fullpath');
|
|
options.saveDirectory = fileparts(scriptFullPath);
|
|
|
|
% Camera / imaging
|
|
options.cam = 5;
|
|
options.angle = 0;
|
|
options.center = [1420, 2050];
|
|
options.span = [200, 200];
|
|
options.fraction = [0.1, 0.1];
|
|
options.pixel_size = 5.86e-6; % in meters
|
|
options.magnification = 23.94;
|
|
options.removeFringes = false;
|
|
options.ImagingMode = 'HighIntensity';
|
|
options.PulseDuration = 5e-6; % in s
|
|
|
|
% Fourier analysis settings
|
|
options.theta_min = deg2rad(0);
|
|
options.theta_max = deg2rad(180);
|
|
options.N_radial_bins = 500;
|
|
options.Radial_Sigma = 2;
|
|
options.Radial_WindowSize = 5; % odd number
|
|
|
|
options.k_min = 1.2771; % μm⁻¹
|
|
options.k_max = 2.5541; % μm⁻¹
|
|
options.N_angular_bins = 180;
|
|
options.Angular_Threshold = 75;
|
|
options.Angular_Sigma = 2;
|
|
options.Angular_WindowSize = 5;
|
|
options.zoom_size = 50;
|
|
|
|
% Scan parameter
|
|
options.scan_parameter = 'rot_mag_field';
|
|
|
|
switch options.savefileName
|
|
case 'BECToDroplets'
|
|
options.scan_reference_values = [2.40, 2.39, 2.38, 2.37, 2.35, 2.34, 2.32, 2.30, 2.28, 2.26, 2.24, 2.22, 2.2, 2.15, 2.10, 2.05, 2, 1.95, 1.90, 1.85, 1.8];
|
|
options.titleString = 'BEC to Droplets';
|
|
case 'BECToStripes'
|
|
options.scan_reference_values = [2.45, 2.44, 2.43, 2.42, 2.4, 2.39, 2.38, 2.37, 2.36, 2.35, 2.34, 2.32, 2.3, 2.28, 2.25, 2.2, 2.15, 2.10, 2.0, 1.90, 1.8];
|
|
options.titleString = 'BEC to Stripes';
|
|
case 'DropletsToStripes'
|
|
options.scan_reference_values = [0, 5, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 35, 40];
|
|
options.titleString = 'Droplets to Stripes';
|
|
case 'StripesToDroplets'
|
|
options.scan_reference_values = fliplr([0, 5, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 35, 40]);
|
|
options.titleString = 'Stripes to Droplets';
|
|
end
|
|
|
|
% Flags
|
|
options.skipNormalization = false;
|
|
options.skipUnshuffling = false;
|
|
options.skipPreprocessing = true;
|
|
options.skipMasking = true;
|
|
options.skipIntensityThresholding = true;
|
|
options.skipBinarization = true;
|
|
options.skipMovieRender = true;
|
|
options.skipSaveFigures = true;
|
|
options.skipSaveOD = true;
|
|
options.skipLivePlot = false;
|
|
options.showProgressBar = true;
|
|
|
|
% Extras
|
|
options.font = 'Bahnschrift';
|
|
|
|
%% ===== Build Paths from Data Sources =====
|
|
|
|
allPaths = {}; % initialize
|
|
|
|
for i = 1:length(dataSources)
|
|
ds = dataSources{i};
|
|
|
|
% Split the date string into year/month/day
|
|
dateParts = strsplit(ds.date, '/');
|
|
|
|
for run = ds.runs
|
|
runStr = sprintf('%04d', run); % 4-digit run number
|
|
fullPath = fullfile(options.baseDataFolder, ds.sequence, dateParts{:}, runStr);
|
|
|
|
if isfolder(fullPath) % only include valid directories
|
|
allPaths{end+1} = fullPath;
|
|
else
|
|
warning('Path does not exist: %s', fullPath);
|
|
end
|
|
end
|
|
end
|
|
|
|
% Let user select a single path
|
|
set(0,'DefaultUicontrolFontSize',10); % increase default font size
|
|
[selectedIndex, tf] = listdlg('PromptString','Select a path to analyze:', ...
|
|
'SelectionMode','single', ...
|
|
'ListString', allPaths, ...
|
|
'ListSize',[400, 300]); % width x height in pixels
|
|
if tf
|
|
options.folderPath = allPaths{selectedIndex}; % ✅ store in options
|
|
fprintf('Path set to selection: %s\n', options.folderPath);
|
|
else
|
|
error('No path selected. Aborting.');
|
|
end
|
|
|
|
%% ===== Collect Images and Launch Viewer =====
|
|
|
|
[od_imgs, scan_parameter_values, file_list] = Helper.collectODImages(options);
|
|
|
|
Analyzer.runInteractiveODImageViewer(od_imgs, scan_parameter_values, file_list, options); |