Squashed initial commit
This commit is contained in:
227
qhtcp-workflow/apps/matlab/ezview/EZVimDisplay.m
Executable file
227
qhtcp-workflow/apps/matlab/ezview/EZVimDisplay.m
Executable file
@@ -0,0 +1,227 @@
|
||||
% ImageDisplay
|
||||
global Exp
|
||||
global ghandles
|
||||
global zonePB
|
||||
|
||||
prntHt=0;
|
||||
% Test for Bad MP cell array (usually 384 [NaN}'s)
|
||||
% replaced length(Exp(expN).Dexp(1).MP) with MPnum
|
||||
for mx=1:length(Exp(expN).Dexp(1).MP)
|
||||
try
|
||||
char((Exp(expN).Dexp(1).MP(mx).genename{1}(384)))
|
||||
MPnum=mx;
|
||||
catch
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if expN==1,DexpN=(get(handles.DN1,'value')); end
|
||||
if expN==2,DexpN=(get(handles.DN2,'value')); end
|
||||
if expN==3,DexpN=(get(handles.DN3,'value')); end
|
||||
Exp(expN).DexpN=DexpN;
|
||||
if strcmp(Exp(expN).DexpType,'single')
|
||||
DexpN=1;
|
||||
elseif ~strcmp(Exp(expN).DexpType,'single')
|
||||
if expN==1
|
||||
set(handles.MPsldr1,'min',1,'max',MPnum)
|
||||
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
|
||||
set(handles.DMsldr1,'min',1,'max',DMnum)
|
||||
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
|
||||
set(handles.Tptsldr1,'min',1,'max',tPtsSize)
|
||||
end
|
||||
if expN==2
|
||||
set(handles.MPsldr2,'min',1,'max',MPnum)
|
||||
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
|
||||
set(handles.DMsldr2,'min',1,'max',DMnum)
|
||||
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
|
||||
set(handles.Tptsldr2,'min',1,'max',tPtsSize)
|
||||
end
|
||||
if expN==3
|
||||
set(handles.MPsldr3,'min',1,'max',MPnum)
|
||||
DMnum=length(Exp(expN).Dexp(DexpN).DM.drug);
|
||||
set(handles.DMsldr3,'min',1,'max',DMnum)
|
||||
tPtsSize=size(Exp(expN).Dexp(DexpN).FexpScanBMtp{1,1},(3));
|
||||
set(handles.Tptsldr3,'min',1,'max',tPtsSize)
|
||||
end
|
||||
end
|
||||
|
||||
ghandles=handles;
|
||||
scan=Exp(expN).Dexp(DexpN).scan;
|
||||
destPerMP=length(Exp(expN).Dexp(DexpN).DM.drug);
|
||||
|
||||
if expN==1,MPsel=floor(get(handles.MPsldr1,'value')); end
|
||||
if expN==2,MPsel=floor(get(handles.MPsldr2,'value')); end
|
||||
if expN==3,MPsel=floor(get(handles.MPsldr3,'value')); end
|
||||
if expN==1,pertSel=floor(get(handles.DMsldr1,'value')); end
|
||||
if expN==2,pertSel=floor(get(handles.DMsldr2,'value')); end
|
||||
if expN==3,pertSel=floor(get(handles.DMsldr3,'value')); end
|
||||
if expN==1,tPtSel=floor(get(handles.Tptsldr1,'value')); end
|
||||
if expN==2,tPtSel=floor(get(handles.Tptsldr2,'value')); end
|
||||
if expN==3,tPtSel=floor(get(handles.Tptsldr3,'value')); end
|
||||
plateNum=(MPsel-1)*destPerMP + pertSel;
|
||||
tPtsSize=[];
|
||||
tPtsSize=length(Exp(expN).Dexp(DexpN).scan(plateNum).plate(1).tSeries(:))
|
||||
n=1;
|
||||
for ii=1:tPtsSize
|
||||
if exist(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat((num2str(ii)),'.bmp'))) ==2; %the .bmp file exists
|
||||
bmpLst(n)=ii
|
||||
n=n+1
|
||||
end
|
||||
end
|
||||
|
||||
if tPtSel> tPtsSize
|
||||
tPtSel=tPtsSize
|
||||
end
|
||||
|
||||
if exist(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat((num2str(tPtSel)),'.bmp'))) ==0; %the .bmp file exists
|
||||
tPtSel=bmpLst(find(bmpLst>tPtSel,1,'first'))
|
||||
end
|
||||
|
||||
if expN==1,
|
||||
set(handles.Tptsldr1,'max',tPtsSize);
|
||||
set(ghandles.Tptsldr1,'max',tPtsSize);
|
||||
set(handles.Tpted1,'string', num2str(tPtSel));
|
||||
set(ghandles.Tpted1,'string', num2str(tPtSel));
|
||||
if tPtsSize<=tPtSel,
|
||||
set(handles.Tptsldr1,'value', tPtsSize)
|
||||
set(ghandles.Tptsldr1,'value', tPtsSize)
|
||||
tPtSel=tPtsSize
|
||||
set(handles.Tpted1,'string', num2str(tPtsSize))
|
||||
set(ghandles.Tpted1,'string', num2str(tPtsSize))
|
||||
end
|
||||
end
|
||||
if expN==2
|
||||
set(handles.Tptsldr2,'max',tPtsSize);
|
||||
set(ghandles.Tptsldr2,'max',tPtsSize);
|
||||
set(handles.Tpted2,'string', num2str(tPtSel));
|
||||
set(ghandles.Tpted2,'string', num2str(tPtSel));
|
||||
if tPtsSize<=tPtSel,
|
||||
set(handles.Tptsldr2,'value', tPtsSize)
|
||||
set(ghandles.Tptsldr2,'value', tPtsSize)
|
||||
tPtSel=tPtsSize
|
||||
set(handles.Tpted2,'string', num2str(tPtsSize))
|
||||
set(ghandles.Tpted2,'string', num2str(tPtsSize))
|
||||
end
|
||||
end
|
||||
if expN==3
|
||||
set(handles.Tptsldr3,'max',tPtsSize);
|
||||
set(ghandles.Tptsldr3,'max',tPtsSize);
|
||||
set(handles.Tpted3,'string', num2str(tPtSel));
|
||||
set(ghandles.Tpted3,'string', num2str(tPtSel));
|
||||
if tPtsSize<=tPtSel,
|
||||
set(handles.Tptsldr3,'value', tPtsSize)
|
||||
set(ghandles.Tptsldr3,'value', tPtsSize)
|
||||
tPtSel=tPtsSize
|
||||
set(handles.Tpted3,'string', num2str(tPtsSize))
|
||||
set(ghandles.Tpted3,'string', num2str(tPtsSize))
|
||||
end
|
||||
end
|
||||
|
||||
Exp(expN).Dexp(DexpN).MPsel=MPsel;
|
||||
Exp(expN).Dexp(DexpN).destPerMP=destPerMP;
|
||||
Exp(expN).Dexp(DexpN).pertSel=pertSel;
|
||||
Exp(expN).Dexp(DexpN).tPtSel=tPtSel;
|
||||
Exp(expN).Dexp(DexpN).plateNum=plateNum;
|
||||
%try
|
||||
I=imread(fullfile(Exp(expN).Dexp(DexpN).ExpFoldr,num2str(plateNum),strcat(num2str(tPtSel),'.bmp')));
|
||||
|
||||
%set(ghandles.Iaxes1,'CurrentAxes')
|
||||
if expN==1, expAxes=ghandles.Iaxes1;end
|
||||
if expN==2, expAxes=ghandles.Iaxes2;end
|
||||
if expN==3, expAxes=ghandles.Iaxes3;end
|
||||
|
||||
axes(expAxes)
|
||||
imshow(I)
|
||||
set(expAxes,'xtick',[],'ytick',[])
|
||||
|
||||
DMstr=char(strcat('Agar-',Exp(expN).Dexp(DexpN).DM.media{pertSel},' ', ...
|
||||
Exp(expN).Dexp(DexpN).DM.drug{pertSel},Exp(expN).Dexp(DexpN).DM.conc{pertSel},' ', ...
|
||||
Exp(expN).Dexp(DexpN).DM.mod1{pertSel},Exp(expN).Dexp(DexpN).DM.conc1{pertSel},' ', ...
|
||||
Exp(expN).Dexp(DexpN).DM.mod2{pertSel},Exp(expN).Dexp(DexpN).DM.conc2{pertSel}))
|
||||
|
||||
if expN==1,set(handles.DM1,'string',DMstr); end
|
||||
if expN==2,set(handles.DM2,'string',DMstr); end
|
||||
if expN==3,set(handles.DM3,'string',DMstr); end
|
||||
|
||||
tPtStr=strcat('T=', num2str(scan(1,plateNum).plate(1).t0Series(tPtSel)));
|
||||
if expN==1,set(handles.tptTm1,'string',tPtStr); end
|
||||
if expN==2,set(handles.tptTm2,'string',tPtStr); end
|
||||
if expN==3,set(handles.tptTm3,'string',tPtStr); end
|
||||
|
||||
xp=char(Exp(expN).Dexp(DexpN).resDir);
|
||||
if ispc
|
||||
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'\');
|
||||
else
|
||||
slashPos=strfind(char(Exp(expN).Dexp(DexpN).resDir),'/');
|
||||
end
|
||||
|
||||
startPos=slashPos(length(slashPos)-2) +1;
|
||||
endPos=(slashPos(length(slashPos)) -1);
|
||||
expStrg=xp(startPos:end);
|
||||
|
||||
if expN==1,set(handles.expName1,'string',expStrg); end
|
||||
if expN==2,set(handles.expName2,'string',expStrg); end
|
||||
if expN==3,set(handles.expName3,'string',expStrg); end
|
||||
|
||||
try
|
||||
htMapTogPBfg=0;
|
||||
EZhtMap
|
||||
catch
|
||||
end
|
||||
|
||||
% zonePB handle control from left graph spot side to communicate to right side 23_0818
|
||||
% This section was based on the zoneRad Section for Radiobuttons which were
|
||||
% unusable with the new form of Radio Buttons in AppDesigner.
|
||||
if expN==1
|
||||
zonesel=1;
|
||||
zonePB=1;
|
||||
set(handles. zonePB1,'value',1)
|
||||
set(handles. zonePB2,'value',0)
|
||||
set(handles. zonePB3,'value',0)
|
||||
set(handles.zonePB1,'BackgroundColor',[1.0 0.6 0.6])
|
||||
set(handles.zonePB2,'BackgroundColor',[1.0 1.0 1.0])
|
||||
set(handles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
|
||||
orfLstSel=get(handles.GeneOrfTog,'value');
|
||||
if orfLstSel==1
|
||||
set(handles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtOrfLst)
|
||||
else
|
||||
set(handles.listboxGnOrf,'string',Exp(1).Dexp(DexpN).srtGnLst)
|
||||
end
|
||||
end
|
||||
|
||||
if expN==2
|
||||
zonesel=2;
|
||||
zonePB=2;
|
||||
set(handles. zonePB2,'value',1)
|
||||
set(handles. zonePB1,'value',0)
|
||||
set(handles. zonePB3,'value',0)
|
||||
set(handles.zonePB2,'BackgroundColor',[1.0 0.6 0.6])
|
||||
set(handles.zonePB1,'BackgroundColor',[1.0 1.0 1.0])
|
||||
set(handles.zonePB3,'BackgroundColor',[1.0 1.0 1.0])
|
||||
orfLstSel=get(handles.GeneOrfTog,'value');
|
||||
if orfLstSel==1
|
||||
set(handles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtOrfLst)
|
||||
else
|
||||
set(handles.listboxGnOrf,'string',Exp(2).Dexp(DexpN).srtGnLst)
|
||||
end
|
||||
end
|
||||
|
||||
if expN==3
|
||||
zonesel=3;
|
||||
zonePB=3;
|
||||
set(handles. zonePB3,'value',1)
|
||||
set(handles. zonePB2,'value',0)
|
||||
set(handles. zonePB1,'value',0)
|
||||
set(handles.zonePB3,'BackgroundColor',[1.0 0.6 0.6]);
|
||||
set(handles.zonePB1,'BackgroundColor',[1.0 1.0 1.0]);
|
||||
set(handles.zonePB2,'BackgroundColor',[1.0 1.0 1.0]);
|
||||
orfLstSel=get(handles.GeneOrfTog,'value');
|
||||
if orfLstSel==1
|
||||
set(handles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtOrfLst)
|
||||
else
|
||||
set(handles.listboxGnOrf,'string',Exp(3).Dexp(DexpN).srtGnLst)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user