Remove basename

This commit is contained in:
2024-08-01 15:14:32 -04:00
parent 363f18abfb
commit e012065641
2 changed files with 6 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ function varargout = EASYconsole(varargin)
fprintf('Using EASY script directory: %s from hardcoded default\n', easyDir);
end
whos
% Set projectScansDir intelligently
if ~isempty(getenv('PROJECT_SCANS_DIR'))
@@ -107,7 +108,7 @@ function varargout = EASYconsole(varargin)
end
% Get the name of the project
projectName=basename(projectScansDir);
[~, projectName]=fileparts(projectScansDir);
% Set the run-specific EASY output directory
if ~isempty(getenv('EASY_RESULTS_DIR'))
@@ -127,7 +128,7 @@ function varargout = EASYconsole(varargin)
if ~isempty(getenv('EASY_PROJECT_NAME'))
easyProjectName=getenv('EASY_PROJECT_NAME');
else
easyProjectName=basename(easyResultsDir);
[~, easyProjectName]=fileparts(easyResultsDir);
end
% User sanity check and warning
@@ -284,7 +285,7 @@ function NewExpDat_Callback(~, ~, ~)
[matfile,easyResultsDir]=uiputfile('.mat');
inputFileName=strrep(inputFile,'.mat','');
projectName=basename(easyResultsDir);
[~, projectName]=fileparts(easyResultsDir);
% Set paths
matDir=fullfile(easyResultsDir,'matResults');
matFile=fullfile(matDir, projectName, '.mat');
@@ -355,7 +356,7 @@ function LoadDatFile_Callback(~, ~, ~)
[matDir,matFile]=uigetfile('.mat','Open Experiment folder and data storage .mat file name','MultiSelect','off');
load(matFile);
easyResultsDir=fullfile(matDir,'..');
projectName=basename(easyResultsDir);
[~, projectName]=fileparts(easyResultsDir);
projectScansDir=fullfile(easyResultsDir, '..', '..', 'scans', projectName);
% TODO this is pretty hacky and needs something more explicit