private void execute(string imageName, int x1, int x2, int y1, int y2, int z1, int z2, double threshold, int t1, int t2, int cs1, int cs2) { debugString("Running on image: " + imageName); debugString("X=[" + x1 + "," + x2 + "]"); debugString("Y=[" + y1 + "," + y2 + "]"); debugString("Z=[" + z1 + "," + z2 + "]"); debugString("Threshold: " + threshold); FmriRequest req = new FmriRequest(imageName, x1, x2, y1, y2, z1, z2, threshold, t1, t2, cs1, cs2, Request.UserHostAddress); refStr.Value = req.AreaStringWithThresholdMD5; refNoThreshold.Value = req.AreaStringMD5; debugString("AreaString: " + req.AreaString + " (" + req.AreaStringMD5 + ")"); debugString("AreaStringWithThreshold: " + req.AreaStringWithThreshold + " (" + req.AreaStringWithThresholdMD5 + ")"); if (FmriCommon.isOutImageExists(req.AreaStringWithThresholdMD5, Server)) { debugString("Filename: \"" + FmriCommon.getOutImageDir(Server) + req.AreaStringWithThresholdMD5 + ".png" + "\" exists. good."); lblRef.ForeColor = System.Drawing.Color.Green; lblRef.Text = "Your request is completed. See results page!"; } else { MatlabRunner m = FmriCommon.getMatlabRunner(Application, Server); m.EnqueueRequest(req); debugString("Posted to queue."); lblRef.ForeColor = System.Drawing.Color.Blue; lblRef.Text = "Your request was posted to the queue. Try the results page later."; } }
protected void findImage(string id, string id2) { if (!string.IsNullOrEmpty(id)) { pnlImage.Visible = false; if (FmriCommon.isOutImageExists(id, Server)) { imgResult.ImageUrl = "Results/" + id + ".png"; pnlImage.Visible = true; } else { lblMsg.Text = "File does not exist yet. Please try again later.<br />"; lblMsg.ForeColor = System.Drawing.Color.DarkRed; } string clique_filename = FmriCommon.getCliquesDir(Server) + id + ".txt"; if (System.IO.File.Exists(clique_filename)) { lnkCliques.NavigateUrl = "Cliques/" + id + ".txt"; pnlImage.Visible = true; } } else { pnlImage.Visible = false; } if (!string.IsNullOrEmpty(id2)) { string xls_filename = FmriCommon.getExcelDir(Server) + id2 + ".csv"; if (System.IO.File.Exists(xls_filename)) { lnkExcelFile.NavigateUrl = "Excel/" + id2 + ".csv"; lnkZipFile.NavigateUrl = "Excel/" + id2 + ".zip"; pnlExcelFile.Visible = true; } else { lblMsg.Text = "File does not exist yet. Please try again later.<br />"; lblMsg.ForeColor = System.Drawing.Color.DarkRed; pnlExcelFile.Visible = false; } } else { pnlExcelFile.Visible = false; } if (pnlExcelFile.Visible == false || pnlImage.Visible == false) { pnlMessage.Visible = true; } else { pnlMessage.Visible = false; } }