Reorganize EASY module
This commit is contained in:
@@ -273,7 +273,7 @@ function NewExpDat_Callback(~, ~, ~)
|
|||||||
questdlg('\fontsize{20} NAME the file and NAVIGATE to the directory with the image folders.','File Creation','OK', struct('Default','OK','Interpreter','tex'));
|
questdlg('\fontsize{20} NAME the file and NAVIGATE to the directory with the image folders.','File Creation','OK', struct('Default','OK','Interpreter','tex'));
|
||||||
[inputFile,inputPath]=uiputfile('.mat');
|
[inputFile,inputPath]=uiputfile('.mat');
|
||||||
inputFileName=strrep(inputFile,'.mat','');
|
inputFileName=strrep(inputFile,'.mat','');
|
||||||
easyResultsDirName=strcat('Results_',todayStr,'_',userName,'_',inputFileName);
|
% easyResultsDirName=strcat('Results_',todayStr,'_',userName,'_',inputFileName);
|
||||||
|
|
||||||
% Set paths
|
% Set paths
|
||||||
scansDir=fullfile(inputPath);
|
scansDir=fullfile(inputPath);
|
||||||
|
|||||||
@@ -588,43 +588,42 @@ easy() {
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
declare -gx EASY_DIR="$APPS_DIR/matlab/easy"
|
declare -gx EASY_DIR="$APPS_DIR/matlab/easy"
|
||||||
|
declare -gx EASY_RESULTS_DIR="$EASY_OUT_DIR/$PROJECT_PREFIX"
|
||||||
script="$EASY_DIR/EASYconsole.m"
|
script="$EASY_DIR/EASYconsole.m"
|
||||||
|
|
||||||
# Copy templates
|
# Prompt user for suffix
|
||||||
|
echo "Default EASY results directory: $EASY_RESULTS_DIR"
|
||||||
# Add EASY directory to the Matlab path
|
read -r -p "Enter a custom suffix and/or hit enter to use the default (no suffix): " EASY_SUFFIX
|
||||||
# If this does not work we can try changing the -sd argument and if that fails then pushing/popping
|
[[ -n $EASY_SUFFIX ]] && EASY_RESULTS_DIR+="_$EASY_SUFFIX"
|
||||||
debug "Adding EASY directory to the Matlab path"
|
|
||||||
hash matlab &>/dev/null &&
|
# Backup and create EASY results dirs
|
||||||
matlab -nodisplay -nosplash -nodesktop -nojvm -batch "addpath('$EASY_DIR')"
|
[[ -d $EASY_RESULTS_DIR ]] && backup "$EASY_RESULTS_DIR"
|
||||||
|
[[ -d $EASY_RESULTS_DIR ]] || mkdir -p "$EASY_RESULTS_DIR"
|
||||||
|
|
||||||
|
# Make EASY dirs
|
||||||
|
dirs=('PrintResults' 'CFfigs' 'Fotos')
|
||||||
|
for d in "${dirs[@]}"; do
|
||||||
|
if [[ ! -d $EASY_RESULTS_DIR/$d ]]; then
|
||||||
|
debug "mkdir $EASY_RESULTS_DIR/$d"
|
||||||
|
mkdir "$EASY_RESULTS_DIR/$d"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# Copy Templates
|
||||||
|
declare -gx DRUG_MEDIA_FILE="$EASY_RESULTS_DIR/DrugMedia_$PROJECT.xls"
|
||||||
|
declare -gx MASTER_PLATE_FILE="$EASY_RESULTS_DIR/MasterPlate_$PROJECT.xls"
|
||||||
|
rsync -a "$EASY_DIR"/{figs,PTmats} "$EASY_RESULTS_DIR"
|
||||||
|
|
||||||
# Ask the user to launch EASYconsole.m in MATLAB
|
# Ask the user to launch EASYconsole.m in MATLAB
|
||||||
# MATLAB doesn't support passing args to scripts se we have to use ENV VARS instead
|
# MATLAB doesn't support passing args to scripts se we have to use ENV VARS instead
|
||||||
# These are proably already set in our scope but be explicit just in case so we don't have to export?
|
|
||||||
# TODO will need to play with the -sd startup option to see what works (well)
|
# TODO will need to play with the -sd startup option to see what works (well)
|
||||||
# Skip this step altogether in auto mode since it requires graphical interaction
|
# Skip this step altogether in auto mode since it requires graphical interaction
|
||||||
if ! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI."; then
|
if ! ((YES)) && ask "Start EASY in MATLAB? This requires a GUI."; then
|
||||||
# export PROJECT_SCANS_DIR PROJECT_DATE PROJECT_USER PROJECT
|
# Add EASY directory to the Matlab path
|
||||||
# export EASY_DIR EASY_NAME EASY_SUFFIX EASY_RESULTS_DIR
|
# If this does not work we can try changing the -sd argument and if that fails then pushing/popping
|
||||||
# export MASTER_PLATE_FILE DRUG_MEDIA_FILE
|
debug "Adding EASY directory to the Matlab path"
|
||||||
|
hash matlab &>/dev/null &&
|
||||||
declare -gx DRUG_MEDIA_FILE="$EASY_RESULTS_DIR/DrugMedia_$PROJECT.xls"
|
matlab -nodisplay -nosplash -nodesktop -nojvm -batch "addpath('$EASY_DIR')"
|
||||||
declare -gx MASTER_PLATE_FILE="$EASY_RESULTS_DIR/MasterPlate_$PROJECT.xls"
|
|
||||||
|
|
||||||
# Make EASY dirs
|
|
||||||
debug "mkdir -p $EASY_RESULTS_DIR"
|
|
||||||
mkdir -p "$EASY_RESULTS_DIR"
|
|
||||||
dirs=('PrintResults' 'CFfigs' 'Fotos')
|
|
||||||
for d in "${dirs[@]}"; do
|
|
||||||
if [[ ! -d $EASY_RESULTS_DIR/$d ]]; then
|
|
||||||
debug "mkdir $EASY_RESULTS_DIR/$d"
|
|
||||||
mkdir "$EASY_RESULTS_DIR/$d"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Copy templates
|
|
||||||
rsync -a "$EASY_DIR"/{figs,PTmats} "$EASY_RESULTS_DIR"
|
|
||||||
|
|
||||||
# Launch matlab
|
# Launch matlab
|
||||||
# matlab -nosplash -sd "$PROJECT_SCANS_DIR" -r "run $script"
|
# matlab -nosplash -sd "$PROJECT_SCANS_DIR" -r "run $script"
|
||||||
matlab -nosplash -r "run $script"
|
matlab -nosplash -r "run $script"
|
||||||
@@ -637,7 +636,7 @@ module ezview
|
|||||||
# @description TODO WIP
|
# @description TODO WIP
|
||||||
ezview() {
|
ezview() {
|
||||||
debug "Running: ${FUNCNAME[0]}"
|
debug "Running: ${FUNCNAME[0]}"
|
||||||
|
|
||||||
declare -gx EZVIEW_DIR="$APPS_DIR/matlab/ezview"
|
declare -gx EZVIEW_DIR="$APPS_DIR/matlab/ezview"
|
||||||
script="$EZVIEW_DIR/EZviewGui.m"
|
script="$EZVIEW_DIR/EZviewGui.m"
|
||||||
|
|
||||||
@@ -1577,7 +1576,7 @@ main() {
|
|||||||
declare -gx QHTCP_TEMPLATE_DIR="$TEMPLATES_DIR/qhtcp"
|
declare -gx QHTCP_TEMPLATE_DIR="$TEMPLATES_DIR/qhtcp"
|
||||||
declare -gx STUDY_TEMPLATE_DIR="$TEMPLATES_DIR/exp"
|
declare -gx STUDY_TEMPLATE_DIR="$TEMPLATES_DIR/exp"
|
||||||
declare -gx STUDY_INFO_FILE="$QHTCP_PROJECT_DIR/StudyInfo.csv"
|
declare -gx STUDY_INFO_FILE="$QHTCP_PROJECT_DIR/StudyInfo.csv"
|
||||||
declare -gx EASY_RESULTS_DIR="$QHTCP_PROJECT_DIR/easy"
|
declare -gx EASY_OUT_DIR="$QHTCP_PROJECT_DIR/easy"
|
||||||
if ((DEBUG)); then
|
if ((DEBUG)); then
|
||||||
declare -p SCANS_DIR OUT_DIR TEMPLATES_DIR APPS_DIR \
|
declare -p SCANS_DIR OUT_DIR TEMPLATES_DIR APPS_DIR \
|
||||||
PROJECTS PROJECT \
|
PROJECTS PROJECT \
|
||||||
|
|||||||
Reference in New Issue
Block a user