Commit b660343f authored by actb's avatar actb

reset status on sidebar.updateEditProcess

parent 86606a3b
......@@ -316,8 +316,10 @@ function buildEditProcessTables(Q)
var tbl=document.getElementById('tableQ');
tbl.innerHTML='';
var i=0;
var cl = document.getElementById('editStatus');
document.getElementById('busySpinner').style.display="none";
cl.innerHTML="<option>idle</option>" ;
while (i<Q.toProcessQ.length) {
if (null===Q.toProcessQ[i] || undefined===Q.toProcessQ[i])
Q.toProcessQ.splice(i,1);
......@@ -349,8 +351,7 @@ function buildEditProcessTables(Q)
if (localLeverFile===inProcessLeverFile) {
// this is the one...
var status=Q.inProcessQ[i].status;
var cl = document.getElementById('editStatus');
var status=Q.inProcessQ[i].status;
cl.innerHTML="<option>"+status+"</option>" ;
// update UI based on status
setEditUI(status);
......
......@@ -31,7 +31,10 @@ app.post('/view', jsonParser,function (req, res) {
gWindow.updateImageModelTransforms();
// MRW - Added clip-plane info here to keep movie renders consistent
gWindow.gbClipPlane = view.bClip;
gWindow.gPlaneDepth = view.clipPlane;
var centroid=view.planeCenter;
vec3.transformMat4(centroid,centroid, gImTransform);
gWindow.gPlaneDepth = centroid[2];
// MRW - Added bg color and bg volume color values for movie rendering
gWindow.gBGClearColor = view.bgColor;
gWindow.gVolColor = view.volColor;
......@@ -45,6 +48,12 @@ app.get('/view', function (req, res) {
var rot=Array.prototype.slice.call(gWindow.gWorldRot);
// MRW - Added center of rotation to view params for consistent object-centered renders
var center = Array.prototype.slice.call(gWindow.gRotCenter);
var planeCenter = vec3.fromValues(gWindow.gCamera.pos[0],gWindow.gCamera.pos[1], gWindow.gPlaneDepth);
var imInv=mat4.create();
mat4.invert(imInv,gWindow.gImTransform);
vec3.transformMat4(planeCenter, planeCenter,imInv);
// MRW - Added clip-plane info here to keep movie renders consistent
// MRW - Added bg/volume colors
var view={zoom:gWindow.gCamera.zoom,
......@@ -52,7 +61,7 @@ app.get('/view', function (req, res) {
center:center,
worldRot:rot,
bClip:gWindow.gbClipPlane,
clipPlane:gWindow.gPlaneDepth,
planeCenter:[planeCenter[0],planeCenter[1],planeCenter[2]],
bgColor:gWindow.gBGClearColor,
volColr:gWindow.gVolColor
};
......
% shut off ui elements
UISERVER='http://localhost:4444/'
targetCell=3
panelName='h2b';
outfolder='moviePanels';
if ~exist(outfolder,'dir')
mkdir(outfolder)
end
view=webread([UISERVER 'view']);
% save('view.mat','view')
% webwrite([UISERVER 'view'],weboptions('MediaType','application/json'),view);
% you can turn off side bar or toolbar if you want, or leave on
ui=webread([UISERVER 'ui']);
offState='none';
onState='';
ui.sidebar=offState;
ui.webToolbar=offState;
ui.logoDiv=onState;
ui.clockButton=onState;
webwrite([UISERVER 'ui'],weboptions('MediaType','application/json'),ui);
options=weboptions();
options.Timeout=60;
strDB='C:\z\leverjs\Olivier\20190226_4d_wt_PI3K_wt_stack_S01.LEVER';
[conn,CONSTANTS]=openDB(strDB);
cmd=['select time,centroid from tblCells where trackID=' num2str(targetCell)];
qTarget=fetch(conn,cmd);
centroids=cellfun(@jsondecode,qTarget.centroid,'UniformOutput',false);
centroids=cell2mat(centroids);
centroids=reshape(centroids,3,[])';
close(conn);
% todo
for time=1:CONSTANTS.imageData.NumberOfFrames
% set time
webwrite([UISERVER 'time/' num2str(time)] ,'');
idx=find(qTarget.time==time)
if ~isempty(idx)
view.planeCenter=centroids(idx,:);
webwrite([UISERVER 'view'],weboptions('MediaType','application/json'),view);
end
% wait for mr render to complete
bComplete=false;
nAttempts=0;
while ~bComplete && nAttempts<10
bComplete=webread([UISERVER 'drawComplete'],options);
if ~bComplete
nAttempts=nAttempts+1;
pause(0.5)
end
end
if ~bComplete
continue
end
% read image
im=webread([UISERVER 'screenCap'],options);
outname=fullfile(outfolder,[panelName '_' num2str(time) '.tif']);
imwrite(im,outname);
% add to video
fprintf(1,'time=%d complete\n',time);
end
\ No newline at end of file
movieFile='20190912_9d_S00.mp4';
movieFile='20190226_4d_wt_PI3K_wt_stack_S01.mp4';
v=VideoWriter(movieFile,'MPEG-4');
v.FrameRate=15;
open(v)
% feature graph
cmd=['select tblCells.time,tblCells.trackID,tblCellFeatures.* from tblCellFeatures inner join tblCells on tblCellFeatures.cellID '...
'=tblCells.cellID where tblCells.trackID=' num2str(targetCell)]
q=fetch(conn,cmd);
% tags={'seg_nobright','noseg','green_nobright','red_nobright','lineage'}
% tags={'dolly_seg','dolly_noSeg'}
tags={'h2b','erk','fx'}
% tags={'dolly_seg','dolly_noSeg'}
tags={'h2b','erk'}
movie_frames='./moviePanels';
flist=dir(fullfile(movie_frames,[tags{1} '_*.tif']));
......@@ -22,8 +28,20 @@ for time=1:length(flist)
imx{2}=imresize(imx{2},size(imx{1},1)/size(imx{2},1));
border=255*ones(size(imx{1},1),5,3);
imCombined=[ imx{1} border imx{2} border imx{3}];
figure(5);clf;plot(q.ndbErk,q.time,'linewidth',2);hold on;set(gcf,'color','w');axis ij;
axis on;
set(gca,'yaxislocation','right')
xlabel('Cell 3 NDB ERK','fontsize',16)
ylabel('time','fontsize',16)
plot([0,1],[time,time],'-r','linewidth',2);
ylim([1,CONSTANTS.imageData.NumberOfFrames])
imPlot=getframe(gcf);
imPlot=imPlot.cdata;
imPlot=imresize(imPlot,size(imx{1},1)/size(imPlot,1));
border=255*ones(size(imx{1},1),5,3);
imCombined=[ imx{1} border imx{2} imPlot];
%
% borderH=255*ones(5,2*size(imx{1},2)+5,3);
% imCombined=[ imx{1} border imx{2}; borderH; imx{3} border imx{4} ];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment