diff --git a/MASH-FRET/.release_version.json b/MASH-FRET/.release_version.json index 5c6644dc..9d7a7868 100644 --- a/MASH-FRET/.release_version.json +++ b/MASH-FRET/.release_version.json @@ -1,4 +1,4 @@ { -"tag" : "1.3.3.1", -"prev_commit_hash" : "4f414d4c" +"tag" : "1.3.3.2", +"prev_commit_hash" : "cbe25179" } diff --git a/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelHA.m b/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelHA.m index 6550f136..2f9b0d23 100644 --- a/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelHA.m +++ b/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelHA.m @@ -30,7 +30,6 @@ htxt0 = 14; wedit0 = 40; fact = 5; -fntsz2 = 10; str0 = 'data'; str1 = {'Select data'}; str2 = 'subgroup'; @@ -38,9 +37,6 @@ str5 = 'Gaussian fitting'; str6 = 'relative pop.:'; str7 = 'EXPORT...'; -ttl0 = 'Histogram and plot'; -ttl1 = 'State configuration'; -ttl2 = 'State populations'; tabttl0 = 'Histograms'; tabttl1 = 'Model selection'; ttstr0 = wrapHtmlTooltipString('Select data to histogram and analyze.'); @@ -56,13 +52,7 @@ wcb0 = getUItextWidth(str5,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; wtxt0 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl); wbut0 = getUItextWidth(str7,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; -htxt1 = (fntsz2/p.fntsz1)*htxt0; -hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+hedit0+p.mg; -hpan1 = p.mgpan+hedit0+p.mg+htxt0+(hpop0-hedit0)/2+hedit0+p.mg/fact+hedit0+p.mg+... - htxt1+p.mg/2+htxt0+hpop0+p.mg; -hpan2_1 = p.mgpan+p.mg+p.mg/2+4*p.mg/fact+6*hedit0; -hpan2_2 = 2*p.mgpan+2*p.mg+3*p.mg/2+2*p.mg/fact+5*hedit0+hpop0+htxt0; -hpan2 = p.mgpan+p.mg+p.mg/2+hpan2_1+hpan2_2; +hpan0 = pospan(4)-p.mgpan-htxt0-hpop0-2*p.mg-hedit0-p.mg; wpan0_1 = wcb0+2*p.mg; wpan0_2 = 2*p.mg+2*p.mg/fact+2*wedit0+wtxt0; wpan0 = 3*p.mg+wpan0_1+wpan0_2; @@ -119,24 +109,9 @@ x = p.mg+wtab+p.mg; y = y-p.mg-hpan0; -h.uipanel_HA_histogramAndPlot = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan0],'title',ttl0); -h = buildPanelHAhistogramAndPlot(h,p); - -y = y-p.mg-hpan1; - -h.uipanel_HA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan1],'title',ttl1); -h = buildPanelHAstateConfiguration(h,p); - -y = y-p.mg-hpan2; - -h.uipanel_HA_statePopulations = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan2],'title',ttl2); -h = buildPanelHAstatePopulations(h,p); +h.uipanel_HA_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]); +h = buildPanelScrollHA(h,p); x = pospan(3)-p.mg-wbut0; y = p.mg; diff --git a/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelScrollHA.m b/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelScrollHA.m new file mode 100644 index 00000000..092eb1eb --- /dev/null +++ b/MASH-FRET/source/GUI/mod-histogram-analysis/buildPanelScrollHA.m @@ -0,0 +1,56 @@ +function h = buildPanelScrollHA(h,p) + +% default +hpop0 = 22; +hedit0 = 20; +htxt0 = 14; +wedit0 = 40; +fact = 5; +fntsz2 = 10; +str5 = 'Gaussian fitting'; +str6 = 'relative pop.:'; +ttl0 = 'Histogram and plot'; +ttl1 = 'State configuration'; +ttl2 = 'State populations'; + +% parents +h_pan = h.uipanel_HA_scroll; + +% dimensions +pospan = get(h_pan,'position'); +wcb0 = getUItextWidth(str5,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; +wtxt0 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl); +htxt1 = (fntsz2/p.fntsz1)*htxt0; +hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+hedit0+p.mg; +hpan1 = p.mgpan+hedit0+p.mg+htxt0+(hpop0-hedit0)/2+hedit0+p.mg/fact+hedit0+p.mg+... + htxt1+p.mg/2+htxt0+hpop0+p.mg; +hpan2_1 = p.mgpan+p.mg+p.mg/2+4*p.mg/fact+6*hedit0; +hpan2_2 = 2*p.mgpan+2*p.mg+3*p.mg/2+2*p.mg/fact+5*hedit0+hpop0+htxt0; +hpan2 = p.mgpan+p.mg+p.mg/2+hpan2_1+hpan2_2; +wpan0_1 = wcb0+2*p.mg; +wpan0_2 = 2*p.mg+2*p.mg/fact+2*wedit0+wtxt0; +wpan0 = 3*p.mg+wpan0_1+wpan0_2; + +% GUI +x = 0; +y = pospan(4)-p.mg-hpan0; + +h.uipanel_HA_histogramAndPlot = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan0],'title',ttl0); +h = buildPanelHAhistogramAndPlot(h,p); + +y = y-p.mg-hpan1; + +h.uipanel_HA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan1],'title',ttl1); +h = buildPanelHAstateConfiguration(h,p); + +y = y-p.mg-hpan2; + +h.uipanel_HA_statePopulations = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan2],'title',ttl2); +h = buildPanelHAstatePopulations(h,p); + diff --git a/MASH-FRET/source/GUI/mod-simulation/buildPanelS.m b/MASH-FRET/source/GUI/mod-simulation/buildPanelS.m index e8d4f599..ea2e9a5d 100644 --- a/MASH-FRET/source/GUI/mod-simulation/buildPanelS.m +++ b/MASH-FRET/source/GUI/mod-simulation/buildPanelS.m @@ -23,18 +23,12 @@ % default fact = 5; -htxt0 = 14; hedit0 = 20; -hpop0 = 22; wedit0 = 40; str0 = 'nb. of states (J)'; str1 = 'GENERATE'; str2 = 'UPDATE'; str3 = 'EXPORT'; -ttl0 = 'Video parameters'; -ttl1 = 'Molecules'; -ttl2 = 'Experimental setup'; -ttl3 = 'Export options'; tabttl0 = 'Video'; tabttl1 = 'Traces'; tabttl2 = 'Distributions'; @@ -55,20 +49,11 @@ wspan0 = p.mg+wtxt0+wedit0+p.mg/2+wedit0+p.mg/fact+wedit0+p.mg/fact+wedit0+... p.mg; wpan0 = 2*p.mg+wspan0; -hspan0 = p.mgpan+hpop0+p.mg/2+hedit0+p.mg/fact+hedit0+p.mg/fact+hedit0+... - p.mg/2; -hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan0+p.mg/2; -hspan1 = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+5*(1+hedit0)+htxt0+p.mg/2; -hspan2 = p.mgpan+htxt0+hedit0+p.mg/fact+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+... - hedit0+p.mg/2; -hpan1 = p.mgpan+hedit0+p.mg/fact+hedit0+p.mg+hedit0+p.mg/2+hspan1+p.mg/2+... - hspan2+p.mg/2; -hspan3 = p.mgpan+hpop0+p.mg/2+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2; -hpan2 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan3+p.mg; -hpan3 = p.mgpan+7*hedit0+p.mg/2+hedit0+hpop0+p.mg/2; wtab = pospan(3)-3*p.mg-wpan0; htab = pospan(4)-2*p.mg; +hpan0 = htab-2*p.mg-hedit0; +% builds GUI x = p.mg; y = p.mg; @@ -92,31 +77,9 @@ x = x+wtab+p.mg; y = pospan(4)-p.mg-hpan0; -h.uipanel_S_videoParameters = uipanel('parent',h_pan,'title',ttl0,'units',... - p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... - 'position',[x,y,wpan0,hpan0]); -h = buildPanelSimVideoParametes(h,p); - -y = y-p.mg-hpan1; - -h.uipanel_S_molecules = uipanel('parent',h_pan,'title',ttl1,'units',... - p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... - 'position',[x,y,wpan0,hpan1]); -h = buildPanelSimMolecules(h,p); - -y = y-p.mg-hpan2; - -h.uipanel_S_experimentalSetup = uipanel('parent',h_pan,'title',ttl2,... - 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... - 'bold','position',[x,y,wpan0,hpan2]); -h = buildPanelSimExperimentalSetup(h,p); - -y = y-p.mg-hpan3; - -h.uipanel_S_exportOptions = uipanel('parent',h_pan,'title',ttl3,'units',... - p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... - 'position',[x,y,wpan0,hpan3]); -h = buildPanelSimExportOptions(h,p); +h.uipanel_S_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]); +h = buildPanelScrollSim(h,p); y = p.mg; x = pospan(3)-p.mg-wbut2-p.mg/2-wbut1-p.mg/2-wbut0; diff --git a/MASH-FRET/source/GUI/mod-simulation/buildPanelScrollSim.m b/MASH-FRET/source/GUI/mod-simulation/buildPanelScrollSim.m new file mode 100644 index 00000000..d8790af8 --- /dev/null +++ b/MASH-FRET/source/GUI/mod-simulation/buildPanelScrollSim.m @@ -0,0 +1,64 @@ +function h = buildPanelScrollSim(h,p) + +% default +fact = 5; +htxt0 = 14; +hedit0 = 20; +hpop0 = 22; +wedit0 = 40; +str0 = 'nb. of states (J)'; +ttl0 = 'Video parameters'; +ttl1 = 'Molecules'; +ttl2 = 'Experimental setup'; +ttl3 = 'Export options'; + +% parents +h_pan = h.uipanel_S_scroll; + +% dimensions +pospan = get(h_pan,'position'); +wtxt0 = getUItextWidth(str0,p.fntun,p.fntsz1,'normal',p.tbl); +wspan0 = p.mg+wtxt0+wedit0+p.mg/2+wedit0+p.mg/fact+wedit0+p.mg/fact+wedit0+... + p.mg; +wpan0 = 2*p.mg+wspan0; +hspan0 = p.mgpan+hpop0+p.mg/2+hedit0+p.mg/fact+hedit0+p.mg/fact+hedit0+... + p.mg/2; +hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan0+p.mg/2; +hspan1 = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+5*(1+hedit0)+htxt0+p.mg/2; +hspan2 = p.mgpan+htxt0+hedit0+p.mg/fact+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+... + hedit0+p.mg/2; +hpan1 = p.mgpan+hedit0+p.mg/fact+hedit0+p.mg+hedit0+p.mg/2+hspan1+p.mg/2+... + hspan2+p.mg/2; +hspan3 = p.mgpan+hpop0+p.mg/2+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2; +hpan2 = p.mgpan+htxt0+hedit0+p.mg/2+htxt0+hedit0+p.mg/2+hspan3+p.mg; +hpan3 = p.mgpan+7*hedit0+p.mg/2+hedit0+hpop0+p.mg/2; + +% builds GUI +x = 0; +y = pospan(4)-p.mg/2-hpan0; + +h.uipanel_S_videoParameters = uipanel('parent',h_pan,'title',ttl0,'units',... + p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... + 'position',[x,y,wpan0,hpan0]); +h = buildPanelSimVideoParametes(h,p); + +y = y-p.mg-hpan1; + +h.uipanel_S_molecules = uipanel('parent',h_pan,'title',ttl1,'units',... + p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... + 'position',[x,y,wpan0,hpan1]); +h = buildPanelSimMolecules(h,p); + +y = y-p.mg-hpan2; + +h.uipanel_S_experimentalSetup = uipanel('parent',h_pan,'title',ttl2,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... + 'bold','position',[x,y,wpan0,hpan2]); +h = buildPanelSimExperimentalSetup(h,p); + +y = y-p.mg-hpan3; + +h.uipanel_S_exportOptions = uipanel('parent',h_pan,'title',ttl3,'units',... + p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... + 'position',[x,y,wpan0,hpan3]); +h = buildPanelSimExportOptions(h,p); diff --git a/MASH-FRET/source/GUI/mod-trace-processing/buildPanelScrollTP.m b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelScrollTP.m new file mode 100644 index 00000000..368ed22c --- /dev/null +++ b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelScrollTP.m @@ -0,0 +1,91 @@ +function h = buildPanelScrollTP(h,p) + +% defaults +hedit0 = 20; +htxt0 = 13; +hpop0 = 22; +fact = 5; +ttl1 = 'Plot'; +ttl2 = 'Sub-images'; +ttl3 = 'Background correction'; +ttl4 = 'Cross-talks'; +ttl5 = 'Factor corrections'; +ttl6 = 'Denoising'; +ttl7 = 'Photobleaching'; +ttl8 = 'Find states'; + +% parents +h_pan = h.uipanel_TP_scroll; + +% dimensions +pospan = get(h_pan,'position'); +wpan0 = pospan(3); +hpan1 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hpop0+p.mg/fact+htxt0+hedit0+... + p.mg+hedit0+p.mg; +hpan2 = p.mgpan+3*htxt0+p.mg/fact+htxt0+p.mg/fact+htxt0+hpop0+p.mg; +hpan3 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg/fact+hedit0+... + p.mg/fact+hedit0+p.mg; +hpan4 = p.mgpan+hpop0+p.mg/2+2*(htxt0+hpop0+p.mg/2)+p.mg/2; +hpan5 = p.mgpan+p.mg+p.mg/fact+hpop0+hedit0; +hpan6 = p.mgpan+p.mg+p.mg/fact+2*hpop0+2*htxt0; +hpan7 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg+p.mg/2; +hpan8 = p.mgpan+3*(htxt0+hpop0+p.mg)+htxt0+hedit0+p.mg/fact+hedit0+p.mg+... + htxt0+hpop0+p.mg; + +% GUI +x = 0; +y = pospan(4)-hpan1; + +h.uipanel_TP_plot = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan1],'title',ttl1); +h = buildPanelTPplot(h,p); + +y = y-p.mg-hpan2; + +h.uipanel_TP_subImages = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan2],'title',ttl2); +h = buildPanelTPsubImages(h,p); + +y = y-p.mg-hpan3; + +h.uipanel_TP_backgroundCorrection = uipanel('parent',h_pan,'units',... + p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... + 'position',[x,y,wpan0,hpan3],'title',ttl3); +h = buildPanelTPbackgroundCorrection(h,p); + +y = y-p.mg-hpan4; + +h.uipanel_TP_crossTalks = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan4],'title',ttl4); +h = buildPanelTPcrossTalks(h,p); + +y = y-p.mg-hpan5; + +h.uipanel_TP_denoising = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan5],'title',ttl6); +h = buildPanelTPdenoising(h,p); + +y = y-p.mg-hpan6; + +h.uipanel_TP_photobleaching = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan6],'title',ttl7); +h = buildPanelTPphotobleaching(h,p); + +y = y-p.mg-hpan7; + +h.uipanel_TP_factorCorrections = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan7],'title',ttl5); +h = buildPanelTPfactorCorrections(h,p); + +y = y-p.mg-hpan8; + +h.uipanel_TP_findStates = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan8],'title',ttl8); +h = buildPanelTPfindStates(h,p); diff --git a/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTP.m b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTP.m index ef3321d8..70854e16 100644 --- a/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTP.m +++ b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTP.m @@ -41,14 +41,6 @@ str5 = 'UPDATE ALL'; str6 = 'EXPORT...'; ttl0 = 'Sample management'; -ttl1 = 'Plot'; -ttl2 = 'Sub-images'; -ttl3 = 'Background correction'; -ttl4 = 'Cross-talks'; -ttl5 = 'Factor corrections'; -ttl6 = 'Denoising'; -ttl7 = 'Photobleaching'; -ttl8 = 'Find states'; tabttl0 = 'Traces'; ttstr0 = wrapHtmlTooltipString('Go to previous molecule in the list.'); ttstr1 = wrapHtmlTooltipString('Current molecule index in the list.'); @@ -69,21 +61,12 @@ wbut3 = getUItextWidth(str6,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; wbut5 = getUItextWidth(str1,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbrd; wbut6 = getUItextWidth(str2,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbrd; -wpan1 = 2*p.mg+4*p.mg/fact+2*wedit0+wcb2+wbut5+wbut6; -wtab = pospan(3)-3*p.mg-wpan1; +wpan0 = 2*p.mg+4*p.mg/fact+2*wedit0+wcb2+wbut5+wbut6; +wtab = pospan(3)-3*p.mg-wpan0; htab = pospan(4)-2*p.mg; wtxt0 = pospan(3)-p.mg-wtab-p.mg-2*wbut0+wedit0-p.mg/2-p.mg; -hpan0 = p.mgpan+6*p.mg/fact+2*p.mg+hpop0+6*hedit0+2*htxt0; -hpan1 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hpop0+p.mg+hedit0+p.mg; -hpan2 = p.mgpan+3*htxt0+p.mg/fact+htxt0+p.mg/fact+htxt0+hpop0+p.mg; -hpan3 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg/fact+hedit0+... - p.mg/fact+hedit0+p.mg; -hpan4 = p.mgpan+hpop0+p.mg/2+2*(htxt0+hpop0+p.mg/2)+p.mg/2; -hpan5 = p.mgpan+p.mg+p.mg/fact+hpop0+hedit0; -hpan6 = p.mgpan+p.mg+p.mg/fact+2*hpop0+2*htxt0; -hpan7 = p.mgpan+htxt0+hpop0+p.mg/fact+htxt0+hedit0+p.mg+p.mg/2; -hpan8 = p.mgpan+3*(htxt0+hpop0+p.mg)+htxt0+hedit0+p.mg/fact+hedit0+p.mg+... - htxt0+hpop0+p.mg; +hpan1 = p.mgpan+6*p.mg/fact+2*p.mg+hpop0+6*hedit0+2*htxt0; +hpan0 = pospan(4)-p.mg-hedit0-p.mg/2-hedit0-p.mg-hpan1-2*p.mg; % GUI x = p.mg; @@ -98,72 +81,21 @@ tabttl0); h = buildTPtabPlotTraces(h,p); -x = x+wtab+p.mg; +x = x+p.mg+wtab; y = pospan(4)-p.mg-hpan0; -h.uipanel_TP_sampleManagement = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan0],'title',ttl0); -h = buildPanelTPsampleManagement(h,p); +h.uipanel_TP_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]); +h = buildPanelScrollTP(h,p); y = y-p.mg-hpan1; -h.uipanel_TP_plot = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan1],'title',ttl1); -h = buildPanelTPplot(h,p); - -y = y-p.mg-hpan2; - -h.uipanel_TP_subImages = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan2],'title',ttl2); -h = buildPanelTPsubImages(h,p); - -y = y-p.mg-hpan3; - -h.uipanel_TP_backgroundCorrection = uipanel('parent',h_pan,'units',... - p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... - 'position',[x,y,wpan1,hpan3],'title',ttl3); -h = buildPanelTPbackgroundCorrection(h,p); - -y = y-p.mg-hpan4; - -h.uipanel_TP_crossTalks = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan4],'title',ttl4); -h = buildPanelTPcrossTalks(h,p); - -y = y-p.mg-hpan5; - -h.uipanel_TP_denoising = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan5],'title',ttl6); -h = buildPanelTPdenoising(h,p); - -y = y-p.mg-hpan6; - -h.uipanel_TP_photobleaching = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan6],'title',ttl7); -h = buildPanelTPphotobleaching(h,p); - -y = y-p.mg-hpan7; - -h.uipanel_TP_factorCorrections = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan7],'title',ttl5); -h = buildPanelTPfactorCorrections(h,p); - -y = y-p.mg-hpan8; - -h.uipanel_TP_findStates = uipanel('parent',h_pan,'units',p.posun,... +h.uipanel_TP_sampleManagement = uipanel('parent',h_pan,'units',p.posun,... 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan1,hpan8],'title',ttl8); -h = buildPanelTPfindStates(h,p); + [x,y,wpan0,hpan1],'title',ttl0); +h = buildPanelTPsampleManagement(h,p); -x = p.mg+wtab+p.mg; -y = p.mg+hedit0+p.mg/2; +y = p.mg+hedit0+p.mg; h.pushbutton_molPrev = uicontrol('style','pushbutton','parent',h_pan,... 'units',p.posun,'position',[x,y,wbut0,hedit0],'tooltipstring',ttstr0,... diff --git a/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTPplot.m b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTPplot.m index 538f3c9f..f5a71cdf 100644 --- a/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTPplot.m +++ b/MASH-FRET/source/GUI/mod-trace-processing/buildPanelTPplot.m @@ -29,12 +29,18 @@ str3 = {'Select a channel'}; str4 = 'bottom data'; str5 = {'Select a trace'}; +str6 = 'hold scale'; +str7 = 'min'; +str8 = 'max'; str9 = 'x-axis:'; str10 = 'hold start'; ttstr0 = wrapHtmlTooltipString('Select a laser wavelength to show intensity-time traces from, in the top plot.'); ttstr1 = wrapHtmlTooltipString('Select an emission channel to show ntensity-time traces from, in the top plot.'); ttstr2 = wrapHtmlTooltipString('Select the ratio-time traces to show in the bottom plot.'); -ttstr5 = wrapHtmlTooltipString('Clip traces of all molecules to the defined starting point: data points below this frame will be ignored.'); +ttstr3 = wrapHtmlTooltipString('Hold limits of intensity axis for all molecules to the defined intensities.'); +ttstr4 = wrapHtmlTooltipString('Lower limit of intensity axis.'); +ttstr5 = wrapHtmlTooltipString('Upper limit of intensity axis.'); +ttstr6 = wrapHtmlTooltipString('Clip time axis of traces for all molecules to the defined starting point: data points prior this time point will be ignored.'); ttstr7 = wrapHtmlTooltipString('Starting point in time traces: data points below this frame will be ignored.'); % parents @@ -46,8 +52,10 @@ wtxt0 = (pospan(3)-2*p.mg-p.mg/fact)/2; wtxt1 = pospan(3)-2*p.mg; wtxt3 = getUItextWidth(str9,p.fntun,p.fntsz1,'bold',p.tbl); -wcb2 = getUItextWidth(str10,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; -wedit0 = pospan(3)-2*p.mg-2*p.mg/fact-wcb2-wtxt3; +wcb0 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; +wedit0 = (pospan(3)-2*p.mg-2*p.mg/fact-wcb0)/2; +wcb1 = getUItextWidth(str10,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; +wedit1 = pospan(3)-2*p.mg-2*p.mg/fact-wcb1-wtxt3; % GUI x = p.mg; @@ -79,7 +87,42 @@ {@popupmenu_plotTop_Callback,h_fig}); x = p.mg; -y = y-p.mg/fact-htxt0; +y = y-p.mg/fact-htxt0-hedit0; + +h.checkbox_plot_holdint = uicontrol('style','checkbox','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... + [x,y,wcb0,hedit0],'string',str6,'tooltipstring',ttstr3,'callback',... + {@checkbox_plot_holdint_Callback,h_fig}); + +x = x+wcb0+p.mg/fact; + +h.edit_plot_minint = uicontrol('style','edit','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... + [x,y,wedit0,hedit0],'tooltipstring',ttstr4,'callback',... + {@edit_plot_minint_Callback,h_fig}); + +y = y+hedit0; + +h.text_plot_minint = uicontrol('style','text','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... + [x,y,wedit0,htxt0],'string',str7); + +x = x+wedit0+p.mg/fact; +y = y-hedit0; + +h.edit_plot_maxint = uicontrol('style','edit','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... + [x,y,wedit0,hedit0],'tooltipstring',ttstr5,'callback',... + {@edit_plot_maxint_Callback,h_fig}); + +y = y+hedit0; + +h.text_plot_maxint = uicontrol('style','text','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... + [x,y,wedit0,htxt0],'string',str8); + +x = p.mg; +y = y-hedit0-p.mg/fact-htxt0; h.text_plotBottom = uicontrol('style','text','parent',h_pan,'units',p.posun,... 'fontunits',p.fntun,'fontsize',p.fntsz1,'position',[x,y,wtxt1,htxt0],... @@ -104,13 +147,13 @@ h.checkbox_photobl_fixStart = uicontrol('style','checkbox','parent',h_pan,... 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... - [x,y,wcb2,hedit0],'string',str10,'tooltipstring',ttstr5,'callback',... + [x,y,wcb1,hedit0],'string',str10,'tooltipstring',ttstr6,'callback',... {@checkbox_photobl_fixStart_Callback,h_fig}); -x = x+wcb2+p.mg/fact; +x = x+wcb1+p.mg/fact; h.edit_photobl_start = uicontrol('style','edit','parent',h_pan,'units',... p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'position',... - [x,y,wedit0,hedit0],'callback',{@edit_photobl_start_Callback,h_fig},... + [x,y,wedit1,hedit0],'callback',{@edit_photobl_start_Callback,h_fig},... 'tooltipstring',ttstr7); diff --git a/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelScrollTA.m b/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelScrollTA.m new file mode 100644 index 00000000..692cfc48 --- /dev/null +++ b/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelScrollTA.m @@ -0,0 +1,66 @@ +function h = buildPanelScrollTA(h,p) + +% default +hpop0 = 22; +hbut0 = 20; +hedit0 = 20; +htxt0 = 14; +wedit0 = 40; +fact = 5; +str4 = 'diagonal'; +ttl0 = 'Transition density plot'; +ttl1 = 'State configuration'; +ttl2 = 'Dwell time histograms'; +ttl3 = 'Kinetic model'; + +% parents +h_pan = h.uipanel_TA_scroll; + +% dimensions +pospan = get(h_pan,'position'); +wcb0 = getUItextWidth(str4,p.fntun,p.fntsz1,'normal',p.tbl)+p.wbox; +wpan0a = p.mg+wcb0+p.mg/fact+wcb0+p.mg; +wpan0 = p.mg+wedit0+p.mg/2+wedit0+p.mg+wpan0a+p.mg; +hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+5*hedit0+p.mg/2+hpop0+p.mg/2; +hpan1a = p.mgpan+hpop0+p.mg/2+htxt0+hpop0+p.mg/fact+hedit0+p.mg/2+... + hedit0+p.mg/2+hedit0+p.mg; +hpan1b = p.mgpan+htxt0+hpop0+p.mg/2+hbut0+p.mg; +hpan1 = p.mgpan+hpan1a+p.mg+hpan1b+p.mg; +hpan2a = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+hpop0+p.mg; +hpan2 = p.mgpan+htxt0+hedit0+hedit0/2+p.mg/2+htxt0+hpop0+p.mg/2+hbut0+... + p.mg/2+hpan2a+p.mg; +hpan3a = p.mgpan+htxt0+hpop0+p.mg/2+hbut0+p.mg+htxt0+hpop0+p.mg/2+htxt0+... + hpop0+p.mg/2+htxt0+hpop0+p.mg; +hpan3b = p.mgpan+htxt0+hedit0+(hbut0-hedit0)/2+p.mg; +hpan3 = p.mgpan+hpan3a+p.mg/2+hpan3b+p.mg; + +% GUI +x = 0; +y = pospan(4)-p.mg-hpan0; + +h.uipanel_TA_transitionDensityPlot = uipanel('parent',h_pan,'units',... + p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... + 'position',[x,y,wpan0,hpan0],'title',ttl0); +h = buildPanelTAtransitionDensityPlot(h,p); + +y = y-p.mg-hpan1; + +h.uipanel_TA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan1],'title',ttl1); +h = buildPanelTAstateConfiguration(h,p); + +y = y-p.mg-hpan2; + +h.uipanel_TA_dtHistograms = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan2],'title',ttl2); +h = buildPanelTAdtHistograms(h,p); + +y = y-p.mg-hpan3; + +h.uipanel_TA_kineticModel = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan3],'title',ttl3); +h = buildPanelTAkineticModel(h,p); + diff --git a/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelTA.m b/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelTA.m index 6b6c3cea..b029ea87 100644 --- a/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelTA.m +++ b/MASH-FRET/source/GUI/mod-transition-analysis/buildPanelTA.m @@ -28,7 +28,6 @@ % default hpop0 = 22; -hbut0 = 20; hedit0 = 20; htxt0 = 14; wedit0 = 40; @@ -39,10 +38,6 @@ str3 = {'Select subgroup'}; str4 = 'diagonal'; str7 = 'EXPORT...'; -ttl0 = 'Transition density plot'; -ttl1 = 'State configuration'; -ttl2 = 'Dwell time histograms'; -ttl3 = 'Kinetic model'; tabttl0 = 'TDP'; tabttl1 = 'BIC (ML-GMM)'; tabttl2 = 'Dwell times'; @@ -66,18 +61,7 @@ wtab = pospan(3)-2*p.mg-wpan0-p.mg; htab = pospan(4)-2*p.mg; wpop0 = (wpan0-p.mg/fact)/2; -hpan0 = p.mgpan+htxt0+hedit0+p.mg/2+5*hedit0+p.mg/2+hpop0+p.mg/2; -hpan1a = p.mgpan+hpop0+p.mg/2+htxt0+hpop0+p.mg/fact+hedit0+p.mg/2+... - hedit0+p.mg/2+hedit0+p.mg; -hpan1b = p.mgpan+htxt0+hpop0+p.mg/2+hbut0+p.mg; -hpan1 = p.mgpan+hpan1a+p.mg+hpan1b+p.mg; -hpan2a = p.mgpan+htxt0+hpop0+p.mg/2+htxt0+hpop0+p.mg; -hpan2 = p.mgpan+htxt0+hedit0+hedit0/2+p.mg/2+htxt0+hpop0+p.mg/2+hbut0+... - p.mg/2+hpan2a+p.mg; -hpan3a = p.mgpan+htxt0+hpop0+p.mg/2+hbut0+p.mg+htxt0+hpop0+p.mg/2+htxt0+... - hpop0+p.mg/2+htxt0+hpop0+p.mg; -hpan3b = p.mgpan+htxt0+hedit0+(hbut0-hedit0)/2+p.mg; -hpan3 = p.mgpan+hpan3a+p.mg/2+hpan3b+p.mg; +hpan0 = pospan(4)-p.mgpan-htxt0-hpop0-2*p.mg-hedit0-p.mg; % GUI x = p.mg; @@ -143,31 +127,9 @@ x = p.mg+wtab+p.mg; y = y-p.mg-hpan0; -h.uipanel_TA_transitionDensityPlot = uipanel('parent',h_pan,'units',... - p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold',... - 'position',[x,y,wpan0,hpan0],'title',ttl0); -h = buildPanelTAtransitionDensityPlot(h,p); - -y = y-p.mg-hpan1; - -h.uipanel_TA_stateConfiguration = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan1],'title',ttl1); -h = buildPanelTAstateConfiguration(h,p); - -y = y-p.mg-hpan2; - -h.uipanel_TA_dtHistograms = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan2],'title',ttl2); -h = buildPanelTAdtHistograms(h,p); - -y = y-p.mg-hpan3; - -h.uipanel_TA_kineticModel = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan3],'title',ttl3); -h = buildPanelTAkineticModel(h,p); +h.uipanel_TA_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]); +h = buildPanelScrollTA(h,p); x = pospan(3)-p.mg-wbut0; y = p.mg; diff --git a/MASH-FRET/source/GUI/mod-video-processing/buildPanelScrollVP.m b/MASH-FRET/source/GUI/mod-video-processing/buildPanelScrollVP.m new file mode 100644 index 00000000..771bab23 --- /dev/null +++ b/MASH-FRET/source/GUI/mod-video-processing/buildPanelScrollVP.m @@ -0,0 +1,61 @@ +function h = buildPanelScrollVP(h,p) + +% default +hedit0 = 20; +htxt0 = 14; +hpop0 = 22; +hsld0 = 20; +fact = 5; +ttl0 = 'Plot'; +ttl1 = 'Edit and export video'; +ttl2 = 'Molecule coordinates'; +ttl3 = 'Intensity integration'; + +% parents +h_pan = h.uipanel_VP_scroll; +h_pan0 = h_pan.Parent; + +% dimensions +pospan = get(h_pan,'position'); +pospan0 = get(h_pan0,'position'); +htab0 = pospan0(4)-3*p.mg-hedit0; +wtab0 = htab0-hedit0-2*p.mg-hsld0-p.mg-htxt0; +wpan0 = pospan0(3)-3*p.mg-wtab0; +hpan0 = p.mgpan+hpop0+p.mg; +hpan1 = p.mgpan+hpop0+hedit0+p.mg/2+hpop0+p.mg/fact+hedit0+p.mg/2+hedit0+... + p.mg; +hpan2a = p.mgpan+htxt0+hedit0+p.mg; +hpan2b = p.mgpan+hpop0+p.mg/2+hpop0+p.mg/2+hedit0+p.mg/2+hedit0+p.mg; +hpan2c = p.mgpan+3*hedit0+3*p.mg/2+hedit0+p.mg; +hpan2 = p.mgpan+hpan2a+p.mg/2+hpan2b+p.mg/2+hpan2c+p.mg/2; +hpan3 = p.mgpan+hedit0+p.mg/2+hedit0+p.mg; + +% GUI +x = 0; +y = pospan(4)-p.mg/2-hpan0; + +h.uipanel_VP_plot = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan0],'title',ttl0); +h = buildPanelVPplot(h,p); + +y = y-p.mg/2-hpan1; + +h.uipanel_VP_editAndExportVideo = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan1],'title',ttl1); +h = buildPanelVPeditAndExportVideo(h,p); + +y = y-p.mg/2-hpan2; + +h.uipanel_VP_moleculeCoordinates = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan2],'title',ttl2); +h = buildPanelVPmoleculeCoordinates(h,p); + +y = y-p.mg/2-hpan3; + +h.uipanel_VP_intensityIntegration = uipanel('parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... + [x,y,wpan0,hpan3],'title',ttl3); +h = buildPanelVPintensityIntegration(h,p); \ No newline at end of file diff --git a/MASH-FRET/source/GUI/mod-video-processing/buildPanelVP.m b/MASH-FRET/source/GUI/mod-video-processing/buildPanelVP.m index b4d4ae5d..8ec9c118 100644 --- a/MASH-FRET/source/GUI/mod-video-processing/buildPanelVP.m +++ b/MASH-FRET/source/GUI/mod-video-processing/buildPanelVP.m @@ -24,20 +24,21 @@ % default hedit0 = 20; htxt0 = 14; -hpop0 = 22; hsld0 = 20; fact = 5; -ttl0 = 'Plot'; -ttl1 = 'Edit and export video'; -ttl2 = 'Molecule coordinates'; -ttl3 = 'Intensity integration'; -str0 = 'EXPORT...'; -str1 = 'CALCULATE TRACES'; +gray = [0.93,0.93,0.93]; +str1 = '+'; +str2 = 'Z'; +str3 = 'Tool:'; +str4 = 'EXPORT...'; +str5 = 'CALCULATE TRACES'; tabttl0 = 'Video'; tabttl1 = 'Average image'; tabttl2 = 'Transformed image'; -ttstr0 = wrapHtmlTooltipString('Export intensity-time traces: opens export options.'); -ttstr1 = wrapHtmlTooltipString('Create intensity-time traces using the transformed coordinates.'); +ttstr0 = wrapHtmlTooltipString('Activate "create trace" cursor: clicking on one pixel of the video will create intensity-time traces from this position.'); +ttstr1 = wrapHtmlTooltipString('Activate zoom cursor: regular MATLAB zoom tool.'); +ttstr2 = wrapHtmlTooltipString('Export intensity-time traces: opens export options.'); +ttstr3 = wrapHtmlTooltipString('Create intensity-time traces using the transformed coordinates.'); % parents h_fig = h.figure_MASH; @@ -45,25 +46,21 @@ % dimensions pospan = get(h_pan,'position'); -wbut0 = getUItextWidth(str0,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; -wbut1 = getUItextWidth(str1,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; -htab0 = pospan(4)-2*p.mg; +wbut0 = max([getUItextWidth(str1,p.fntun,p.fntsz1,'bold',p.tbl),... + getUItextWidth(str2,p.fntun,p.fntsz1,'bold',p.tbl)])+p.wbrd; +wbut1 = getUItextWidth(str4,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; +wbut2 = getUItextWidth(str5,p.fntun,p.fntsz1,'bold',p.tbl)+p.wbrd; +wtxt0 = getUItextWidth(str3,p.fntun,p.fntsz1,'normal',p.tbl); +htab0 = pospan(4)-3*p.mg-hedit0; wtab0 = htab0-hedit0-2*p.mg-hsld0-p.mg-htxt0; htab1 = htab0-p.mgtab-p.mg; wtab1 = wtab0-2*p.mg; wpan0 = pospan(3)-3*p.mg-wtab0; -hpan0 = p.mgpan+hpop0+p.mg; -hpan1 = p.mgpan+hpop0+hedit0+p.mg/2+hpop0+p.mg/fact+hedit0+p.mg/2+hedit0+... - p.mg; -hpan2a = p.mgpan+htxt0+hedit0+p.mg; -hpan2b = p.mgpan+hpop0+p.mg/2+hpop0+p.mg/2+hedit0+p.mg/2+hedit0+p.mg; -hpan2c = p.mgpan+3*hedit0+3*p.mg/2+hedit0+p.mg; -hpan2 = p.mgpan+hpan2a+p.mg/2+hpan2b+p.mg/2+hpan2c+p.mg/2; -hpan3 = p.mgpan+hedit0+p.mg/2+hedit0+p.mg; +hpan0 = pospan(4)-2*p.mg-hedit0-p.mg/2; % GUI x = p.mg; -y = p.mg; +y = pospan(4)-p.mg-htab0; h.uitabgroup_VP_plot = uitabgroup('parent',h_pan,'units',p.posun,... 'position',[x,y,wtab0,htab0],'selectionchangedfcn',... @@ -78,6 +75,8 @@ h.uitab_VP_plot_avimg = uitab('parent',h_tabgrp,'units',p.posun,'title',... tabttl1); +y = h.uitab_VP_plot_avimg.Position(4)-p.mg-htab1; + h.uitabgroup_VP_plot_avimg = uitabgroup('parent',h.uitab_VP_plot_avimg,... 'units',p.posun,'position',[x,y,wtab1,htab1],'tablocation','bottom',... 'selectionchangedfcn',... @@ -86,54 +85,58 @@ h.uitab_VP_plot_tr = uitab('parent',h_tabgrp,'units',p.posun,'title',... tabttl2); +y = h.uitab_VP_plot_tr.Position(4)-p.mg-htab1; + h.uitabgroup_VP_plot_tr = uitabgroup('parent',h.uitab_VP_plot_tr,... 'units',p.posun,'position',[x,y,wtab1,htab1],'tablocation','bottom',... 'selectionchangedfcn',... {@uitabgroup_chanPlot_SelectionChangedFcn,h_fig}); -x = x+wtab0+p.mg; -y = pospan(4)-p.mg-hpan0; +x = p.mg+wtab0-p.mg-wbut0; +y = p.mg; -h.uipanel_VP_plot = uipanel('parent',h_pan,'units',p.posun,'fontunits',... - p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan0],'title',ttl0); -h = buildPanelVPplot(h,p); +h.togglebutton_zoom = uicontrol('style','togglebutton','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... + 'bold','position',[x,y,wbut0,hedit0],'string',str2,'callback',... + {@switchMovTool,h_fig},'value',1,'tooltipstring',ttstr1,... + 'backgroundcolor',gray); -y = y-p.mg/2-hpan1; +x = x-p.mg/fact-wbut0; -h.uipanel_VP_editAndExportVideo = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan1],'title',ttl1); -h = buildPanelVPeditAndExportVideo(h,p); +h.togglebutton_target = uicontrol('style','togglebutton','parent',h_pan,... + 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... + 'bold','position',[x,y,wbut0,hedit0],'string',str1,'callback',... + {@switchMovTool,h_fig},'value',0,'tooltipstring',ttstr0,... + 'backgroundcolor',gray); -y = y-p.mg/2-hpan2; +x = x-p.mg/fact-wtxt0; +y = y+(hedit0-htxt0)/2; -h.uipanel_VP_moleculeCoordinates = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan2],'title',ttl2); -h = buildPanelVPmoleculeCoordinates(h,p); +h.text_tool = uicontrol('style','text','parent',h_pan,'units',p.posun,... + 'fontunits',p.fntun,'fontsize',p.fntsz1,'position',[x,y,wtxt0,htxt0],... + 'string',str3); -y = y-p.mg/2-hpan3; +x = p.mg+wtab0+p.mg; +y = pospan(4)-p.mg-hpan0; -h.uipanel_VP_intensityIntegration = uipanel('parent',h_pan,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight','bold','position',... - [x,y,wpan0,hpan3],'title',ttl3); -h = buildPanelVPintensityIntegration(h,p); +h.uipanel_VP_scroll = uipanel('parent',h_pan,'units',p.posun,'fontunits',... + p.fntun,'fontsize',p.fntsz1,'position',[x,y,wpan0,hpan0],'title',[]); +h = buildPanelScrollVP(h,p); -x = pospan(3)-p.mg-wbut0-p.mg-wbut1; +x = pospan(3)-p.mg-wbut1-p.mg-wbut2; y = p.mg/2; h.pushbutton_TTgen_create = uicontrol('style','pushbutton','parent',... h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,... - 'fontweight','bold','position',[x,y,wbut1,hedit0],'string',str1,... - 'tooltipstring',ttstr1,'callback',... + 'fontweight','bold','position',[x,y,wbut2,hedit0],'string',str5,... + 'tooltipstring',ttstr3,'callback',... {@pushbutton_TTgen_create_Callback,h_fig}); -x = x+wbut1+p.mg; +x = x+wbut2+p.mg; h.pushbutton_TTgen_fileOpt = uicontrol('style','pushbutton','parent',... h_pan,'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,... - 'fontweight','bold','position',[x,y,wbut0,hedit0],'string',str0,... - 'tooltipstring',ttstr0,'callback',... + 'fontweight','bold','position',[x,y,wbut1,hedit0],'string',str4,... + 'tooltipstring',ttstr2,'callback',... {@pushbutton_TTgen_fileOpt_Callback,h_fig}); diff --git a/MASH-FRET/source/GUI/mod-video-processing/buildVPtabPlotVid.m b/MASH-FRET/source/GUI/mod-video-processing/buildVPtabPlotVid.m index 62923adc..ae49c8d8 100644 --- a/MASH-FRET/source/GUI/mod-video-processing/buildVPtabPlotVid.m +++ b/MASH-FRET/source/GUI/mod-video-processing/buildVPtabPlotVid.m @@ -11,18 +11,11 @@ % defaults hedit0 = 20; htxt0 = 14; -fact = 5; -gray = [0.93,0.93,0.93]; maxframe = 99999; -str1 = '+'; -str2 = 'Z'; -str3 = 'Tool:'; str4 = 'Frame'; str5 = 'of'; str6 = 's'; str9 = 'Channel splitting:'; -ttstr0 = wrapHtmlTooltipString('Activate "create trace" cursor: clicking on one pixel of the video will create intensity-time traces from this position.'); -ttstr1 = wrapHtmlTooltipString('Activate zoom cursor: regular MATLAB zoom tool.'); % parents h_fig = h.figure_MASH; @@ -30,17 +23,13 @@ % dimensions postab = get(h_tab,'position'); -wbut0 = max([getUItextWidth(str1,p.fntun,p.fntsz1,'bold',p.tbl),... - getUItextWidth(str2,p.fntun,p.fntsz1,'bold',p.tbl)])+p.wbrd; -wtxt2 = getUItextWidth(str3,p.fntun,p.fntsz1,'normal',p.tbl); wtxt3 = getUItextWidth(str4,p.fntun,p.fntsz1,'normal',p.tbl); wtxt4 = getUItextWidth(num2str(maxframe),p.fntun,p.fntsz1,'normal',p.tbl); wtxt5 = getUItextWidth(str6,p.fntun,p.fntsz1,'normal',p.tbl); wtxt6 = getUItextWidth(str5,p.fntun,p.fntsz1,'normal',p.tbl); wtg = postab(3)-2*p.mg; htg = postab(4)-p.mgtab-p.mg-hedit0-p.mg-hedit0-p.mg; -wtxt10 = postab(3)-(p.mg+wtxt3+2*wtxt4+wtxt6+wtxt5+2*p.mg+wtxt2+p.mg/fact+... - wbut0+p.mg/fact+wbut0+p.mg); +wtxt10 = postab(3)-(p.mg+wtxt3+2*wtxt4+wtxt6+wtxt5+2*p.mg); % GUI x = p.mg; @@ -92,26 +81,3 @@ h.text_split = uicontrol('style','text','parent',h_tab,'units',p.posun,... 'fontunits',p.fntun,'fontsize',p.fntsz1,'position',[x,y,wtxt10,htxt0],... 'string',str9,'horizontalalignment','left'); - -x = x+wtxt10+p.mg; - -h.text_tool = uicontrol('style','text','parent',h_tab,'units',p.posun,... - 'fontunits',p.fntun,'fontsize',p.fntsz1,'position',[x,y,wtxt2,htxt0],... - 'string',str3); - -x = x+wtxt2+p.mg/fact; -y = y-(hedit0-htxt0)/2; - -h.togglebutton_target = uicontrol('style','togglebutton','parent',h_tab,... - 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... - 'bold','position',[x,y,wbut0,hedit0],'string',str1,'callback',... - {@switchMovTool,h_fig},'value',0,'tooltipstring',ttstr0,... - 'backgroundcolor',gray); - -x = x+wbut0+p.mg/fact; - -h.togglebutton_zoom = uicontrol('style','togglebutton','parent',h_tab,... - 'units',p.posun,'fontunits',p.fntun,'fontsize',p.fntsz1,'fontweight',... - 'bold','position',[x,y,wbut0,hedit0],'string',str2,'callback',... - {@switchMovTool,h_fig},'value',1,'tooltipstring',ttstr1,... - 'backgroundcolor',gray); diff --git a/MASH-FRET/source/divers/documentation/setInfoIcons.m b/MASH-FRET/source/divers/documentation/setInfoIcons.m index 228378b0..6f6af981 100644 --- a/MASH-FRET/source/divers/documentation/setInfoIcons.m +++ b/MASH-FRET/source/divers/documentation/setInfoIcons.m @@ -77,16 +77,16 @@ case h.uipanel_S_videoParameters hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('video parameters'),obj(o),tbl)); + getDocLink('video parameters'),obj(o))); case h.uipanel_S_molecules hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('molecules'),obj(o),tbl)); + getDocLink('molecules'),obj(o))); case h.uipanel_S_experimentalSetup hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('experimental setup'),obj(o),tbl)); + getDocLink('experimental setup'),obj(o))); case h.uipanel_S_exportOptions hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('sim export options'),obj(o),tbl)); + getDocLink('sim export options'),obj(o))); case h.axes_example_hist hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('sim visualization'),obj(o),[-2,-2])); @@ -102,19 +102,19 @@ getDocLink('project options'),obj(o),[-1,1])); case h.uipanel_VP_plot hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('vp plot'),obj(o),tbl)); + getDocLink('vp plot'),obj(o))); case h.uipanel_VP_editAndExportVideo hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('edit video'),obj(o),tbl)); + getDocLink('edit video'),obj(o))); case h.uipanel_VP_moleculeCoordinates hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('molecule coordinates'),obj(o),tbl)); + getDocLink('molecule coordinates'),obj(o))); case h_pushbutton_trsfOpt_cancel hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('vp import options'),obj(o),[2,1])); case h.uipanel_VP_intensityIntegration hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('intensity integration'),obj(o),tbl)); + getDocLink('intensity integration'),obj(o))); case h_pushbutton_itgFileOpt_cancel hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('vp export options'),obj(o),[-1,1])); @@ -124,7 +124,7 @@ getDocLink('tp import options'),obj(o),[-1,1])); case h.uipanel_TP_sampleManagement hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('sample management'),obj(o),tbl)); + getDocLink('sample management'),obj(o),1)); case h_pushbutton_optExpTr_cancel hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('tp export options'),obj(o),[-1,1])); @@ -133,44 +133,44 @@ getDocLink('trace manager'),obj(o),[2,1])); case h.uipanel_TP_plot hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('tp plot'),obj(o),tbl)); + getDocLink('tp plot'),obj(o))); case h.uipanel_TP_subImages hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('sub-images'),obj(o),tbl)); + getDocLink('sub-images'),obj(o))); case h.uipanel_TP_backgroundCorrection hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('background correction'),obj(o),tbl)); + getDocLink('background correction'),obj(o))); case h_pushbutton_bga_save hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('background analyzer'),obj(o),[2,1])); case h.uipanel_TP_crossTalks hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('cross-talks'),obj(o),tbl)); + getDocLink('cross-talks'),obj(o))); case h.uipanel_TP_denoising hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('denoising'),obj(o),tbl)); + getDocLink('denoising'),obj(o))); case h.uipanel_TP_photobleaching hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('photobleaching'),obj(o),tbl)); + getDocLink('photobleaching'),obj(o))); case h.uipanel_TP_factorCorrections hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('factor corrections'),obj(o),tbl)); + getDocLink('factor corrections'),obj(o))); case h.uipanel_TP_findStates hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('find states'),obj(o),tbl)); + getDocLink('find states'),obj(o))); case h.axes_topRight hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('tp visualization'),obj(o),[-2,-2])); case h.uipanel_HA_histogramAndPlot hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('ha plot'),obj(o),tbl)); + getDocLink('ha plot'),obj(o))); case h.uipanel_HA_stateConfiguration hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('ha state configuration'),obj(o),tbl)); + getDocLink('ha state configuration'),obj(o))); case h.uipanel_HA_statePopulations hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('state populations'),obj(o),tbl)); + getDocLink('state populations'),obj(o))); case h.axes_hist1 hBut = cat(2,hBut,mkbutton(cdata,... getDocLink('ha visualization'),obj(o),[-2,-2])); @@ -180,16 +180,16 @@ getDocLink('ta export options'),obj(o),[-1,1])); case h.uipanel_TA_transitionDensityPlot hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('ta plot'),obj(o),tbl)); + getDocLink('ta plot'),obj(o))); case h.uipanel_TA_stateConfiguration hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('ta state configuration'),obj(o),tbl)); + getDocLink('ta state configuration'),obj(o))); case h.uipanel_TA_dtHistograms hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('dt histograms'),obj(o),tbl)); + getDocLink('dt histograms'),obj(o))); case h.uipanel_TA_kineticModel hBut = cat(2,hBut,mkbutton(cdata,... - getDocLink('kinetic model'),obj(o),tbl)); + getDocLink('kinetic model'),obj(o))); end end @@ -210,14 +210,14 @@ % Positionning respects the following margins: % _____ _____ % | 1, 2| |-2, 2| -% _____ ____________________ _____ -% |-1,-2| | _____ _____ | | 2,-2| -% | | 1,-2| |-2,-2| | +% _____ ____________________ _____ +% |-1,-2|| 1,-2| |-2,-2|| 2,-2| +% | | % | | % | REFERENCE OBJECT | -% | _____ _____ | -% _____ | | 1, 1| |-2, 1| | _____ -% |-1, 1| |____________________| | 2, 1| +% | | +% _____ |_____ _____| _____ +% |-1, 1|| 1, 1|________|-2, 1|| 2, 1| % _____ _____ % | 1,-1| |-2,-1| @@ -229,7 +229,12 @@ posObj = getPixPos(obj); if strcmp(obj.Type,'uipanel') - x = posObj(1) + posObj(3) - 2*w_but - mg; + if ~isempty(varargin) + fact = varargin{1}; % regular panel + else + fact = 2; % collapsable panel (next to collapse button) + end + x = posObj(1) + posObj(3) - fact*w_but - mg; y = posObj(2) + posObj(4) - h_but; else diff --git a/MASH-FRET/source/divers/panels/collapsePanel.m b/MASH-FRET/source/divers/panels/collapsePanel.m index 00d909f7..f8965322 100644 --- a/MASH-FRET/source/divers/panels/collapsePanel.m +++ b/MASH-FRET/source/divers/panels/collapsePanel.m @@ -19,10 +19,12 @@ function collapsePanel(hbut) % get parent and corresponding pixel height hprnt = hpans(1).Parent; -hght_prnt = hprnt.Position(4); -hfig = hprnt.Parent; -posfig = getPixPos(hfig); -hght_prnt = hght_prnt*posfig(4); +% hght_prnt = hprnt.Position(4); +% hfig = hprnt.Parent; +% posfig = getPixPos(hfig); +% hght_prnt = hght_prnt*posfig(4); +posprnt = getPixPos(hprnt); +hght_prnt = posprnt(4); % get handles to all children panels and collapse/expand buttons hchld = hprnt.Children; @@ -97,7 +99,7 @@ function collapsePanel(hbut) % set panel position relative to top panels if c==1 % toppest panel - y = hcpan(c).Position(2)+hcpan(c).Position(4)-hght; + y = hght_prnt-mgy/2-hght; else y = hcpan(c-1).Position(2)-mgy-hght; end diff --git a/MASH-FRET/source/divers/panels/expandPanel.m b/MASH-FRET/source/divers/panels/expandPanel.m index ad6ee740..4aa5638c 100644 --- a/MASH-FRET/source/divers/panels/expandPanel.m +++ b/MASH-FRET/source/divers/panels/expandPanel.m @@ -19,12 +19,20 @@ function expandPanel(hbut) % get parent and corresponding height (normalized) hprnt = hpan.Parent; -hght_prnt = hprnt.Position(4); - +% hght_prnt = hprnt.Position(4); +% % convert normalized to pixel heights -hfig = hprnt.Parent; -posfig = getPixPos(hfig); -hght_prnt = hght_prnt*posfig(4); +% hfig = hprnt.Parent; +% lvl = 1; +% while ~strcmp(hfig.Type,'figure') +% hfig = hprnt.Parent; +% lvl = lvl+1; +% end +% posfig = getPixPos(hfig); +% hght_prnt = hght_prnt*posfig(4); +% hght_pan = hght_pan*hght_prnt; +posprnt = getPixPos(hprnt); +hght_prnt = posprnt(4); hght_pan = hght_pan*hght_prnt; % get handles to all children panels and collapse/expand buttons @@ -94,6 +102,15 @@ function expandPanel(hbut) set(hpan,'bordertype','etchedin','backgroundcolor',clr_expnd); hght = hght_pan; hcbut(c).String = char(9650); + if c>1 && (hcpan(c-1).Position(2)-mg-hght)<0 + yoffset = hght+mg-hcpan(c-1).Position(2); + for cprev = 1:(c-1) + hcpan(cprev).Position(2) = ... + hcpan(cprev).Position(2)+yoffset; + hcbut(cprev).Position(2) = hcpan(cprev).Position(2); + hchlp(cprev).Position(2) = hcpan(cprev).Position(2); + end + end else set(hcpan(c),'bordertype','none','backgroundcolor',clr_cllps); hght = hght_cllps; @@ -102,7 +119,7 @@ function expandPanel(hbut) % set panel position relative to top panels if c==1 % toppest panel - y = hcpan(c).Position(2)+hcpan(c).Position(4)-hght; + y = hght_prnt-mg/2-hght; else y = hcpan(c-1).Position(2)-mg-hght; end diff --git a/MASH-FRET/source/divers/panels/getExpandPanelId.m b/MASH-FRET/source/divers/panels/getExpandPanelId.m index be3e6fd9..1103fefa 100644 --- a/MASH-FRET/source/divers/panels/getExpandPanelId.m +++ b/MASH-FRET/source/divers/panels/getExpandPanelId.m @@ -17,8 +17,8 @@ h = guidata(h_fig); % gather module main panels -h_modpan = [h.uipanel_S,h.uipanel_VP,h.uipanel_TP,h.uipanel_HA,... - h.uipanel_TA]; +h_modpan = [h.uipanel_S_scroll,h.uipanel_VP_scroll,h.uipanel_TP_scroll,... + h.uipanel_HA_scroll,h.uipanel_TA_scroll]; % get button index butid0 = find(h.pushbutton_panelCollapse==h_but,true); diff --git a/MASH-FRET/source/divers/panels/getHandlePanelExpandButton.m b/MASH-FRET/source/divers/panels/getHandlePanelExpandButton.m index 7cf0d3b2..4b9d21b2 100644 --- a/MASH-FRET/source/divers/panels/getHandlePanelExpandButton.m +++ b/MASH-FRET/source/divers/panels/getHandlePanelExpandButton.m @@ -18,8 +18,8 @@ h = guidata(h_fig); % gather module main panels -h_modpan = [h.uipanel_S,h.uipanel_VP,h.uipanel_TP,h.uipanel_HA,... - h.uipanel_TA]; +h_modpan = [h.uipanel_S_scroll,h.uipanel_VP_scroll,h.uipanel_TP_scroll,... + h.uipanel_HA_scroll,h.uipanel_TA_scroll]; if ~iscell(opt) % control parent panel diff --git a/MASH-FRET/source/divers/panels/prepPanel.m b/MASH-FRET/source/divers/panels/prepPanel.m index 8685c0fc..24e086e6 100644 --- a/MASH-FRET/source/divers/panels/prepPanel.m +++ b/MASH-FRET/source/divers/panels/prepPanel.m @@ -17,20 +17,22 @@ prnt = get(h_pan,'parent'); while prnt~=h.figure_MASH if ~any([h.uipanel_S,h.uipanel_VP,h.uipanel_TP,h.uipanel_HA,... - h.uipanel_TA]==prnt) + h.uipanel_TA,h.uipanel_S_scroll,h.uipanel_VP_scroll,... + h.uipanel_TP_scroll,h.uipanel_HA_scroll,... + h.uipanel_TA_scroll]==prnt) prnt = get(prnt,'parent'); continue end switch prnt - case h.uipanel_S + case {h.uipanel_S_scroll,h.uipanel_S} mod = 'sim'; - case h.uipanel_VP + case {h.uipanel_VP_scroll,h.uipanel_VP} mod = 'VP'; - case h.uipanel_TP + case {h.uipanel_TP_scroll,h.uipanel_TP} mod = 'TP'; - case h.uipanel_HA + case {h.uipanel_HA_scroll,h.uipanel_HA} mod = 'HA'; - case h.uipanel_TA + case {h.uipanel_TA_scroll,h.uipanel_TA} mod = 'TA'; end if ~isModuleOn(p,mod) diff --git a/MASH-FRET/source/divers/panels/ud_extendedPanel.m b/MASH-FRET/source/divers/panels/ud_extendedPanel.m index 2ca464d4..df6e6774 100644 --- a/MASH-FRET/source/divers/panels/ud_extendedPanel.m +++ b/MASH-FRET/source/divers/panels/ud_extendedPanel.m @@ -10,75 +10,17 @@ function ud_extendedPanel(h_but,h_fig) for b = h_but switch b.UserData{1}.Parent - case h.uipanel_S + case h.uipanel_S_scroll ud_S_panels(h_fig); - case h.uipanel_VP + case h.uipanel_VP_scroll ud_VP_panels(h_fig); - case h.uipanel_TP + case h.uipanel_TP_scroll ud_TP_panels(h_fig); - case h.uipanel_HA + case h.uipanel_HA_scroll ud_HA_panels(h_fig); - case h.uipanel_TA + case h.uipanel_TA_scroll ud_TA_panels(h_fig); otherwise disp('ud_extendedPanel: unknown extendable panel.'); end - -% switch b.UserData{1} -% case h.uipanel_S_videoParameters -% ud_S_vidParamPan(h_fig); -% case h.uipanel_S_molecules -% ud_S_moleculesPan(h_fig); -% case h.uipanel_S_experimentalSetup -% ud_S_expSetupPan(h_fig); -% case h.uipanel_S_exportOptions -% ud_S_expOptPan(h_fig); -% -% case h.uipanel_VP_experimentSettings -% ud_VP_expSetPan(h_fig); -% case h.uipanel_VP_editAndExportVideo -% ud_VP_edExpVidPan(h_fig); -% case h.uipanel_VP_moleculeCoordinates -% ud_VP_molCoordPan(h_fig); -% case h.uipanel_VP_intensityIntegration -% ud_VP_intIntegrPan(h_fig); -% -% case h.uipanel_TP_sampleManagement -% ud_trSetTbl(h_fig); -% case h.uipanel_TP_plot -% ud_plot(h_fig); -% case h.uipanel_TP_subImages -% ud_subImg(h_fig); -% case h.uipanel_TP_backgroundCorrection -% ud_ttBg(h_fig); -% case h.uipanel_TP_crossTalks -% ud_cross(h_fig); -% case h.uipanel_TP_denoising -% ud_denoising(h_fig); -% case h.uipanel_TP_photobleaching -% ud_bleach(h_fig); -% case h.uipanel_TP_factorCorrections -% ud_factors(h_fig); -% case h.uipanel_TP_findStates -% ud_DTA(h_fig); -% -% case h.uipanel_HA_histogramAndPlot -% ud_thmPlot(h_fig); -% case h.uipanel_HA_stateConfiguration -% ud_HA_stateConfig(h_fig); -% case h.uipanel_HA_statePopulations -% ud_HA_statePop(h_fig); -% -% case h.uipanel_TA_transitionDensityPlot -% ud_TDPplot(h_fig); -% case h.uipanel_TA_stateConfiguration -% ud_TDPmdlSlct(h_fig); -% case h.uipanel_TA_dtHistograms -% ud_kinFit(h_fig); -% case h.uipanel_TA_kineticModel -% ud_kinMdl(h_fig) -% -% otherwise -% disp('ud_extendedPanel: unknown extendable panel.'); -% end end diff --git a/MASH-FRET/source/initMASH.m b/MASH-FRET/source/initMASH.m index 3c4cd8fb..551354d3 100644 --- a/MASH-FRET/source/initMASH.m +++ b/MASH-FRET/source/initMASH.m @@ -32,8 +32,7 @@ function initMASH(h_fig) h.uipanel_S_experimentalSetup,h.uipanel_S_exportOptions]; h_VPpan = [h.uipanel_VP_plot,h.uipanel_VP_editAndExportVideo,... h.uipanel_VP_moleculeCoordinates,h.uipanel_VP_intensityIntegration]; -h_TPpan = [h.uipanel_TP_sampleManagement,... - h.uipanel_TP_plot,h.uipanel_TP_subImages,... +h_TPpan = [h.uipanel_TP_plot,h.uipanel_TP_subImages,... h.uipanel_TP_backgroundCorrection,h.uipanel_TP_crossTalks,... h.uipanel_TP_denoising,h.uipanel_TP_photobleaching,... h.uipanel_TP_factorCorrections,h.uipanel_TP_findStates]; @@ -42,7 +41,8 @@ function initMASH(h_fig) h_TApan = [h.uipanel_TA_transitionDensityPlot,... h.uipanel_TA_stateConfiguration,h.uipanel_TA_dtHistograms,... h.uipanel_TA_kineticModel]; -h_mainPan = [h_Span,h_VPpan,h_TPpan,h_HApan,h_TApan]; +h_mainPan = [h_Span,h_VPpan,h_TPpan,h.uipanel_TP_sampleManagement,... + h_HApan,h_TApan]; h.pushbutton_help = setInfoIcons([h_mainPan,h.axes_example_hist,... h.pushbutton_saveProj,h.axes_topRight,h.axes_hist1],h_fig,... h.param.infos_icon_file,h.charDimTable); diff --git a/MASH-FRET/source/mod-histogram-analysis/_callbacks/checkbox_thm_BS_Callback.m b/MASH-FRET/source/mod-histogram-analysis/_callbacks/checkbox_thm_BS_Callback.m index 4165bb89..e6fd6103 100644 --- a/MASH-FRET/source/mod-histogram-analysis/_callbacks/checkbox_thm_BS_Callback.m +++ b/MASH-FRET/source/mod-histogram-analysis/_callbacks/checkbox_thm_BS_Callback.m @@ -9,9 +9,9 @@ function checkbox_thm_BS_Callback(obj, evd, h_fig) tpe = p.thm.curr_tpe(proj); tag = p.thm.curr_tag(proj); -p.proj{proj}.HA.prm{tag,tpe}.thm_start{1}(2) = get(obj, 'Value'); -p.proj{proj}.HA.prm{tag,tpe}.thm_res(1,1:3) = {[] [] []}; -p.proj{proj}.HA.prm{tag,tpe}.thm_res(2,1:3) = {[] [] []}; +p.proj{proj}.HA.curr{tag,tpe}.thm_start{1}(2) = get(obj, 'Value'); +p.proj{proj}.HA.curr{tag,tpe}.thm_res(1,1:3) = {[] [] []}; +p.proj{proj}.HA.curr{tag,tpe}.thm_res(2,1:3) = {[] [] []}; h.param = p; guidata(h_fig, h); diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_TP_selectMol_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_TP_selectMol_Callback.m index ebc35b48..41772dba 100644 --- a/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_TP_selectMol_Callback.m +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_TP_selectMol_Callback.m @@ -14,6 +14,12 @@ function checkbox_TP_selectMol_Callback(obj, evd, h_fig) end end +% reset HA and TA +p = importHA(p,p.curr_proj); +p = importTA(p,p.curr_proj); + h.param = p; guidata(h_fig, h); updateFields(h_fig, 'ttPr'); +ud_HA_histDat(h_fig); +ud_TDPdata(h_fig); diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_plot_holdint_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_plot_holdint_Callback.m new file mode 100644 index 00000000..a4b119a8 --- /dev/null +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/checkbox_plot_holdint_Callback.m @@ -0,0 +1,16 @@ +function checkbox_plot_holdint_Callback(obj,evd,h_fig) + +% retrieve project data +h = guidata(h_fig); +p = h.param; +proj = p.curr_proj; + +% modify parameter "hold intensity scale" +p.proj{proj}.TP.fix{2}(7) = get(obj,'value'); + +% save modification to project data +h.param = p; +guidata(h_fig,h); + +% update interface +updateFields(h_fig,'ttPr'); \ No newline at end of file diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_maxint_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_maxint_Callback.m new file mode 100644 index 00000000..a28835ac --- /dev/null +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_maxint_Callback.m @@ -0,0 +1,35 @@ +function edit_plot_maxint_Callback(obj,evd,h_fig) + +% defaults +red = [1 0.75 0.75]; + +% get "lower intensity" value +maxI = str2double(obj.String); + +% retrieve project data +h = guidata(h_fig); +p = h.param; +proj = p.curr_proj; +minI = p.proj{proj}.TP.fix{2}(4); + +% check for proper format +if ~(numel(maxI)==1 && ~isnan(maxI)) + set(obj,'backgroundcolor',red); + setContPan('Upper intensity must be a number.','error',h_fig); + return + +elseif maxI<=minI + setContPan(['Upper intensity can not be smaller than the lower limit ',... + '(',num2str(minI),').'],'warning',h_fig); + maxI = minI+10; +end + +% modify parameter "lower intensity" +p.proj{proj}.TP.fix{2}(5) = maxI; + +% save modification to project data +h.param = p; +guidata(h_fig,h); + +% update interface +updateFields(h_fig,'ttPr'); diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_minint_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_minint_Callback.m new file mode 100644 index 00000000..9ff38b37 --- /dev/null +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/edit_plot_minint_Callback.m @@ -0,0 +1,35 @@ +function edit_plot_minint_Callback(obj,evd,h_fig) + +% defaults +red = [1 0.75 0.75]; + +% get "lower intensity" value +minI = str2double(obj.String); + +% retrieve project data +h = guidata(h_fig); +p = h.param; +proj = p.curr_proj; +maxI = p.proj{proj}.TP.fix{2}(5); + +% check for proper format +if ~(numel(minI)==1 && ~isnan(minI)) + set(obj,'backgroundcolor',red); + setContPan('Lower intensity must be a number.','error',h_fig); + return + +elseif minI>=maxI + setContPan(['Lower intensity can not be higher than the upper limit (',... + num2str(maxI),').'],'warning',h_fig); + minI = maxI-10; +end + +% modify parameter "lower intensity" +p.proj{proj}.TP.fix{2}(4) = minI; + +% save modification to project data +h.param = p; +guidata(h_fig,h); + +% update interface +updateFields(h_fig,'ttPr'); diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/listbox_TP_defaultTags_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/listbox_TP_defaultTags_Callback.m index 82b5a866..f69a7563 100644 --- a/MASH-FRET/source/mod-trace-processing/_callbacks/listbox_TP_defaultTags_Callback.m +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/listbox_TP_defaultTags_Callback.m @@ -20,6 +20,10 @@ function listbox_TP_defaultTags_Callback(obj, evd, h_fig) end end +% reset HA and TA +p = importHA(p,p.curr_proj); +p = importTA(p,p.curr_proj); + h.param = p; guidata(h_fig,h); @@ -28,3 +32,5 @@ function listbox_TP_defaultTags_Callback(obj, evd, h_fig) set(obj,'visible','off'); ud_trSetTbl(h_fig); +ud_HA_histDat(h_fig); +ud_TDPdata(h_fig); diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_deleteTag_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_deleteTag_Callback.m index a5beb36d..403131c1 100644 --- a/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_deleteTag_Callback.m +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_deleteTag_Callback.m @@ -33,10 +33,16 @@ function pushbutton_TP_deleteTag_Callback(obj, evd, h_fig) end end +% reset HA and TA +p = importHA(p,p.curr_proj); +p = importTA(p,p.curr_proj); + h.param = p; guidata(h_fig,h); ud_trSetTbl(h_fig); +ud_HA_histDat(h_fig); +ud_TDPdata(h_fig); % show success setContPan(['Molecule ',num2str(mol),' successfully untagged!'],'success',... diff --git a/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_updateAll_Callback.m b/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_updateAll_Callback.m index a5a5ed0e..a786c123 100644 --- a/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_updateAll_Callback.m +++ b/MASH-FRET/source/mod-trace-processing/_callbacks/pushbutton_TP_updateAll_Callback.m @@ -1,4 +1,11 @@ function pushbutton_TP_updateAll_Callback(obj, evd, h_fig) +% pushbutton_TP_updateAll_Callback([],[],h_fig) +% pushbutton_TP_updateAll_Callback(opt0,[],h_fig) +% +% h_fig: handle to main figure +% opt0: string indicating the most advanced stage to which the analysis +% must start. + % Last update by MH, 14.1.2020: separate trace update into 3 successive processes (1) update all intensity correction (2) calculate gamma factors (3) discretize traces; this allows stable ES histogram for linear regression diff --git a/MASH-FRET/source/mod-trace-processing/management/downCompatibilityTP.m b/MASH-FRET/source/mod-trace-processing/management/downCompatibilityTP.m index a512aa7c..bd4402ce 100644 --- a/MASH-FRET/source/mod-trace-processing/management/downCompatibilityTP.m +++ b/MASH-FRET/source/mod-trace-processing/management/downCompatibilityTP.m @@ -240,3 +240,9 @@ p_proj.TP.prm{n}{3}{1} = cat(3,p_proj.TP.prm{n}{3}{1},... zeros(size(p_proj.TP.prm{n}{3}{1}))); end + +% added by MH, 31.10.2023: add intensity axis scale +if size(p_proj.TP.fix,2)>=2 && numel(p_proj.TP.fix{2})==7 && ... + p_proj.TP.fix{2}(4)==p_proj.TP.fix{2}(5) + p_proj.TP.fix{2}([4,5,7]) = p_proj.TP.def.general{2}([4,5,7]); +end diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelAutoSorting.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelAutoSorting.m index 22149e23..bd2fc776 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelAutoSorting.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelAutoSorting.m @@ -34,7 +34,7 @@ posfig = get(q.figure_traceMngr,'position'); wpop = 3*p.wedit+2*p.mg/2; wpan = 0.5*wpop + 2*p.wedit + p.wtxt3 + 2.5*p.mg; -hpan1 = p.mgbig+2*(p.htxt+p.hpop+p.mg/2+p.htxt+p.hedit+p.mg); +hpan1 = p.mgbig+2*(p.htxt+p.hpop+p.mg/2+p.htxt+p.hedit+p.mg)+p.mg/2+p.hcb; hpan2 = p.mgbig+p.htxt+p.hedit+p.mg+p.htxt+p.mg/2+p.hpop+p.mg/2+p.hpop+... p.mg/2+p.htxt+p.mgbig+p.htxt+p.mg+p.hbut+p.mg; hpan3 = pospan(4)-2*p.mg-hpan1-p.mg-hpan2-p.mg-2*p.mg; diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelData.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelData.m index 7a377303..428f29e3 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelData.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildPanelData.m @@ -20,16 +20,20 @@ str8 = 'y min'; str9 = 'y max'; str10 = 'nbins'; -ttstr0 = 'Select the data to represent on the x-axis of the histogram'; -ttstr1 = 'Select the value to histogram on the x-axis of the histogram'; -ttstr2 = 'Lower bound of x-axis'; -ttstr3 = 'Upper bound of x-axis'; -ttstr4 = 'Number of binning intervals in x-axis'; -ttstr5 = 'Select the data to represent on the y-axis of the 2D-histogram'; -ttstr6 = 'Select the value to histogram on the y-axis of the 2D-histogram'; -ttstr7 = 'Lower bound of y-axis'; -ttstr8 = 'Upper bound of y-axis'; -ttstr9 = 'Number of binning intervals in y-axis'; +str11 = 'gauss.'; +str12 = 'single count'; +ttstr0 = wrapHtmlTooltipString('Select the data to represent on the x-axis of the histogram'); +ttstr1 = wrapHtmlTooltipString('Select the value to histogram on the x-axis of the histogram'); +ttstr2 = wrapHtmlTooltipString('Lower bound of x-axis'); +ttstr3 = wrapHtmlTooltipString('Upper bound of x-axis'); +ttstr4 = wrapHtmlTooltipString('Number of binning intervals in x-axis'); +ttstr5 = wrapHtmlTooltipString('Select the data to represent on the y-axis of the 2D-histogram'); +ttstr6 = wrapHtmlTooltipString('Select the value to histogram on the y-axis of the 2D-histogram'); +ttstr7 = wrapHtmlTooltipString('Lower bound of y-axis'); +ttstr8 = wrapHtmlTooltipString('Upper bound of y-axis'); +ttstr9 = wrapHtmlTooltipString('Number of binning intervals in y-axis'); +ttstr10 = wrapHtmlTooltipString('Data count: when activated, data values appearing multiple times in the same trajectories are counted once, otherwise it is counted as many times as it appear in each trajectory; single data count allows to scale equally the rapid and slow state interconversions in the TDP.'); +ttstr11 = wrapHtmlTooltipString('Gaussian filter: when activated, the TDP is convoluted with a 2D Gaussian; Gaussian convolution eases the identification of transition clusters.'); % parent h_pan = q.uipanel_data; @@ -38,6 +42,8 @@ pospan = get(h_pan,'position'); wpop2 = (pospan(3)-2*p.mg-p.mg/fact)/2; wedit2 = (pospan(3)-2*p.mg-2*p.mg/fact)/3; +wcb0 = getUItextWidth(str11,p.fntun,p.fntsz,'normal',p.tbl)+p.wbox; +wcb1 = pospan(3)-wcb0-2*p.mg; % list strings str_pop = getStrPlot_overall(h_fig); @@ -182,4 +188,19 @@ 'fontunits',p.fntun,'fontsize',p.fntsz,'enable','off','callback',... {@edit_yniv_Callback,h_fig}); +x = p.mg; +y = y-p.mg/2-p.hcb; + +q.checkbox_AS_gauss = uicontrol('style','checkbox','parent',h_pan,'units',... + p.posun,'string',str11,'tooltipstring',ttstr10,'position',... + [x,y,wcb0,p.hcb],'fontunits',p.fntun,'fontsize',p.fntsz,'enable','off',... + 'callback',{@checkbox_AS_gauss_Callback,h_fig}); + +x = x+wcb0; + +q.checkbox_AS_datcnt = uicontrol('style','checkbox','parent',h_pan,'units',... + p.posun,'string',str12,'tooltipstring',ttstr11,'position',... + [x,y,wcb1,p.hcb],'fontunits',p.fntun,'fontsize',p.fntsz,'enable','off',... + 'callback',{@checkbox_AS_datcnt_Callback,h_fig}); + diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildTraceManager.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildTraceManager.m index 7cb94e03..74df9764 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildTraceManager.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/GUI/buildTraceManager.m @@ -37,6 +37,7 @@ wtxt3 = 32; % small text x-dimension wbrd = 4; warr = 20; +wbox = 15; % box width in checkboxes str0 = 'Overview'; str1 = 'Auto sorting'; str2 = 'View on video'; @@ -48,7 +49,7 @@ fntun,'fntsz',fntsz,'hpop',hpop,'hbut',hbut,'hbut2',hbut2,'hcb',hcb,... 'hedit',hedit,'htxt',htxt,'wedit',wedit,'wcb',wcb,'wcb2',wcb2,'wtxt1',... wtxt1,'wtxt2',wtxt2,'wtxt3',wtxt3,'wbut2',wbut2,'defNperPage',... - defNperPage,'wbrd',wbrd,'warr',warr); + defNperPage,'wbrd',wbrd,'warr',warr,'wbox',wbox); % get reference table lisitng character widths h = guidata(h_fig); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_datcnt_Callback.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_datcnt_Callback.m new file mode 100644 index 00000000..f78c372b --- /dev/null +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_datcnt_Callback.m @@ -0,0 +1,6 @@ +function checkbox_AS_datcnt_Callback(obj,evd,h_fig) + +set(obj,'userdata',get(obj,'value')); + +plotData_autoSort(h_fig); +ud_panRanges(h_fig); \ No newline at end of file diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_gauss_Callback.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_gauss_Callback.m new file mode 100644 index 00000000..a524b21c --- /dev/null +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/checkbox_AS_gauss_Callback.m @@ -0,0 +1,6 @@ +function checkbox_AS_gauss_Callback(obj,evd,h_fig) + +set(obj,'userdata',get(obj,'value')); + +plotData_autoSort(h_fig); +ud_panRanges(h_fig); \ No newline at end of file diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/menu_export_Callback.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/menu_export_Callback.m index 4b39ab88..ac82c77e 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/menu_export_Callback.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/_callbacks/menu_export_Callback.m @@ -22,10 +22,15 @@ function menu_export_Callback(obj, evd, h_fig) p = h.param; proj = p.curr_proj; -% added by MH, 13.1.2020: reset ES histograms +tmchanged = false; if ~isequal(p.proj{proj}.coord_incl,h.tm.molValid) || ... ~isequal(p.proj{proj}.molTag,h.tm.molTag) || ... ~isequal(p.proj{proj}.molTagNames,h.tm.molTagNames) + tmchanged = true; +end + +% reset ES histograms +if tmchanged for i = 1:size(p.proj{proj}.ES,2) if ~(numel(p.proj{proj}.ES{i})==1 && isnan(p.proj{proj}.ES{i})) p.proj{proj}.ES{i} = []; @@ -40,11 +45,21 @@ function menu_export_Callback(obj, evd, h_fig) % added by MH, 24.4.2019 p.proj{proj}.molTagClr = h.tm.molTagClr; +% resets HA and TA analysis +if tmchanged + p = importHA(p,p.curr_proj); + p = importTA(p,p.curr_proj); +end + +% save tag names and colors as defaults +p.es.tagNames = p.proj{proj}.molTagNames; +p.es.tagClr = p.proj{proj}.molTagClr; + h.param = p; h.tm.ud = true; guidata(h_fig,h); -updateFields(h.figure_MASH, 'ttPr'); +updateFields(h_fig); close(h.tm.figure_traceMngr); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/concatenateData.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/concatenateData.m index 073487db..5d887c10 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/concatenateData.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/concatenateData.m @@ -106,10 +106,12 @@ end % concatenate traces - dat1.trace{ind} = [dat1.trace{ind};I]; % intensits-time trace + dat1.trace{ind} = ... + [dat1.trace{ind};I,repmat(i,size(I,1),1)]; % intensity-time trace + dat3.val{ind,1} = ... + [dat3.val{ind,1};I_DTA,repmat(i,size(I_DTA,1),1)]; % state trajectories % concatenate mean, max, min, median and states - dat3.val{ind,1} = [dat3.val{ind,1};I_DTA]; % state trajectories dat3.val{ind,2} = [dat3.val{ind,2};mean(I)]; % mean intensity dat3.val{ind,3} = [dat3.val{ind,3};min(I)]; % minimum intensity dat3.val{ind,4} = [dat3.val{ind,4};max(I)]; % maximum intensity @@ -143,10 +145,12 @@ end % concatenate traces - dat1.trace{ind} = [dat1.trace{ind};I0]; % intensits-time trace + dat1.trace{ind} = ... + [dat1.trace{ind};I0,repmat(i,size(I0,1),1)]; % intensits-time trace + dat3.val{ind,1} = ... + [dat3.val{ind,1};I0_DTA,repmat(i,size(I0_DTA,1),1)]; % state trajectories % concatenate mean, max, min, median and states - dat3.val{ind,1} = [dat3.val{ind,1};I0_DTA]; % state trajectories dat3.val{ind,2} = [dat3.val{ind,2};mean(I0)]; % mean intensity dat3.val{ind,3} = [dat3.val{ind,3};min(I0)]; % minimum intensity dat3.val{ind,4} = [dat3.val{ind,4};max(I0)]; % maximum intensity @@ -179,10 +183,12 @@ nTrs = size(dt,1); % concatenate traces - dat1.trace{ind} = [dat1.trace{ind};FRET_tr]; + dat1.trace{ind} = ... + [dat1.trace{ind};FRET_tr,repmat(i,[size(FRET_tr,1),1])]; + dat3.val{ind,1} = ... + [dat3.val{ind,1};fret_DTA,repmat(i,[size(fret_DTA,1),1])]; % concatenate mean, max, min, median and states - dat3.val{ind,1} = [dat3.val{ind,1};fret_DTA]; dat3.val{ind,2} = [dat3.val{ind,2};mean(FRET_tr)]; dat3.val{ind,3} = [dat3.val{ind,3};min(FRET_tr)]; dat3.val{ind,4} = [dat3.val{ind,4};max(FRET_tr)]; @@ -209,10 +215,12 @@ nTrs = size(dt,1); % concatenate traces - dat1.trace{ind} = [dat1.trace{ind};S_tr]; + dat1.trace{ind} = ... + [dat1.trace{ind};S_tr,repmat(i,[size(S_tr,1),1])]; + dat3.val{ind,1} = ... + [dat3.val{ind,1};s_DTA,repmat(i,[size(s_DTA,1),1])]; % concatenate mean, max, min, median and states - dat3.val{ind,1} = [dat3.val{ind,1};s_DTA]; dat3.val{ind,2} = [dat3.val{ind,2};mean(S_tr)]; dat3.val{ind,3} = [dat3.val{ind,3};min(S_tr)]; dat3.val{ind,4} = [dat3.val{ind,4};max(S_tr)]; @@ -273,8 +281,8 @@ for ind = 1:(nChan*nExc+nI0+nFRET+nS) if ind<=(nChan*nExc+nI0) % intensity - minI = min([min(dat1.trace{ind}),0]); - maxI = max(dat1.trace{ind}); + minI = min([min(dat1.trace{ind}(:,1)),0]); + maxI = max(dat1.trace{ind}(:,1)); if minI==maxI minI = minI-1; maxI = maxI+1; @@ -285,19 +293,11 @@ end for j = 1:nCalc - if j==9 || j==10 % state-wise data - minval = min(min(dat3.val{ind,j}(:,1))); - maxval = max(max(dat3.val{ind,j}(:,1))); - if minval==maxval - minval = minval-1; - maxval = maxval+1; - end - dat3.lim(ind,:,j) = [minval,maxval]; - elseif ind>(nChan*nExc) && j<=5 % FRET/S values + if ind>(nChan*nExc+nI0) && j<=5 % FRET/S values dat3.lim(ind,:,j) = [defMin defMax]; else - minval = min(dat3.val{ind,j}); - maxval = max(dat3.val{ind,j}); + minval = min(dat3.val{ind,j}(:,1)); + maxval = max(dat3.val{ind,j}(:,1)); if minval==maxval minval = minval-1; maxval = maxval+1; diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/controlDiscrForAS.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/controlDiscrForAS.m index fee57050..a5462e31 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/controlDiscrForAS.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/controlDiscrForAS.m @@ -52,4 +52,4 @@ str = 'bottom'; end -isdiscr = ~all(isnan(sum(sum(discr,3),2))); +isdiscr = ~any(all(isnan(discr))); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/getHistTM.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/getHistTM.m index fefab59d..f16ce007 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/getHistTM.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/getHistTM.m @@ -25,7 +25,7 @@ if sum(sum(isnan(trace))) P = []; iv = []; - return; + return end prm = [lim(1,:),niv(1);lim(2,:),niv(2)]; [P,iv{1},iv{2}] = hist2D(trace,prm); % RB: hist2D by tudima at zahoo dot com, inlcuded in \traces\processing\management diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_autoSort.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_autoSort.m index 06da2e13..564965d0 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_autoSort.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_autoSort.m @@ -20,15 +20,11 @@ function plotData_autoSort(h_fig) if ~is2D % 1D histograms if jx==0 - trace_x = dat1.trace{indx}; + trace_x = dat1.trace{indx}(:,1); limx = dat1.lim(indx,:); nivx = dat1.niv(indx); else - if sum(jx==[9,10]) % state-wise - trace_x = dat3.val{indx,jx}(:,1); - else - trace_x = dat3.val{indx,jx}; - end + trace_x = dat3.val{indx,jx}(:,1); limx = dat3.lim(indx,:,jx); nivx = dat3.niv(jx,indx); end @@ -61,52 +57,75 @@ function plotData_autoSort(h_fig) str_d = '1D'; -else % E-S histograms +else % 2D histograms % control coherence of x- and y-data if ~checkXYdataCoherence(indx,indy,jx,jy) return end - if isTDP % TDP - trace_x = dat3.val{indx,jx}(:,1); - trace_y = [dat3.val{indy,jy}(2:end,1);dat3.val{indy,jy}(end,1)]; + trace_x = []; + trace_y = []; + mols = []; + for m = unique(dat3.val{indx,jx}(:,2))' + val_m = dat3.val{indx,jx}(dat3.val{indx,jx}(:,2)==m,:); + trace_x = cat(1,trace_x,val_m(:,1)); + trace_y = cat(1,trace_y,[val_m(2:end,1);val_m(end,1)]); + mols = cat(1,mols,val_m(:,2)); + end nivx = dat1.niv(indx); limx = dat1.lim(indx,:); nivy = nivx; limy = limx; else if jx==0 - trace_x = dat1.trace{indx}; + trace_x = dat1.trace{indx}(:,1); + mols = dat1.trace{indx}(:,2); nivx = dat1.niv(indx); limx = dat1.lim(indx,:); else - if sum(jx==(9:10)) % state-wise (2nd column = molecule index) - trace_x = dat3.val{indx,jx}(:,1); + trace_x = dat3.val{indx,jx}(:,1); + if size(dat3.val{indx,jx},2)>=2 + mols = dat3.val{indx,jx}(:,2); else - trace_x = dat3.val{indx,jx}; + mols = (1:size(dat3.val{indx,jx},1))'; end nivx = dat3.niv(jx,indx); limx = dat3.lim(indx,:,jx); end if jy==0 - trace_y = dat1.trace{indy}; + trace_y = dat1.trace{indy}(:,1); nivy = dat1.niv(indy); limy = dat1.lim(indy,:); else - if sum(jx==(9:10)) % state-wise (2nd column = molecule index) - trace_y = dat3.val{indy,jy}(:,1); - else - trace_y = dat3.val{indy,jy}; - end + trace_y = dat3.val{indy,jy}(:,1); nivy = dat3.niv(jy,indy); limy = dat3.lim(indy,:,jy); end end + if h.tm.checkbox_AS_datcnt.Value + P2D = []; + for m = unique(mols)' + id = (mols==m)'; + [P2D_m,iv] = getHistTM([trace_x(id,:),trace_y(id,:)],... + [limx;limy],[nivx,nivy]); + if isempty(P2D) + P2D = double(~~P2D_m); + else + P2D = P2D+double(~~P2D_m); + end + end + ivx = iv{1}; + ivy = iv{2}; + else + [P2D,iv] = getHistTM([trace_x,trace_y],[limx;limy],[nivx,nivy]); + ivx = iv{1}; + ivy = iv{2}; + end - [P2D,iv] = getHistTM([trace_x,trace_y],[limx;limy],[nivx,nivy]); - ivx = iv{1}; - ivy = iv{2}; + if h.tm.checkbox_AS_gauss.Value + P2D = gconvTDP(P2D,[-0.2,1.2],0.01); + end if isempty(P2D) setContPan(cat(2,'No calculated data available: start calculation',... @@ -158,6 +177,12 @@ function plotData_autoSort(h_fig) set([h.tm.text_ylow,h.tm.edit_ylow,h.tm.text_yup,h.tm.edit_yup,... h.tm.text_yniv,h.tm.edit_yniv],'enable','off'); end +if is2D + set([h.tm.checkbox_AS_gauss,h.tm.checkbox_AS_datcnt],'enable','on'); +else + set([h.tm.checkbox_AS_gauss,h.tm.checkbox_AS_datcnt],'enable','off',... + 'value',0); +end title(h.tm.axes_histSort,cat(2,str_d,... '-histogram for molecule selection at last update')); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_conctrace.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_conctrace.m index 5e522648..4c25b9be 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_conctrace.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_conctrace.m @@ -52,12 +52,12 @@ function plotData_conctrace(h_axes,ind,h_fig) if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{ind},'buttondownfcn',fcn,... + plot(h_axes,x_axis,dat1.trace{ind}(:,1),'buttondownfcn',fcn,... 'color',dat1.color{ind}); xlim(h_axes, [x_axis(1) x_axis(end)]); if ind<=(nChan*nExc+nI0) % intensity - ylim(h_axes, [min([min(dat1.trace{ind}),0]) ... - max(dat1.trace{ind})]); + ylim(h_axes, [min([min(dat1.trace{ind}(:,1)),0]) ... + max(dat1.trace{ind}(:,1))]); else % ratio ylim(h_axes, [-0.2 1.2]); end @@ -72,14 +72,14 @@ function plotData_conctrace(h_axes,ind,h_fig) for c = 1:nChan %ind = (l-1)+c; % RB 2018-01-03: indizes/colour bug solved i = nChan*(l-1)+c; - x_axis = l:nExc:nExc*size(dat1.trace{i},1); + x_axis = l:nExc:nExc*size(dat1.trace{i}(:,1),1); if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{i},'color',dat1.color{i},... + plot(h_axes,x_axis,dat1.trace{i}(:,1),'color',dat1.color{i},... 'buttondownfcn',fcn); - min_y = min([min_y min(dat1.trace{i})]); - max_y = max([max_y max(dat1.trace{i})]); + min_y = min([min_y min(dat1.trace{i}(:,1))]); + max_y = max([max_y max(dat1.trace{i}(:,1))]); % added by MH, 24.4.2019 if l==1 && c==1 @@ -104,14 +104,14 @@ function plotData_conctrace(h_axes,ind,h_fig) j = j+1; i = nChan*nExc+j; l = find(exc==chanExc(c)); - x_axis = l:nExc:nExc*size(dat1.trace{i},1); + x_axis = l:nExc:nExc*size(dat1.trace{i}(:,1),1); if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{i},'color',dat1.color{i},... + plot(h_axes,x_axis,dat1.trace{i}(:,1),'color',dat1.color{i},... 'buttondownfcn',fcn); - min_y = min([min_y min(dat1.trace{i})]); - max_y = max([max_y max(dat1.trace{i})]); + min_y = min([min_y min(dat1.trace{i}(:,1))]); + max_y = max([max_y max(dat1.trace{i}(:,1))]); % added by MH, 24.4.2019 if j==1 @@ -129,11 +129,11 @@ function plotData_conctrace(h_axes,ind,h_fig) for n = 1:nFRET i = nChan*nExc+nI0+n; ldon = find(exc==chanExc(FRET(n,1))); - x_axis = ldon:nExc:nExc*size(dat1.trace{i},1); + x_axis = ldon:nExc:nExc*size(dat1.trace{i}(:,1),1); if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{i},'color',dat1.color{i},... + plot(h_axes,x_axis,dat1.trace{i}(:,1),'color',dat1.color{i},... 'buttondownfcn',fcn); % added by MH, 24.4.2019 if n==1 @@ -151,11 +151,11 @@ function plotData_conctrace(h_axes,ind,h_fig) for n = 1:nS i = nChan*nExc+nI0+nFRET+n; ldon = find(exc==chanExc(S(n,1))); - x_axis = ldon:nExc:nExc*size(dat1.trace{i},1); + x_axis = ldon:nExc:nExc*size(dat1.trace{i}(:,1),1); if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{i},'color',dat1.color{i},... + plot(h_axes,x_axis,dat1.trace{i}(:,1),'color',dat1.color{i},... 'buttondownfcn',fcn); if n==1 set(h_axes,'nextplot','add'); @@ -176,11 +176,11 @@ function plotData_conctrace(h_axes,ind,h_fig) else ldon = find(exc==chanExc(S(n-nFRET,1))); end - x_axis = ldon:nExc:nExc*size(dat1.trace{i},1); + x_axis = ldon:nExc:nExc*size(dat1.trace{i}(:,1),1); if inSec x_axis = x_axis*expT; end - plot(h_axes,x_axis,dat1.trace{i},'color',dat1.color{i},... + plot(h_axes,x_axis,dat1.trace{i}(:,1),'color',dat1.color{i},... 'buttondownfcn',fcn); if n==1 set(h_axes,'nextplot','add'); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_overall.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_overall.m index 215afc0a..9d34bc09 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_overall.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/plotData_overall.m @@ -45,7 +45,7 @@ function plotData_overall(h_fig) % RB 2017-12-15: implement FRET-S-histograms in plot2 if ~is2D - [P,iv] = getHistTM(dat1.trace{plot2x},dat1.lim(plot2x,:),... + [P,iv] = getHistTM(dat1.trace{plot2x}(:,1),dat1.lim(plot2x,:),... dat1.niv(plot2x)); bar(h.tm.axes_ovrAll_2,iv,P,'facecolor',dat1.color{plot2x},... @@ -59,8 +59,8 @@ function plotData_overall(h_fig) ylim(h.tm.axes_ovrAll_2, 'auto'); else % draw FRET-S histogram - [P_2D,iv_2D] = getHistTM([dat1.trace{plot2x},dat1.trace{plot2y}],... - [dat1.lim(plot2x,:);dat1.lim(plot2y,:)],... + [P_2D,iv_2D] = getHistTM([dat1.trace{plot2x}(:,1),... + dat1.trace{plot2y}(:,1)],[dat1.lim(plot2x,:);dat1.lim(plot2y,:)],... [dat1.niv(plot2x),dat1.niv(plot2y)]); imagesc(iv_2D{1},iv_2D{2},P_2D,'parent', h.tm.axes_ovrAll_2); diff --git a/MASH-FRET/source/mod-trace-processing/management/trace-manager/ud_popCalc.m b/MASH-FRET/source/mod-trace-processing/management/trace-manager/ud_popCalc.m index 59d39f74..bc2dd790 100644 --- a/MASH-FRET/source/mod-trace-processing/management/trace-manager/ud_popCalc.m +++ b/MASH-FRET/source/mod-trace-processing/management/trace-manager/ud_popCalc.m @@ -62,10 +62,10 @@ if (is2D && sum(jx==[0,1]) && sum(jy==[0,1])) || ... (~is2D && sum(jx==[0,1])) % frame-wise data - molIncl = molsWithConf(trace,'trace',prm,incl); + molIncl = molsWithConf(trace(:,1:2:end),'trace',prm,incl); elseif (is2D && sum(jx==(2:8)) && sum(jy==(2:8))) || ... (~is2D && sum(jx==(2:8))) % molecule-wise - molIncl = molsWithConf(trace,'value',prm); + molIncl = molsWithConf(trace(:,1:2:end),'value',prm); elseif (is2D && sum(jx==[9,10]) && sum(jy==[9,10])) || ... (~is2D && sum(jx==[9,10])) % state-wise molIncl = molsWithConf(trace,'state',prm); diff --git a/MASH-FRET/source/mod-trace-processing/management/ud_trSetTbl.m b/MASH-FRET/source/mod-trace-processing/management/ud_trSetTbl.m index 95603a1c..bfcfa408 100644 --- a/MASH-FRET/source/mod-trace-processing/management/ud_trSetTbl.m +++ b/MASH-FRET/source/mod-trace-processing/management/ud_trSetTbl.m @@ -7,10 +7,14 @@ function ud_trSetTbl(h_fig) h = guidata(h_fig); p = h.param; -if ~prepPanel(h.uipanel_TP_sampleManagement,h) +% propups panel +if ~isModuleOn(p,'TP') set(h.listbox_molNb,'String',{''},'Value',1,'Listboxtop',1); return end +setProp(get(h.uipanel_TP_sampleManagement,'children'),'enable','on'); +setProp(get(h.uipanel_TP_sampleManagement,'children'),'backgroundcolor',... + [1,1,1],'style','edit'); % collect experiment settings proj = p.curr_proj; diff --git a/MASH-FRET/source/mod-trace-processing/plot/plotData.m b/MASH-FRET/source/mod-trace-processing/plot/plotData.m index 32cfa842..9f139921 100644 --- a/MASH-FRET/source/mod-trace-processing/plot/plotData.m +++ b/MASH-FRET/source/mod-trace-processing/plot/plotData.m @@ -17,7 +17,7 @@ function plotData(mol, p, axes, prm, plotDscr) int_dta = p.proj{proj}.intensities_DTA; FRET_dta = p.proj{proj}.FRET_DTA; S_dta = p.proj{proj}.S_DTA; -rate = p.proj{proj}.frame_rate; +expT = p.proj{proj}.frame_rate; perSec = p.proj{proj}.cnt_p_sec; inSec = p.proj{proj}.time_in_sec; clr = p.proj{proj}.colours; @@ -38,6 +38,14 @@ function plotData(mol, p, axes, prm, plotDscr) end frames = find(incl); x_lim = [((frames(1)-1)*nExc+1) frames(end)*nExc]; +if fix{2}(7) + Ilim = fix{2}([4,5]); + if perSec + Ilim = Ilim/expT; + end +else + Ilim = []; +end FRETlim = [-0.2 1.2]; curr_exc = fix{2}(1); @@ -61,9 +69,9 @@ function plotData(mol, p, axes, prm, plotDscr) end if perSec - I = I/rate; + I = I/expT; if plotDscr - discrI = discrI/rate; + discrI = discrI/expT; end end @@ -78,8 +86,8 @@ function plotData(mol, p, axes, prm, plotDscr) x_axis = x_lim(1):x_lim(2); if inSec - cutOff = cutOff*rate; - x_axis = x_axis*rate; + cutOff = cutOff*expT; + x_axis = x_axis*expT; end if isfield(axes, 'axes_traceTop') @@ -127,7 +135,11 @@ function plotData(mol, p, axes, prm, plotDscr) if isfield(axes, 'axes_traceTop') xlim(axes.axes_traceTop, [x_axis(1) x_axis(end)]); - ylim(axes.axes_traceTop, 'auto'); + if ~isempty(Ilim) + ylim(axes.axes_traceTop, Ilim); + else + ylim(axes.axes_traceTop, 'auto'); + end end yLab = 'counts'; diff --git a/MASH-FRET/source/mod-trace-processing/plot/ud_plot.m b/MASH-FRET/source/mod-trace-processing/plot/ud_plot.m index 0c459bc5..ea177c65 100644 --- a/MASH-FRET/source/mod-trace-processing/plot/ud_plot.m +++ b/MASH-FRET/source/mod-trace-processing/plot/ud_plot.m @@ -20,9 +20,12 @@ function ud_plot(h_fig) clr = p.proj{proj}.colours; expT = p.proj{proj}.frame_rate; insec = p.proj{proj}.time_in_sec; +persec = p.proj{proj}.cnt_p_sec; p_fix = p.proj{proj}.TP.fix; start = p.proj{proj}.TP.curr{mol}{2}{1}(4); -isfix = p_fix{2}(6); +holdx = p_fix{2}(6); +holdint = p_fix{2}(7); +limI = p_fix{2}([4,5]); % set lists if (nFRET+nS) > 0 @@ -32,14 +35,28 @@ function ud_plot(h_fig) set(h.popupmenu_plotTop, 'String', getStrPop('plot_topChan', {labels ... p_fix{2}(1) clr{1}}), 'Value', p_fix{2}(2)); -% set starting point +% set limits of intensity axis +set(h.checkbox_plot_holdint,'value',holdint); +if holdint + if persec + limI = limI/expT; + end + set(h.edit_plot_minint,'string',num2str(limI(1))); + set(h.edit_plot_maxint,'string',num2str(limI(2))); +else + set([h.text_plot_minint,h.edit_plot_minint,h.text_plot_maxint,... + h.edit_plot_maxint],'enable','off'); + set([h.edit_plot_minint,h.edit_plot_maxint],'string',''); +end + +% set starting point of x-axis if insec start = start*expT; end set(h.edit_photobl_start,'string',num2str(start)); -if isfix +if holdx set(h.edit_photobl_start,'enable','inactive'); end % set checkboxes -set(h.checkbox_photobl_fixStart,'value',isfix); +set(h.checkbox_photobl_fixStart,'value',holdx); diff --git a/MASH-FRET/source/mod-video-processing/_callbacks/switchMovTool.m b/MASH-FRET/source/mod-video-processing/_callbacks/switchMovTool.m index eedc612d..3fcdc003 100644 --- a/MASH-FRET/source/mod-video-processing/_callbacks/switchMovTool.m +++ b/MASH-FRET/source/mod-video-processing/_callbacks/switchMovTool.m @@ -8,21 +8,26 @@ function switchMovTool(obj, evd, h_fig) set(h.togglebutton_zoom, 'Value', 0); set(0, 'CurrentFigure', h_fig); zoom off; - if isfield(h,'imageMov') && all(ishandle(h.imageMov)) - set(h.imageMov, 'ButtonDownFcn', {@pointITT, h_fig}); - end - if isfield(h,'axes_VP_vid') && all(ishandle(h.axes_VP_vid)) - set(h.axes_VP_vid, 'ButtonDownFcn', {@pointITT, h_fig}); - end + setbuttonfcn(h,{'imageMov','axes_VP_vid','aveImage',... + 'axes_VP_avimg'},{@pointITT, h_fig}); case h.togglebutton_zoom set(h.togglebutton_target, 'Value', 0); - if isfield(h,'imageMov') && all(ishandle(h.imageMov)) - set(h.imageMov, 'ButtonDownFcn', {}); - end - if isfield(h,'axes_VP_vid') && all(ishandle(h.axes_VP_vid)) - set(h.axes_VP_vid, 'ButtonDownFcn', {}); - end + + setbuttonfcn(h,{'imageMov','axes_VP_vid','aveImage',... + 'axes_VP_avimg'},{}); set(0, 'CurrentFigure', h_fig); zoom on; end + + +function setbuttonfcn(s,name,fcn) +if ~iscell(name) + name = {name}; +end +N = numel(name); +for n = 1:N + if isfield(s,name{n}) && all(ishandle(s.(name{n}))) + set(s.(name{n}),'ButtonDownFcn',fcn); + end +end diff --git a/MASH-FRET/source/mod-video-processing/create-traces/getIntTrace.m b/MASH-FRET/source/mod-video-processing/create-traces/getIntTrace.m index afb840d0..d8eeda0c 100644 --- a/MASH-FRET/source/mod-video-processing/create-traces/getIntTrace.m +++ b/MASH-FRET/source/mod-video-processing/create-traces/getIntTrace.m @@ -338,36 +338,6 @@ end -function trace = tracesFromMatrix(matrix,zTot,lim,aDim,nPix,mute) -% defaults -nbytes = 0; - -nCoord = numel(lim.Xinf); -aDim2 = aDim^2; -trace = zeros(zTot,nCoord); -prev = 0; -for c = 1:nCoord - - if ~mute && round(100*c/nCoord)>prev - prev = round(100*c/nCoord); - nbytes = dispProgress(['Generating intensity-time traces: ' ... - num2str(prev) '%%\n'],nbytes); - end - - y0 = lim.Yinf(c); - x0 = lim.Xinf(c); - - % get average sub-image - id_x = x0:(x0+aDim-1); - id_y = y0:(y0+aDim-1); - trace_vect = reshape(matrix(id_y,id_x,:),[aDim2,zTot])'; - [o,id] = sort(mean(trace_vect,1),2,'descend'); - - trace(:,c) = sum(trace_vect(:,id(1:nPix)),2); - -end - - function trace = getNpixFromVect(trace_vect, nPix) % find the brightest pixels in the average intensity vectors for each % position and calculate average intensity over these pixels on each frame diff --git a/MASH-FRET/source/mod-video-processing/create-traces/pointITT.m b/MASH-FRET/source/mod-video-processing/create-traces/pointITT.m index 387ce466..825557f3 100644 --- a/MASH-FRET/source/mod-video-processing/create-traces/pointITT.m +++ b/MASH-FRET/source/mod-video-processing/create-traces/pointITT.m @@ -33,8 +33,8 @@ function pointITT(obj, evd, h_fig) vidfile = p.proj{p.curr_proj}.movie_file; viddat = p.proj{p.curr_proj}.movie_dat; curr = p.proj{p.curr_proj}.VP.curr; -pxdim = curr.gen_int{3}(1); -npix = curr.gen_int{3}(2); +pxdim = 1; +npix = 1; % display process setContPan('Generating intensity-time traces...','process',h_fig); @@ -43,18 +43,28 @@ function pointITT(obj, evd, h_fig) h_tg = h_tab.Parent; mov = find(h_tg.Children==h_tab); -fDat{1} = vidfile{mov}; -fDat{2}{1} = viddat{mov}{1}; -if isFullLengthVideo(vidfile{mov},h_fig) - fDat{2}{2} = h.movie.movie; -else - fDat{2}{2} = []; -end -fDat{3} = viddat{mov}{2}; -fDat{4} = viddat{mov}{3}; -[o,data] = create_trace(newPnt,pxdim,npix,fDat); -if isempty(data) - return +if h_axes0==h.axes_VP_vid(mov) + fDat{1} = vidfile{mov}; + fDat{2}{1} = viddat{mov}{1}; + if isFullLengthVideo(vidfile{mov},h_fig) + fDat{2}{2} = h.movie.movie; + else + fDat{2}{2} = []; + end + fDat{3} = viddat{mov}{2}; + fDat{4} = viddat{mov}{3}; + [o,data] = create_trace(newPnt,pxdim,npix,fDat); + if isempty(data) + return + end + +elseif h_axes0==h.axes_VP_avimg(mov) + extr = floor(pxdim/2); + lim_inf = ceil(newPnt)-extr; + lim.Xinf = lim_inf(1,1); + lim.Yinf = lim_inf(1,2); + data = tracesFromMatrix(curr.res_plot{2}{mov},1,lim,pxdim,npix,false); + nExc = 1; end str_sec = []; @@ -83,6 +93,7 @@ function pointITT(obj, evd, h_fig) 1 0 0 0 1 0 0 0 0]; + leg_str = {}; for i = 1:nExc leg_str = cat(2,leg_str,cat(2,'laser ',num2str(i))); @@ -105,8 +116,10 @@ function pointITT(obj, evd, h_fig) ylim(h_axes, 'auto'); xlabel(h_axes, 'time (s)'); -ylabel(h_axes, ['intensity (counts' str_sec ')']); -legend(h_axes, leg_str); +ylabel(h_axes, {'intensity',['(counts' str_sec ')']}); +if nExc>1 + legend(h_axes, leg_str); +end grid on; guidata(h_fig, h); diff --git a/MASH-FRET/source/mod-video-processing/create-traces/tracesFromMatrix.m b/MASH-FRET/source/mod-video-processing/create-traces/tracesFromMatrix.m new file mode 100644 index 00000000..330f15b7 --- /dev/null +++ b/MASH-FRET/source/mod-video-processing/create-traces/tracesFromMatrix.m @@ -0,0 +1,30 @@ +function trace = tracesFromMatrix(matrix,zTot,lim,aDim,nPix,mute) + +% defaults +nbytes = 0; + +nCoord = numel(lim.Xinf); +aDim2 = aDim^2; +trace = zeros(zTot,nCoord); +prev = 0; +for c = 1:nCoord + + if ~mute && round(100*c/nCoord)>prev + prev = round(100*c/nCoord); + nbytes = dispProgress(['Generating intensity-time traces: ' ... + num2str(prev) '%%\n'],nbytes); + end + + y0 = lim.Yinf(c); + x0 = lim.Xinf(c); + + % get average sub-image + id_x = x0:(x0+aDim-1); + id_y = y0:(y0+aDim-1); + trace_vect = reshape(matrix(id_y,id_x,:),[aDim2,zTot])'; + [o,id] = sort(mean(trace_vect,1),2,'descend'); + + trace(:,c) = sum(trace_vect(:,id(1:nPix)),2); + +end + diff --git a/MASH-FRET/source/mod-video-processing/plot_VP_videoFrame.m b/MASH-FRET/source/mod-video-processing/plot_VP_videoFrame.m index d4fc9355..dc0f000b 100644 --- a/MASH-FRET/source/mod-video-processing/plot_VP_videoFrame.m +++ b/MASH-FRET/source/mod-video-processing/plot_VP_videoFrame.m @@ -1,5 +1,5 @@ -function h_img = plot_VP_videoFrame(h_axes, h_cb, img, imgtrsf, coord, chansplit, persec, multichanvid) -% h_img = plot_VP_videoFrame(h_axes, h_cb, img, imgtrsf, coord, chansplit, persec, multichanvid) +function [h_img,h_ave] = plot_VP_videoFrame(h_axes, h_cb, img, imgtrsf, coord, chansplit, persec, multichanvid) +% [h_img,h_ave] = plot_VP_videoFrame(h_axes, h_cb, img, imgtrsf, coord, chansplit, persec, multichanvid) % % Plot current video frame after image filtering and spots coordinates after transformation or spot finfing % @@ -11,7 +11,8 @@ % chansplit: positions on x-axis of channel splitting % persec: (1) if intensity units are in IC/second, (0) if they are in IC % multichanvid: 1 for multi-channel video, 0 for single-channel videos -% h_img: handle to image plot +% h_img: handle to video frame plot +% h_ave: handle to average image plot % defaults mkstl = 'or'; @@ -22,12 +23,10 @@ % set axes visible set([h_axes,h_cb],'visible','on'); -% plot video frame +% plot video frame and average image [h,w,~] = size(img); h_img = imagesc(h_axes(1),[0.5 w-0.5],[0.5 h-0.5],img(:,:,1)); - -% plot average image -imagesc(h_axes(2),[0.5 w-0.5],[0.5 h-0.5],img(:,:,2)); +h_ave = imagesc(h_axes(2),[0.5 w-0.5],[0.5 h-0.5],img(:,:,2)); % plot transformed image if numel(h_axes)>=3 diff --git a/MASH-FRET/source/mod-video-processing/updateImgAxes.m b/MASH-FRET/source/mod-video-processing/updateImgAxes.m index 53a80970..d0063372 100644 --- a/MASH-FRET/source/mod-video-processing/updateImgAxes.m +++ b/MASH-FRET/source/mod-video-processing/updateImgAxes.m @@ -48,6 +48,7 @@ function updateImgAxes(h_fig) multichanvid = numel(vidfiles)==1; h.imageMov = []; +h.aveImage = []; for mov = 1:numel(vidfiles) % get current video frame @@ -104,21 +105,23 @@ function updateImgAxes(h_fig) if isfield(h,'axes_VP_tr') && all(ishandle(h.axes_VP_tr)) h_axes = cat(2,h_axes,h.axes_VP_tr(mov)); end - h.imageMov(mov) = plot_VP_videoFrame(h_axes,... + [h.imageMov(mov),h.aveImage(mov)] = plot_VP_videoFrame(h_axes,... [h.cb_VP_vid(mov),h.cb_VP_avimg(mov)],cat(3,img,avimg),... imgtrsf{mov},coord,chsplit,persec,multichanvid); if h.togglebutton_target.Value==1 - set(h.axes_VP_vid(mov), 'ButtonDownFcn', {@pointITT, h_fig}); - set(h.imageMov(mov), 'ButtonDownFcn', {@pointITT, h_fig}); + set([h.axes_VP_vid(mov),h.axes_VP_avimg(mov)],'ButtonDownFcn',... + {@pointITT, h_fig}); + set([h.imageMov(mov),h.aveImage(mov)],'ButtonDownFcn',... + {@pointITT, h_fig}); else - set(h.imageMov(mov), 'ButtonDownFcn', {}); - set(h.axes_VP_vid(mov), 'ButtonDownFcn', {}); + set([h.imageMov(mov),h.aveImage(mov)],'ButtonDownFcn',{}); + set([h.axes_VP_vid(mov),h.axes_VP_avimg(mov)],'ButtonDownFcn',{}); end end -% set tool +% sets zoom if h.togglebutton_target.Value==1 set(0, 'CurrentFigure', h_fig); zoom off diff --git a/MASH-FRET/source/project/_callbacks/menu_projMenu_merge_Callback.m b/MASH-FRET/source/project/_callbacks/menu_projMenu_merge_Callback.m index 9a713c6a..2f0398a0 100644 --- a/MASH-FRET/source/project/_callbacks/menu_projMenu_merge_Callback.m +++ b/MASH-FRET/source/project/_callbacks/menu_projMenu_merge_Callback.m @@ -8,10 +8,10 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) % collect selected projects slct = get(h.listbox_proj, 'Value'); -nProj = numel(slct); % check project compatibility -[comp,errmsg,expT] = projectCompatibility(p.proj(slct)); +[comp,errmsg,expT,wl,lbl] = projectCompatibility(p.proj(slct),... + [h.figure_dummy,h.text_dummy]); if ~comp if h.mute_actions disp(cat(2,'Merging is impossible: ',errmsg)); @@ -22,18 +22,31 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) end % build confirmation message box +diffcrosstalks = false; if h.mute_actions del = 'Yes'; else str_proj = p.proj{slct(1)}.exp_parameters{1,2}; - del = questdlg({cat(2,'WARNING 1: The merging process induces a loss ',... - 'of single molecule videos that were used in individual projects.',... + prompt = {'WARNING 1: The merging process induces a loss of single ',... + 'molecule videos that were used in individual projects.',... ' It is therefore recommended to perform all adjustments of ',... - 'molecule positions and background corrections prior merging.'),... - ' ',cat(2,'WARNING 2: Cross-talk coefficients used in the merged ',... - 'project will be taken from the project "',str_proj,'" only.'),... - ' ','Do you wish to continue?'},'Merge projects','Yes','Cancel',... - 'Yes'); + 'molecule positions and background corrections prior merging.'}; + + for i = slct + if ~(isequal(p.proj{slct(1)}.TP.fix{4}{1},p.proj{i}.TP.fix{4}{1}) ... + && isequal(p.proj{slct(1)}.TP.fix{4}{2},... + p.proj{i}.TP.fix{4}{2})) + diffcrosstalks = true; + break + end + end + if diffcrosstalks + prompt = [prompt,' ',['WARNING 2: Cross-talk coefficients used in',... + ' the merged project will be taken from the project "',... + str_proj,'" only.']]; + end + del = questdlg([prompt,' ','Do you wish to continue?'],... + 'Merge projects','Yes','Cancel','Yes'); end if ~strcmp(del, 'Yes') @@ -58,7 +71,8 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) s.nb_channel = p.proj{slct(1)}.nb_channel; s.nb_excitations = p.proj{slct(1)}.nb_excitations; -s.excitations = p.proj{slct(1)}.excitations; +[~,lasid] = sort(p.proj{slct(1)}.excitations); +s.excitations = wl(lasid); s.chanExc = p.proj{slct(1)}.chanExc; s.FRET = p.proj{slct(1)}.FRET; s.S = p.proj{slct(1)}.S; @@ -66,7 +80,7 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) nS = size(s.S,1); s.exp_parameters = p.proj{slct(1)}.exp_parameters; s.exp_parameters{1,2} = 'merged'; -s.labels = p.proj{slct(1)}.labels; +s.labels = lbl; s.colours = p.proj{slct(1)}.colours; s.coord_file = ''; @@ -93,7 +107,7 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) s.traj_import_opt = []; s.molTagNames = {}; s.molTagClr = {}; -for proj = 1:nProj +for proj = slct % get maximum length if size(p.proj{proj}.intensities,1)>L L = size(p.proj{proj}.intensities,1); @@ -127,7 +141,7 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) s.S_DTA = []; s.molTag = []; s.prmTT = {}; -for proj = 1:nProj +for proj = slct % coordinates s.coord = cat(1,s.coord,p.proj{proj}.coord); N = size(p.proj{proj}.coord_incl,2); @@ -138,6 +152,8 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) % laser order laserOrder = []; + [~,lasid] = sort(p.proj{proj}.excitations); + p.proj{proj}.excitations = wl(lasid); for l = 1:s.nb_excitations id = find(p.proj{proj}.excitations==s.excitations(l)); laserOrder = cat(2,laserOrder,id); @@ -231,8 +247,16 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) % add merged project to the list pushbutton_openProj_Callback([],{s},h_fig); +% update processing with comon cross talks +if diffcrosstalks + pushbutton_TP_updateAll_Callback('cross',[],h_fig); +end + +% show action +setContPan('Projects successfully merged!','success',h_fig); + -function [ok,errmsg,expT] = projectCompatibility(p_proj) +function [ok,errmsg,expT,wl,lbl] = projectCompatibility(p_proj,hdl) ok = false; errmsg = ''; @@ -249,13 +273,14 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) chanExc = p_proj{1}.chanExc; FRET = p_proj{1}.FRET; S = p_proj{1}.S; -lbls = p_proj{1}.labels; -pixPrm = p_proj{1}.pix_intgr; + [ok,expT] = checkvidframerate(p_proj); if ~ok errmsg = 'Projects have different frame rates.'; return end + +ok = false; for proj = 2:nProj if p_proj{proj}.nb_channel~=nChan errmsg = 'Projects have different number of channels.'; @@ -265,9 +290,28 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) errmsg = 'Projects have different number of lasers.'; return end - if ~isequal(sort(p_proj{proj}.excitations),sort(exc)) - errmsg = 'Projects have different laser wavelength.'; - return +end + +[ok,wl] = checklaserwavelength(p_proj,hdl); +if ~ok + errmsg = 'Projects have different laser wavelengths.'; + return +end +[~,lasid] = sort(exc); +for c = 1:numel(chanExc) + if chanExc(c)>0 + chanExc(c) = wl(lasid(exc==chanExc(c))); + end +end + +ok = false; +for proj = 2:nProj + [~,lasid] = sort(p_proj{proj}.excitations); + for c = 1:numel(p_proj{proj}.chanExc) + if p_proj{proj}.chanExc(c)>0 + p_proj{proj}.chanExc(c) = wl(lasid(p_proj{proj}.excitations==... + p_proj{proj}.chanExc(c))); + end end if ~isequal(p_proj{proj}.chanExc,chanExc) errmsg = cat(2,'Projects have different emitter-specific ',... @@ -282,13 +326,13 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) errmsg = 'Projects have different stochiometry calculations.'; return end - if ~isequal(p_proj{proj}.labels,lbls) - errmsg = 'Projects have different emitter labels.'; - return - end end -ok = true; +[ok,lbl] = checkemitterlbl(p_proj,hdl); +if ~ok + errmsg = 'Projects have different emitter labels.'; + return +end function [ok,splt] = checkvidframerate(proj) @@ -322,6 +366,78 @@ function menu_projMenu_merge_Callback(obj,evd,h_fig) else splt = str2num(answ{1}); end +else + splt = allsplt(1); +end + + +function [ok,wl] = checklaserwavelength(proj,hdl) + +% defaults +w = 350; +h = 100; + +nProj = numel(proj); +nExc = proj{1}.nb_excitations; +allwl = zeros(nProj,nExc); +wl = sort(allwl(1,:)); +ok = 1; +for n = 1:nProj + allwl(n,:) = sort(proj{n}.excitations); +end +if ~all(all(allwl==repmat(allwl(1,:),nProj,1))) + strwl = cell(1,nProj); + for n = 1:nProj + strwl{n} = num2str(allwl(n,:)); + end + prompt = ['Projects have different laser ',... + 'wavelengths. Please select a common set of wavelengths (in nm) ',... + 'or abort the merging process:']; + [prompt,~] = wrapStrToWidth(prompt,'points',10,'normal',w,'gui',... + hdl); + [id,ok] = listdlg('PromptString',prompt,'ListString',strwl,... + 'SelectionMode','single','ListSize',[w,h]); + if ok + wl = allwl(id,:); + end +else + wl = allwl(1,:); +end + + +function [ok,lbl] = checkemitterlbl(proj,hdl) + +% defaults +w = 350; +h = 100; + +nProj = numel(proj); +nChan = proj{1}.nb_channel; +alllbl = cell(nProj,nChan); +ok = 1; +lbl = alllbl(1,:); +for n = 1:nProj + alllbl(n,:) = proj{n}.labels; +end +if ~isequal(alllbl,repmat(alllbl(1,:),nProj,1)) + strlbl = cell(1,nProj); + for n = 1:nProj + for c = 1:nChan + strlbl{n} = [strlbl{n},alllbl{n,c},' ']; + end + strlbl{n} = strlbl{n}(1:end-1); + end + prompt = ['Projects have different emitter labels. Please select a ',... + 'common set of labels or abort the merging process:']; + [prompt,~] = wrapStrToWidth(prompt,'points',10,'normal',w,'gui',... + hdl); + [id,ok] = listdlg('PromptString',prompt,'ListString',strlbl,... + 'SelectionMode','single','ListSize',[w,h]); + if ok + lbl = alllbl(id,:); + end +else + lbl = alllbl(1,:); end diff --git a/MASH-FRET/source/project/adjustProjIndexLists.m b/MASH-FRET/source/project/adjustProjIndexLists.m index 5a7d821d..5bd1829c 100644 --- a/MASH-FRET/source/project/adjustProjIndexLists.m +++ b/MASH-FRET/source/project/adjustProjIndexLists.m @@ -22,6 +22,7 @@ else p.curr_mod = [p.curr_mod,mod{x}]; end + p.proj{xn(x)}.module = p.curr_mod(end); p.sim.curr_plot = [p.sim.curr_plot,1]; p.sim.curr_pan = [p.sim.curr_pan,0]; p.movPr.curr_frame = [p.movPr.curr_frame,1]; diff --git a/MASH-FRET/source/project/importHA.m b/MASH-FRET/source/project/importHA.m index d7319071..18a203d3 100644 --- a/MASH-FRET/source/project/importHA.m +++ b/MASH-FRET/source/project/importHA.m @@ -51,15 +51,7 @@ end if nTpe>size(p.proj{i}.HA.prm,2) - if size(p.proj{i}.HA.prm,2)==(nTpe-2*nDE) - prm_new = cell(1,nTpe); - prm_new([1:(2*nChan*nExc),(2*nChan*nExc+2*nDE+1):end]) = ... - p.proj{i}.HA.prm; - p.proj{i}.HA.prm = prm_new; - clear prm_new; - else - p.proj{i}.HA.prm = cell(nTag+1,nTpe); - end + p.proj{i}.HA.prm = cell(nTag+1,nTpe); end % if the number of data changed, reset results and resize diff --git a/MASH-FRET/source/project/setDefPrm_traces.m b/MASH-FRET/source/project/setDefPrm_traces.m index 76ff21b0..7b09c4ac 100644 --- a/MASH-FRET/source/project/setDefPrm_traces.m +++ b/MASH-FRET/source/project/setDefPrm_traces.m @@ -80,11 +80,13 @@ else gen{2}(3) = 1; end - -gen{2}(4) = 0; % nothing (prev: intensity units per second) -gen{2}(5) = 0; % nothing (prev: intensity units per pixel) +Inan = isnan(p.proj{proj}.intensities(:)); +Imean = mean(p.proj{proj}.intensities(~Inan)); +Isig = std(p.proj{proj}.intensities(~Inan)); +gen{2}(4) = Imean-Isig; % lower intensity (prev: intensity units per second) +gen{2}(5) = Imean+3*Isig; % upper intensity (prev: intensity units per pixel) gen{2}(6) = 0; % fix first frame for all molecules -gen{2}(7) = 0; % nothing (prev: time units in second) +gen{2}(7) = 0; % fix intensity scale (prev: time units in second) % Main popupmenu values gen{3}(1) = 1; % laser for direct excitation @@ -112,7 +114,7 @@ if def.general{1}(1) > nExc def.general{1}(1) = 1; end -def.general{2}(1:3) = gen{2}(1:3); +def.general{2}([1:5,7]) = gen{2}([1:5,7]); def.general{3} = gen{3}; %% Molecule parameters @@ -313,6 +315,8 @@ for c = 1:nChan for l = 1:nExc def.mol{3}{2}(l,c) = 1; + def.mol{3}{3}{l,c} = zeros(1,7); + def.mol{3}{3}{l,c}(3) = 20; end end end @@ -335,13 +339,11 @@ end end -% adjust the cutoff frame if higher than the total number of frames -if def.mol{2}{1}(5) > nFrames - def.mol{2}{1}(5) = nFrames; -end -if def.mol{2}{1}(6) > nFrames - def.mol{2}{1}(6) = nFrames; -end +% reset trace truncations +def.mol{2}{1}(1) = 0; % apply cutoff +def.mol{2}{1}(2) = 1; % method +def.mol{2}{1}(4) = 1; % starting frame +def.mol{2}{1}(5:6) = [nFrames nFrames]; % cutoff frames % if photobleaching threshold is calculated a channel larger than the % number of channel diff --git a/MASH-FRET/source/routines/mod_trace_processing/getDefault_TP.m b/MASH-FRET/source/routines/mod_trace_processing/getDefault_TP.m index 984e13ac..d069e45a 100644 --- a/MASH-FRET/source/routines/mod_trace_processing/getDefault_TP.m +++ b/MASH-FRET/source/routines/mod_trace_processing/getDefault_TP.m @@ -159,6 +159,7 @@ p.inSec = false; p.fixX0 = false; p.x0 = 10; +p.intlim = [-1000,1E5]; % parameters for panel Sub-images p.contrast = 90; diff --git a/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_plot.m b/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_plot.m index f8f6e3fc..c1e505d7 100644 --- a/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_plot.m +++ b/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_plot.m @@ -35,16 +35,15 @@ function routinetest_TP_plot(h_fig,p,prefix) popupmenu_plotTop_Callback(h.popupmenu_plotTop,[],h_fig); end end - -% tes axis settings -disp(cat(2,prefix,'test axis settings')); nDat_bot = numel(get(h.popupmenu_plotBottom,'string')); for dat = 1:nDat_bot set(h.popupmenu_plotBottom,'value',dat); popupmenu_plotBottom_Callback(h.popupmenu_plotBottom,[],h_fig); end -set_TP_xyAxis(~p.fixX0,p.x0,h_fig); +% test axis settings +disp(cat(2,prefix,'test axis settings')); +set_TP_xyAxis(~p.fixX0,p.x0,true,p.intlim,h_fig); pushbutton_closeProj_Callback(h.pushbutton_closeProj,[],h_fig); diff --git a/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_sampleManagement.m b/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_sampleManagement.m index fddb56b8..e2809cbf 100644 --- a/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_sampleManagement.m +++ b/MASH-FRET/source/routines/mod_trace_processing/routinetest_TP_sampleManagement.m @@ -29,13 +29,6 @@ function routinetest_TP_sampleManagement(h_fig,p,prefix) % set default parameters setDefault_TP(h_fig,p); - % expand panel - h_but = getHandlePanelExpandButton(h.uipanel_TP_sampleManagement,... - h_fig); - if strcmp(h_but.String,char(9660)) - pushbutton_panelCollapse_Callback(h_but,[],h_fig); - end - % test sample navigation disp(cat(2,prefix,'>> test sample navigation...')); pushbutton_molNext_Callback(h.pushbutton_molNext,[],h_fig); diff --git a/MASH-FRET/source/routines/mod_trace_processing/setDefault_TP.m b/MASH-FRET/source/routines/mod_trace_processing/setDefault_TP.m index 2e06ea4d..0a6704e0 100644 --- a/MASH-FRET/source/routines/mod_trace_processing/setDefault_TP.m +++ b/MASH-FRET/source/routines/mod_trace_processing/setDefault_TP.m @@ -43,7 +43,7 @@ function setDefault_TP(h_fig,p) set(h.popupmenu_plotBottom,'value',nDat_bot); popupmenu_plotBottom_Callback(h.popupmenu_plotBottom,[],h_fig); -set_TP_xyAxis(p.fixX0,p.x0,h_fig); +set_TP_xyAxis(p.fixX0,p.x0,false,[],h_fig); % set default sub-images parameters h_but = getHandlePanelExpandButton(h.uipanel_TP_subImages,h_fig); diff --git a/MASH-FRET/source/routines/mod_trace_processing/set_TP_findStates.m b/MASH-FRET/source/routines/mod_trace_processing/set_TP_findStates.m index 4c5b9360..29409e49 100644 --- a/MASH-FRET/source/routines/mod_trace_processing/set_TP_findStates.m +++ b/MASH-FRET/source/routines/mod_trace_processing/set_TP_findStates.m @@ -59,6 +59,9 @@ function set_TP_findStates(meth,trace,prm,thresh,nChan,nL,h_fig) J = numel(get(h.popupmenu_TP_states_indexThresh,'string')); for state = 1:J setIfEnabled(h.popupmenu_TP_states_indexThresh,'value',state,1); + if size(thresh,1) diff --git a/docs/trace-processing/components/panel-crosstalk-corrections.md b/docs/trace-processing/components/panel-crosstalk-corrections.md index 7ac3b894..35c083e6 100644 --- a/docs/trace-processing/components/panel-crosstalk-corrections.md +++ b/docs/trace-processing/components/panel-crosstalk-corrections.md @@ -3,7 +3,7 @@ layout: default title: Cross-talk corrections parent: Components grand_parent: Trace processing -nav_order: 5 +nav_order: 4 --- diff --git a/docs/trace-processing/components/panel-denoising.md b/docs/trace-processing/components/panel-denoising.md index 546ce1c0..d716cdec 100644 --- a/docs/trace-processing/components/panel-denoising.md +++ b/docs/trace-processing/components/panel-denoising.md @@ -3,7 +3,7 @@ layout: default title: Denoising parent: Components grand_parent: Trace processing -nav_order: 6 +nav_order: 5 --- diff --git a/docs/trace-processing/components/panel-factor-corrections.md b/docs/trace-processing/components/panel-factor-corrections.md index cff2470f..1ce6e660 100644 --- a/docs/trace-processing/components/panel-factor-corrections.md +++ b/docs/trace-processing/components/panel-factor-corrections.md @@ -3,7 +3,7 @@ layout: default title: Factor corrections parent: Components grand_parent: Trace processing -nav_order: 8 +nav_order: 7 --- diff --git a/docs/trace-processing/components/panel-find-states.md b/docs/trace-processing/components/panel-find-states.md index 72e2af6e..6fee9ae8 100644 --- a/docs/trace-processing/components/panel-find-states.md +++ b/docs/trace-processing/components/panel-find-states.md @@ -3,7 +3,7 @@ layout: default title: Find states parent: Components grand_parent: Trace processing -nav_order: 9 +nav_order: 8 --- diff --git a/docs/trace-processing/components/panel-photobleaching.md b/docs/trace-processing/components/panel-photobleaching.md index e5875b69..f2979755 100644 --- a/docs/trace-processing/components/panel-photobleaching.md +++ b/docs/trace-processing/components/panel-photobleaching.md @@ -3,7 +3,7 @@ layout: default title: Photobleaching parent: Components grand_parent: Trace processing -nav_order: 7 +nav_order: 6 --- diff --git a/docs/trace-processing/components/panel-plot.md b/docs/trace-processing/components/panel-plot.md index 1dbbe64c..472aa19c 100644 --- a/docs/trace-processing/components/panel-plot.md +++ b/docs/trace-processing/components/panel-plot.md @@ -3,7 +3,7 @@ layout: default title: Plot parent: Components grand_parent: Trace processing -nav_order: 2 +nav_order: 1 --- @@ -20,7 +20,7 @@ The panel closes automatically after other panels open or after pressing Use this panel to define which time traces to plot in the [Visualization area](area-visualization.html). - + ## Panel components @@ -37,12 +37,15 @@ Use this panel to define which time traces to plot in the Use these menus to define the intensity data to plot in [Intensity-time traces and histograms](area-visualization.html#intensity-time-traces-and-histograms). - + To plot intensity data upon illumination of a particular laser, select the corresponding wavelength in menu **(a)**, or select the option `all` to plot intensities upon all laser illuminations. To plot intensity data of a particular emitter, select the corresponding detection channel in menu **(b)**, or select the option `all` to plot all emitter intensities. +The upper and lower limits of the intensity axis can be set to constant values by activating the option in **(c)** and setting the limits in **(d)** and **(e)**. Intensity units are defined in menu `Units`>`intensities` of the +[menu bar](../../Getting_started.html#interface). + --- diff --git a/docs/trace-processing/components/panel-sample-management.md b/docs/trace-processing/components/panel-sample-management.md index 1de3562f..f160f167 100644 --- a/docs/trace-processing/components/panel-sample-management.md +++ b/docs/trace-processing/components/panel-sample-management.md @@ -3,7 +3,7 @@ layout: default title: Sample management parent: Components grand_parent: Trace processing -nav_order: 1 +nav_order: 9 --- diff --git a/docs/trace-processing/components/panel-subimage.md b/docs/trace-processing/components/panel-subimage.md index 130a93f3..448fb077 100644 --- a/docs/trace-processing/components/panel-subimage.md +++ b/docs/trace-processing/components/panel-subimage.md @@ -3,7 +3,7 @@ layout: default title: Sub-images parent: Components grand_parent: Trace processing -nav_order: 3 +nav_order: 2 --- diff --git a/docs/trace-processing/functionalities/tm-automatic-sorting.md b/docs/trace-processing/functionalities/tm-automatic-sorting.md index 72876637..5e1d68f5 100644 --- a/docs/trace-processing/functionalities/tm-automatic-sorting.md +++ b/docs/trace-processing/functionalities/tm-automatic-sorting.md @@ -68,6 +68,10 @@ For 1D-sorting, menu **(f)** must be set to `none`. Data are sorted into bins defined by **(c)** (lowest limit), **(d)** (highest limit) and **(e)** (bin size) for the x-axis, and by **(h)**, **(i)** and **(j)** for the y-axis. +Data can be counted as one count per molecule in the 2D-histogram by activation option **(l)**. + +2D-histograms can be displayed with Gaussian filtering by activating option **(k)**. + Molecule sorting can be performed on full-length data-time traces or state trajectories, but also on different descriptive statistics or state data. The type of data sets can be selected in menu **(b)** (x-axis) and **(g)** (y-axis) and include: * `original time traces (frame-wise)` for full-length data-time traces diff --git a/docs/video-processing/components/area-visualization.md b/docs/video-processing/components/area-visualization.md index 54b522a9..5a35d318 100644 --- a/docs/video-processing/components/area-visualization.md +++ b/docs/video-processing/components/area-visualization.md @@ -17,6 +17,8 @@ It consists in three tabs, each showing different video-related data. Use this area to visualize single molecule video data. Any graphics in MASH-FRET can be exported to an image file by right-clicking on the axes and selecting `Export graph`. + + ## Area components {: .no_toc .text-delta } @@ -27,11 +29,14 @@ Any graphics in MASH-FRET can be exported to an image file by right-clicking on --- -## Single molecule video +## Images + +### Single molecule video +{: .no_toc } Use this tab to navigate throught the video frames. - + * **(1)** [Video information](#video-information) * **(2)** [Video visualization](#video-visualization) @@ -41,7 +46,7 @@ Use this tab to navigate throught the video frames. * **(6)** [Zoom tool](#zoom-tool) -### Video information +#### Video information {: .no_toc } @@ -51,7 +56,7 @@ The video file name and location is shown in **(a)** and video pixel dimensions These properties are read-only. -### Video visualization +#### Video visualization {: .no_toc } Shows the current video frame and corresponding spots or molecule positions. @@ -78,7 +83,7 @@ It is possible to zoom in the display and create intensity-time traces at specif [Create trace tool](#create-trace-tool) respectively. -### Navigation +#### Navigation {: .no_toc } Use this sliding bar to navigate throught the video frames. @@ -89,7 +94,7 @@ When spots are detected with the tool Spotfinder, the corresponding coordinates [Spotfinder](panel-molecule-coordinates.html#spotfinder) for more information. -### Frame information +#### Frame information {: .no_toc } Shows information about the current frame index and channel splitting positions. @@ -99,40 +104,9 @@ Shows information about the current frame index and channel splitting positions. The current frame index is shown in **(a)**, the video length in **(b)** and channel splitting positions (in pixels) in **(c)** considering equal channel widths. -### Create trace tool +### Average image {: .no_toc } -Press -![+](../../assets/images/gui/VP-but-plus.png "+") to activate the "Create trace" cursor. - -The "Create trace" cursor allows to generate and plot laser-specific intensity-time traces by simply clicking on a specific pixel in the -[Video visualization](#video-visualization). - -Intensity data can be exported to MATLAB's workspace by pressing -![Yes](../../assets/images/gui/VP-but-yes.png "Yes") in the dialogue box; otherwise press -![No](../../assets/images/gui/VP-but-no.png "No"). - - - -Intensities are calculated as described in -[Integration parameters](panel-intensity-integration.html#integration-parameters) and given in units defined in menu `Units` of the -[Menu bar](../../Getting_started.html#interface). - - -### Zoom tool -{: .no_toc } - -Press -![Z](../../assets/images/gui/VP-but-z.png "Z") to activate the zoom cursor. - -The zoom cursor allows to zoom in and out the -[Video visualization](#video-visualization) like on regular MATLAB axes. - - ---- - -## Average image - Use this tab to visualize the average image. @@ -155,9 +129,8 @@ It is possible to zoom in the display by using the [Zoom tool](#zoom-tool). ---- - -## Transformed image +### Transformed image +{: .no_toc } Use this tab to check the quality of channel transformation. @@ -172,3 +145,42 @@ Dotted white lines are plotted at channel splitting positions given in It is possible to zoom in the display by using the [Zoom tool](#zoom-tool). + +--- + + +## Create trace tool + +Press +![+](../../assets/images/gui/VP-but-plus.png "+") to activate the "Create trace" cursor. + +The "Create trace" cursor allows to generate and plot laser-specific intensity-time traces by simply clicking on a specific pixel of the +[Video visualization](#video-visualization) or of the +[Average image](#average-image). + +Intensity data can be exported to MATLAB's workspace by pressing +![Yes](../../assets/images/gui/VP-but-yes.png "Yes") in the dialogue box; otherwise press +![No](../../assets/images/gui/VP-but-no.png "No"). + + + +Intensities are calculated as described in +[Integration parameters](panel-intensity-integration.html#integration-parameters) and given in units defined in menu `Units` of the +[Menu bar](../../Getting_started.html#interface). + + +--- + + +## Zoom tool + +Press +![Z](../../assets/images/gui/VP-but-z.png "Z") to activate the zoom cursor and deactivate the +[Create trace tool](#create-trace-tool). + +The zoom cursor allows to zoom in and out the +[Image](#image) area like on regular MATLAB axes. + + +--- +