Skip to content

Commit

Permalink
get rid of direct path for settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jries committed Aug 27, 2021
1 parent 79adacf commit 676e1ee
Show file tree
Hide file tree
Showing 28 changed files with 37 additions and 74 deletions.
3 changes: 2 additions & 1 deletion +gui/GuiFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ function autosave_timer(a,b,obj)
p.mainGui=obj.getPar('mainGui');
p.saveroi=false;
if obj.guihandles.autosavecheck.Value
savesml(obj.locData,'settings/temp/autosave_sml',p)
settingsdir=obj.getPar('SettingsDirectory');
savesml(obj.locData,[settingsdir filesep 'temp' filesep 'autosave_sml'],p)
time=datetime('now');
disp(['autosave: ' num2str(time.Hour) ':' num2str(time.Minute)])
end
Expand Down
30 changes: 5 additions & 25 deletions +gui/GuiPluginGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function processorselect_callback(object,data,obj)

function menu_callback(callobj,b,obj)
guimodules=obj.getPar('guimodules');
% guimodules=readstruct('settings/temp/guimodules.txt',[],true);

switch callobj.Label
case 'add plugin'
plugins=obj.getPar('menu_plugins');
Expand All @@ -223,7 +223,8 @@ function menu_callback(callobj,b,obj)
% guimodules.(pluginname{1}).(pluginname{2}).(pluginname{3})=pluginname;
% save(obj.guipluginpath,'guimodules')
case 'add workflow'
[file,path]=uigetfile(['settings/workflows/*.mat']);
settingsdir=obj.getPar('SettingsDirectory');
[file,path]=uigetfile([settingsdir '/workflows/*.mat']);
if ~file
return
end
Expand Down Expand Up @@ -276,28 +277,7 @@ function menu_callback(callobj,b,obj)
classname=obj.plugins.allclassnames{selection};
guimodules.(obj.maindir{1}).(obj.maindir{2}).(classname).name=newname;
obj.setprocessorlist;
% case 'reset: use all plugins'
% answ=questdlg('Delete all settings for pluginlist? Effect takes place after restarting the application');
%
% if strcmp(answ,'Yes')
% obj.setGlobalSetting('guiPluginConfigFile','');
% end
% delete('settings/temp/guimodules.txt')
% return
% end
% case 'load plugin structure'
% fs='settings/*.txt';
% [f,path]=uigetfile(fs,'load gui plugin structure file');
% if f
% guimodules=readstruct([path f],[],1);
% msgbox('please restart SMAP')
% end
% case 'save plugin structure'
% fs='settings/guiplugins.txt';
% [f,path]=uiputfile(fs,'save gui plugin structure file');
% if f
% writestruct([path f],guimodules);
% end


case 'detach'
f=figure('MenuBar','none','Toolbar','none');
Expand All @@ -311,7 +291,7 @@ function menu_callback(callobj,b,obj)
for k=1:length(allclasses)
guimodules.(obj.maindir{1}).(obj.maindir{2}).(allclasses{k}).position=k;
end
% writestruct('settings/temp/guimodules.txt',guimodules);

obj.setPar('guimodules',guimodules);
end

Expand Down
6 changes: 3 additions & 3 deletions +gui/GuiPluginWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function addplugingroup(obj,name,screenname)

function menu_callback(callobj,b,obj)
guimodules=obj.getPar('guimodules');
% guimodules=readstruct('settings/temp/guimodules.txt',[],true);

switch callobj.Label
case 'add'
name=inputdlg('name of new tab');
Expand All @@ -126,7 +126,8 @@ function menu_callback(callobj,b,obj)
guimodules.(obj.maindir)=rmfield(guimodules.(obj.maindir),fieldr);
end
case 'add workflow'
[file,path]=uigetfile(['settings/workflows/*.mat']);
settingsdir=obj.getPar('SettingsDirectory');
[file,path]=uigetfile([settingsdir '/workflows/*.mat']);
if file
[~,name]=fileparts(file);
name=name(1:min(end,16));
Expand Down Expand Up @@ -167,7 +168,6 @@ function menu_callback(callobj,b,obj)
selected.Parent=hnew;
end
obj.setPar('guimodules',guimodules);
% writestruct('settings/temp/guimodules.txt',guimodules);
end

function module=makewf(obj,name, file)
Expand Down
2 changes: 1 addition & 1 deletion +gui/SEAnnotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function keypress(object,data,obj,focus)
end

function loadlist_callback(a,b,obj)
[f p]=uigetfile('settings/*.txt');
[f p]=uigetfile([obj.getPar('SettingsDirectory') '/*.txt']);
if f
loadlist(obj,[p f])
end
Expand Down
7 changes: 1 addition & 6 deletions +gui/private/makeplugincallfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,13 @@
if ~isdeployed
addpath('plugins')
addpath('plugins/shared');
% addpath('settings/workflows');

try
pold=plugin;
catch
pold=[];
end
% outputdir='+plugintemp';
% if ~exist(outputdir,'dir')
% mkdir(outputdir)
% rehash
% end


strcase={};
strlist={};
Expand Down
3 changes: 2 additions & 1 deletion +interfaces/imageloaderSMAP.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
waittime=5;
currentImageNumber;
allmetadatatags;
calibrationFile='settings/cameras.mat';
calibrationFile;
allowmultiplefiles=true;
ismultichannel=false;
multiloader={};
Expand All @@ -17,6 +17,7 @@
methods
function obj=imageloaderSMAP(varargin)
obj.metadata=interfaces.metadataSMAP;
obj.calibrationFile=[obj.getGlobalSetting('SettingsDirectory') '/cameras.mat'];
if nargin>2 && ~isempty(varargin{3})
if isa(varargin{3},'interfaces.ParameterData')
obj.P=varargin{3};
Expand Down
2 changes: 1 addition & 1 deletion plugins/+Analyze/+sr3D/Biplane_getPSFxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function loadbutton(obj,a,b)
% pard.datapart.position=[3,1];


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+File/+Load/Loader_csvAndMore.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
classdef Loader_csvAndMore<interfaces.DialogProcessor
properties
loaderpath='settings/csvloaderconversion/';
loaderpath;
notfound=false;
end
methods
Expand Down
13 changes: 1 addition & 12 deletions plugins/+File/+Load/Loader_minflux.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,7 @@ function clear(obj,file,isadd)
obj.locData.clear;
end
end
% function initGui(obj)
% obj.loaderpath='settings/csvloaderconversion/';
% files=dir([obj.loaderpath '*.txt']);
% string={'New format', files(:).name};
% obj.guihandles.importdef.String=string;
% % [email protected]_callback;
% end
% function csvconvert_callback(obj,object,b)
% if object.Value==1
% newformat(obj);
% end
% end

end
end

Expand Down
2 changes: 1 addition & 1 deletion plugins/+File/+Load/Loader_sml_Tiff.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function loadTfile(obj,a,b)
pard.replacestring.TooltipString='replace string.';


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[3,1];
pard.Tfile.Width=3;
pard.syncParameters={{'transformationfile','Tfile',{'String'}}};
Expand Down
2 changes: 0 additions & 2 deletions plugins/+Process/+Assign2C/Get2CIntImages2cam.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
settingsdir=obj.getPar('SettingsDirectory');
f=obj.figure;
f.Visible='on';
% wffile='settings/workflows/get2CIntensityImagesWF_group.mat';
% wffile='settings/workflows/get2CIntensityImagesWF2';
if p.evalref && p.evaltarget && ( isempty(p.tiffileref) || strcmp(p.tiffileref,p.tiffiletarget)) %both channels on one chip
wffile=[settingsdir filesep 'workflows' filesep 'get2CIntensityImagesWF3_reftarget'];
samechip=true;
Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Assign2C/Get2CIntLoc.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function loadbutton(obj,a,b)
% pard.datapart.position=[3,1];


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Assign2C/old/Get2CIntImages.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function loadbutton(obj,a,b)
% pard.size2roi2.position=[3,4.5];
% pard.size2roi2.Width=0.5;

pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;

Expand Down
4 changes: 2 additions & 2 deletions plugins/+Process/+Modify/MathParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
% access.
properties
equationhistory
historyfile='settings/temp/MathParser.txt';
historyfile
end
methods
function obj=MathParser(varargin)
[email protected](varargin{:}) ;
end
function initGui(obj)
obj.historyfile=[obj.getPar('SettingsDirectory') filesep 'temp' filesep 'MathParser.txt'];
if exist(obj.historyfile,'file')
try
obj.equationhistory=readtable(obj.historyfile,'Delimiter',',');
Expand All @@ -27,7 +28,6 @@ function initGui(obj)
tt=struct('resultfield',{{''}},'equation',{{''}});
obj.equationhistory=struct2table(tt);
end
obj.historyfile=[obj.getPar('SettingsDirectory') filesep 'temp' filesep 'MathParser.txt'];
end

function out=run(obj,p)
Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/ApplyTransform.m
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function loadbutton(obj,a,b)
pard.transformz.Width=2;


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[7,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/CombineChannels.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function loadbutton(obj,a,b)
%


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[7,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/RegisterImages.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function savebutton(obj,a,b)
pard.syncParameters={{'filelist_short','dataselect',{'String'}}};


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/RegisterLocs2.m
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function useT_callback(obj,a,b)
pard.reflayer.Width=0.85;
pard.reflayer.Optional=true;

pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;
pard.Tfile.object.TooltipString='default file for transformation matrix. You can select new file after transformation has been calculated.';
Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/RegisterLocs4Pi.m
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function useT_callback(obj,a,b)
% pard.reflayer.object.TooltipString='layer';
% pard.reflayer.Width=0.85;

% pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
% pard.Tfile.object=struct('Style','edit','String','*_T.mat');
% pard.Tfile.position=[8,1];
% pard.Tfile.Width=3;
% pard.Tfile.object.TooltipString='default file for transformation matrix. You can select new file after transformation has been calculated.';
Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/Transform2C_interleaved.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function loadbutton(obj,a,b)
% pard.transformz.Width=2;


pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[7,1];
pard.Tfile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/hide/ManualTransform.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function updateGui(obj,event,data)
pard.refmirror.object=struct('Style','popupmenu','String','no mirror|left-right|up-down');
pard.refmirror.position=[4,2];

pard.savefile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.savefile.object=struct('Style','edit','String','*_T.mat');
pard.savefile.position=[8,1];
pard.savefile.Width=3;

Expand Down
2 changes: 1 addition & 1 deletion plugins/+Process/+Register/hide/RegisterLocs.m
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function savebutton(obj,a,b)
% pard.refmirror.position=[4,1];
% pard.refmirror.object.TooltipString='mirror reference part';

pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[8,1];
pard.Tfile.Width=3;
pard.Tfile.object.TooltipString='default file for transformation matrix. You can select new file after transformation has been calculated.';
Expand Down
5 changes: 2 additions & 3 deletions plugins/+WorkflowModules/+Loaders/CameraConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% Interprets metadata and converts camera ADUs into photons- Metadata
% can be overwritten manually or loaded from a SMAP _sml.mat data file.
properties
calfile='settings/CameraCalibration.xls';
calfile;
loc_cameraSettings=interfaces.metadataSMAP;
loc_cameraSettingsStructure=struct('EMon',1,'emgain',1,'conversion',1,'offset',400,'cam_pixelsize_um',0.1,...
'roi',[],'exposure',1,'timediff',0,'comment','','correctionfile','');
Expand Down Expand Up @@ -47,8 +47,7 @@ function initGui(obj)
obj.guihandles.calibrate.Callback={@calibrate_callback,obj};
obj.outputParameters={'loc_cameraSettings'};
obj.addSynchronization('loc_fileinfo_set',[],[],@obj.setmetadata)
obj.inputParameters={'diffrawframes'};

obj.inputParameters={'diffrawframes'};
end
function setmetadata(obj,overwrite)
if nargin<2
Expand Down
2 changes: 1 addition & 1 deletion plugins/+WorkflowModules/+LocProcessors/LocSaver.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ function outputfields_callback(a,b,obj)
end

function imout=makeSRimge(obj,locDatatemp)
channelfile=[obj.getPar('maindirectory') '/settings/workflows/FitTif_Channelsettings.mat'];
channelfile=[obj.getPar('SettingsDirectory') '/workflows/FitTif_Channelsettings.mat'];
pall=load(channelfile);
p=pall.globalParameters;
p.lutinv=false;
Expand Down
2 changes: 1 addition & 1 deletion plugins/+WorkflowModules/+Peakfinders/PeakCombiner.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function loadbutton(obj,a,b)


function pard=guidef(obj)
pard.Tfile.object=struct('Style','edit','String','settings/temp/temp_T.mat');
pard.Tfile.object=struct('Style','edit','String','*_T.mat');
pard.Tfile.position=[1,1];
pard.Tfile.Width=3;

Expand Down
3 changes: 2 additions & 1 deletion shared/imageloaders/CameraManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
currentstate=1;
lastcamtableselected=[];
defaultpath;
cameraSettingsFile='settings/cameras.mat';
cameraSettingsFile;
end

methods
Expand Down Expand Up @@ -46,6 +46,7 @@ function loadimages(obj,file)
end
end
function makeGui(obj)
obj.cameraSettingsFile=obj.getGlobalSetting('cameraSettingsFile');
makeGui(obj)
end
function pard=guidef(obj)
Expand Down
1 change: 0 additions & 1 deletion shared/imageloaders/imageloaderMMsingle.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
% Detailed explanation goes here

properties
% calfile='settings/CameraCalibration.xls';
separate
separatefiles
end
Expand Down
2 changes: 1 addition & 1 deletion shared/imageloaders/imageloaderOME.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% Detailed explanation goes here

properties
calfile='settings/CameraCalibration.xls';
% calfile;
reader
seriesnumber=0;
% allmetadatatags
Expand Down

0 comments on commit 676e1ee

Please sign in to comment.