private void postMenuItem_Click(object sender, System.EventArgs e) { EarLab.Dialogs.Analysis.PostDialog postDialog = new EarLab.Dialogs.Analysis.PostDialog(this.layoutScatter.BoxData.timeEnd - this.layoutScatter.BoxData.timeStart); if (postDialog.ShowDialog(this) == DialogResult.OK) { LayoutScatter.BoxDataType boxData = this.layoutScatter.BoxData; double[,] analysisArray = Analysis.SpikeAnalysis.PostStimulusAnalysis(boxData.spikeArray, postDialog.BinWidth, boxData.timeStart, boxData.timeEnd, boxData.cellIDStart, boxData.cellIDEnd); double[] axisArray = new double[6]; axisArray[0] = boxData.cellIDStart; axisArray[1] = boxData.cellIDEnd; axisArray[2] = boxData.timeStart; axisArray[3] = boxData.timeEnd; double min, max; this.GetMinMax(analysisArray, out min, out max); axisArray[4] = min; axisArray[5] = max; string[] axisNames = new string[4]; axisNames[0] = "Post Stimulus Analysis"; EarLab.Dialogs.AnalysisDialogNew analysisDialog = new EarLab.Dialogs.AnalysisDialogNew(analysisArray, axisArray, axisNames); analysisDialog.ShowDialog(this); } }
private void intervalMenuItem_Click(object sender, System.EventArgs e) { EarLab.Dialogs.Analysis.IntervalDialog intervalDialog = new EarLab.Dialogs.Analysis.IntervalDialog(); if (intervalDialog.ShowDialog(this) == DialogResult.OK) { LayoutScatter.BoxDataType boxData = this.layoutScatter.BoxData; double[,] analysisArray = Analysis.SpikeAnalysis.IntervalAnalysis(boxData.spikeArray, intervalDialog.MaxInterval, intervalDialog.BinCount, boxData.timeStart, boxData.timeEnd, boxData.cellIDStart, boxData.cellIDEnd); double[] axisArray = new double[6]; axisArray[0] = boxData.cellIDStart; axisArray[1] = boxData.cellIDEnd; axisArray[2] = 0.0; axisArray[3] = intervalDialog.MaxInterval; double min, max; this.GetMinMax(analysisArray, out min, out max); axisArray[4] = min; axisArray[5] = max; string[] axisNames = new string[4]; axisNames[0] = "Interval Analysis"; axisNames[1] = "Cell ID"; axisNames[2] = "Interval (Sec)"; axisNames[3] = "Bin count"; EarLab.Dialogs.AnalysisDialogNew analysisDialog = new EarLab.Dialogs.AnalysisDialogNew(analysisArray, axisArray, axisNames); analysisDialog.ShowDialog(this); } }
private void AnalysisMenuItem_Click(object sender, System.EventArgs e) { AnalysisType analysisType = (AnalysisType)(((MenuItem)sender).Index); double defaultValue; string analysisQuestion = AnalysisTools.GetAnalysisMenuQuestion((int)analysisType, out defaultValue); EarLab.Dialogs.AnalysisQuestionDialog analysisQuestionDialog = new EarLab.Dialogs.AnalysisQuestionDialog(); analysisQuestionDialog.Question = analysisQuestion; analysisQuestionDialog.Value = defaultValue; if (analysisQuestion == "" || analysisQuestionDialog.ShowDialog(this) == DialogResult.OK) { double[] axisArray = new double[6]; string[] axisNames = new string[4]; double sampleRate = 1 / ((Math.Abs(this.layout2DColor.ViewerAxisPanel.BottomAxisEndValue - this.layout2DColor.ViewerAxisPanel.BottomAxisStartValue) / (double)this.layout2DColor.ArraySize.Width) / 1000); double[,] analysisArray = EarLab.Analysis.AnalysisTools.Analyze((int)analysisType, this.layout2DColor.BoxData(this.tempStart, this.tempEnd), sampleRate, analysisQuestionDialog.Value, out axisArray[4], out axisArray[5], out axisNames[3], out axisArray[2], out axisArray[3], out axisNames[2], out axisArray[0], out axisArray[1], out axisNames[1], out axisNames[0]); EarLab.Dialogs.AnalysisDialogNew analysisDialog = new EarLab.Dialogs.AnalysisDialogNew(analysisArray, axisArray, axisNames); analysisDialog.ShowDialog(this); } }