123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458 |
- %% CALLED WHEN ACCESSING 'CurveFit Display' %%
- function [scLst, row, col] = NCdisplayGui(projectScansDir)
- xPos=0.05;
- btnWid=0.10;
- btnHt=0.05;
- spacing=0.02; % Spacing between the button and the next command's label
-
- % Figure
- % The ADD Groups button
- btnNumber=1;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- row=1;
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',row,...
- 'Units','normalized',...
- 'Position', btnPos,... % [.002 .70 .08 .10],...
- 'callback',{@editRowNum}); % 'Position', [5 100 60 20])
- function editRowNum(source,~)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<0)||(user_entry>17) )
- errordlg('Enter a Row between 1 and 16','Bad Input','modal')
- return
- end
- row=user_entry;
- end
- btnNumber=2;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- col=1;
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',col,...
- 'Units','normalized',...
- 'Position', btnPos,... % [.002 .70 .08 .10],...
- 'callback',{@entryColNum}); % 'Position', [5 100 60 20])
- function entryColNum(source,~)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<0)||(user_entry>25))
- errordlg('Enter a Column between 1 and 24','Bad Input','modal')
- return
- end
- col=user_entry;
- end
- % Read in numeric folder names
- nlist=dir(fullfile(projectScansDir,'*'));
- nnn=0;
- for n=1:size(nlist,1)
- if (~isempty(str2num(nlist(n).name)))
- nnn=nnn+1;
- PnumLst(nnn)=(str2num(nlist(n).name));
- slst(nnn,1)={nlist(n).name};
- slst(nnn,1)={(nlist(n).name)};
- end
- end
- hListbox=uicontrol(...
- 'Style', 'listbox',...
- 'String',sort(slst),...
- 'value',[],...
- 'max',1000,...
- 'min',1,...
- 'Units','normalized',...
- 'Position', [.40 .40 .10 .60],...
- 'callback',{@load_listbox}); %'uiresume(gcbf)'); 'Position', [5 100 60 20])
-
- function load_listbox(source,~)
- userIndx=(get(source,'value'));
- userStr=(get(source,'string'));
- %scLstIndx=str2num(char(strrep(userStr(userIndx), 'Scan', '')))
- user_entry=userStr(userIndx);
- scLst=user_entry;
- end
-
- btnNumber=10;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- hedit8=uicontrol(...
- 'Style', 'pushbutton',...
- 'String',{'Continue'},...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback','uiresume(gcbf)');
- % Labels
- xLPos=0.175;
- yPos=0;
- btnWid=0.20;
- lblNumber=1;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','Row',...
- 'Units','normalized',...
- 'Position', btnPos);
- lblNumber=2;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','Column',...
- 'Units','normalized',...
- 'Position', btnPos);
- % Not needed for Ncode ImRobot
- uiwait(gcf);
- end %function end $$$$$[/INST]
- %}
- %{
- %-------------------333333-----------
- lblNumber=3;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','BG Threshold (%above) Detection',...
- 'Units','normalized',...
- 'Position', btnPos);
- %-------------------4-----------
- lblNumber=4;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','SpotDetThres(1-60%)',...
- 'Units','normalized',...
- 'Position', btnPos);
- %-------------------55555-----------
- lblNumber=5;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','Radius',... %'String','Width',...
- 'Units','normalized',...
- 'Position', btnPos);
- %-------------------66666-----------
- lblNumber=6;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','Dither',...
- 'Units','normalized',...
- 'Position', btnPos);
- %-------------------77777-----------
- lblNumber=7;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','SearchRange',...
- 'Units','normalized',...
- 'Position', btnPos);
- %-------------------88888-----------
- %{
- lblNumber=8;
- yPos=0.85-(lblNumber-1)*(btnHt+spacing);
- btnPos=[xLPos yPos-spacing btnWid btnHt];
-
- htxt=uicontrol(...
- 'Style', 'text',...
- 'String','Blank2',...
- 'Units','normalized',...
- 'Position', btnPos);
- %----------------------------------------
- %}
- %}
- %{
-
- %-------------------66666-----------
- btnNumber=6;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcExtendFactor=ImParMat(7);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcLoIntensThres,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@entryExtendFactor});
- function entryExtendFactor(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<1.8)||(user_entry>4.0))
- errordlg('You must enter a numeric value between 1.8 and 2.1','Bad Input','modal')
- return
- end
- ExtendFactor=user_entry
- ImParMat(7)= ExtendFactor
- ExtendFactor
- end
- %}
- %{
- %-------------------333333-----------
- btnNumber=3;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcBGthreshold=ImParMat(3);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcBGthreshold,...
- 'Units','normalized',...
- 'Position', btnPos,... % [.002 .70 .08 .10],...
- 'callback',{@entryBGthreshold}); % 'Position', [5 100 60 20])
- function entryBGthreshold(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<1)||(user_entry>100))
- errordlg('Enter a numeric value between 1 and 100 percent to produce a Background Threshold value as a percent above the time series average background for each spot.','Bad Input','modal')
- return
- end
- BGthresInput=user_entry
- ImParMat(3)= BGthresInput
- BGthresInput
- end
- %-------------------444444-----------
- btnNumber=4; %Enter spot detection threshold (lock-in Image frame)
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcSpotThres=ImParMat(4);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcSpotThres,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@entrySpotThres});
- function entrySpotThres(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<1)||(user_entry>60))
- errordlg('You must enter a numeric value between 1 and 60','Bad Input','modal')
- return
- end
- spotThres=user_entry
- ImParMat(4)= spotThres
- spotThres
- end
- %
- %---------555555 Radius Entry After Sept.2014---------------------------------**
- btnNumber=5;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcRadius=ImParMat(10);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcRadius,...
- 'Units','normalized',...
- 'Position', btnPos,... % [.002 .70 .08 .10],...
- 'callback',{@entryRadius}); % 'Position', [5 100 60 20])
- function entryRadius(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<12)||(user_entry>17))
- errordlg('You must enter a numeric value between 12 and 17','Bad Input','modal')
- return
- end
- Radius=user_entry
- ImParMat(10)= Radius
- Radius
- end
- %---------555555 Width Entry prior the Sept.2014---------------------------------**
- %{
- btnNumber=5;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcWidth=ImParMat(5);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcWidth,...
- 'Units','normalized',...
- 'Position', btnPos,... % [.002 .70 .08 .10],...
- 'callback',{@entryWidth}); % 'Position', [5 100 60 20])
- function entryWidth(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<5)||(user_entry>41))
- errordlg('You must enter a numeric value between 5 and 40','Bad Input','modal')
- return
- end
- Width=user_entry
- ImParMat(5)= Width
- Width
- end
- %}
- %-------------------66666 Dither unnecessary after Sept.2014-----------
- btnNumber=6;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcDither= ImParMat(6);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcDither,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@entryDither});
- function entryDither(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<0)||(user_entry>5))
- errordlg('You must enter a numeric value between 1 and 4','Bad Input','modal')
- return
- end
- Dither=user_entry
- ImParMat(6)= Dither
- Dither
- end
- %-------------------77777----------- Added July 7,2015 to allow Search Range constraint
- btnNumber=7;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- try
- srchRange=ImParMat(12);
- searchRangeNum=ImParMat(12)
- catch %Legacy default value was 18 before being made a user input variable (ImParMat(12)). A preferable value now might be 12 or 14.
- srchRange=18;
- ImParMat(12)=18
- searchRangeNum=ImParMat(12)
- end
-
- %{
- if size(scLst)>1
- srchRange=ImParMat(12);
- else
- try
- srchRange=CSearchRange(str2double(scLst))
- catch
- srchRange=ImParMat(12);
- end
- end
- %}
- hSearchRange=uicontrol(...
- 'Style', 'edit',...
- 'String',srchRange,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@CsearchRange});
- function CsearchRange(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<1)||(user_entry>50)) %originally 18; 19_0729 increased
- errordlg('You must enter a numeric value between 1 and 18 12->18 recommended. (ImParMat(12)))','Bad Input','modal')
- return
- end
- searchRangeNum=user_entry
-
- end
- %-------------------77777-----------
- %{
- btnNumber=7;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- srcExtend=ImParMat(7);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcExtend,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@entryExtend});
- function entryExtend(source,eventdata)
- user_entry=str2double(get(source,'string'));
- if (isnan(user_entry)||(user_entry<-0.10)||(user_entry>0.4))
- errordlg('You must enter a numeric value between 0 and 0.4. 0.10 recommended','Bad Input','modal')
- return
- end
- extend=user_entry
- ImParMat(7)= extend
- extend
- end
- %-------------------888888-----------
- btnNumber=8;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
- %ImParMat(8)=1;
- srcpointExtend=ImParMat(8);
- hedit=uicontrol(...
- 'Style', 'edit',...
- 'String',srcpointExtend,...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@entrypointExtend});
- function entrypointExtend(source,eventdata)
- user_entry=str2double(get(source,'string'));
- user_entry= floor(user_entry);
- if (isnan(user_entry)||(user_entry<-3)||(user_entry>5))
- errordlg('You must enter an integer value between 0 and 5. 1 recommended','Bad Input','modal')
- return
- end
- pointExtend=user_entry
- ImParMat(8)= pointExtend
- pointExtend
- end
- %}
- %-------------------999999-----------
- btnNumber=9;
- yPos=0.85-(btnNumber-1)*(btnHt+spacing);
- btnPos=[xPos yPos-spacing btnWid btnHt];
-
- hedit=uicontrol(...
- 'Style', 'popupmenu',...
- 'String',{'GrowthArea','FixedArea'},...
- 'Units','normalized',...
- 'Position', btnPos,...
- 'callback',{@grwArea});
- function grwArea(source,eventdata)
- str=get(source, 'String');
- val=get(source,'Value');
- % Set current data to the selected data set.
- switch str{val};
- case 'GrowthArea' ;% User selects Peaks.
- SWgrowthArea=1
- case 'FixedArea' % User selects Membrane.
- SWgrowthArea=0
- end
- end
- %}
|