private void SetCorrelationForCombobox() { switch (this.correlationTypeComboBox.SelectedIndex) { case 0: { correlator = null; this.correlatorOptionPanel.Controls.Clear(); this.correlateButton.Enabled = false; this.correlatorPauseButton.Enabled = false; return; } case 1: { correlator = new KernalBasedOverlapCorrelator(MosaicWindow.MosaicInfo, this.tiledImageViewer); /* * if (!MosaicWindow.MosaicInfo.HasConstantOverlap) * { * MessageBox.Show("The currently loaded mosaic contains no information about a " + * "regular overlap and so cannot at this time be used to perform correlation."); * * return; * } */ break; } } correlator.MosaicInfo = MosaicWindow.MosaicInfo; correlator.ThreadController = new ThreadController(this); correlator.TextFeedbackDelegate = new CorrelatorTextFeedbackDelegate(this.TextSent); correlator.TileCorrelatedHandler = new CorrelatorTileCorrelatedDelegate(this.OnTileCorrelated); correlator.TileCorrelationBeginHandler = new CorrelatorTileCorrelationBeginDelegate(OnTileCorrelationBegin); correlator.TileCorrelatedCompletedHandler = new CorrelatorTileCorrelatedCompletedDelegate(TileCorrelationCompleted); correlator.TileCorrelatedProgressHandler = new CorrelatorTileCorrelationProgressDelegate(TileCorrelationProgressUpdate); correlator.CorrelationPausedOrResumedHandler = new CorrelatorTileCorrelationPausedOrResumedDelegate(CorrlationPausedOrResumed); if (this.correlator.OptionPanel != null) { this.correlatorOptionPanel.Controls.Add(this.correlator.OptionPanel); if (this.correlatorOptionPanel.Controls.Count > 1) { this.correlatorOptionPanel.Controls.RemoveAt(0); } this.correlator.OptionPanel.Show(); } this.correlateButton.Enabled = true; }
private void SetCorrelationForCombobox() { switch (this.correlationTypeComboBox.SelectedIndex) { case 0: { correlator = null; this.correlatorOptionPanel.Controls.Clear(); this.correlateButton.Enabled = false; this.correlatorPauseButton.Enabled = false; return; } case 1: { correlator = new KernalBasedOverlapCorrelator(MosaicWindow.MosaicInfo, this.tiledImageViewer); /* if (!MosaicWindow.MosaicInfo.HasConstantOverlap) { MessageBox.Show("The currently loaded mosaic contains no information about a " + "regular overlap and so cannot at this time be used to perform correlation."); return; } */ break; } } correlator.MosaicInfo = MosaicWindow.MosaicInfo; correlator.ThreadController = new ThreadController(this); correlator.TextFeedbackDelegate = new CorrelatorTextFeedbackDelegate(this.TextSent); correlator.TileCorrelatedHandler = new CorrelatorTileCorrelatedDelegate(this.OnTileCorrelated); correlator.TileCorrelationBeginHandler = new CorrelatorTileCorrelationBeginDelegate(OnTileCorrelationBegin); correlator.TileCorrelatedCompletedHandler = new CorrelatorTileCorrelatedCompletedDelegate(TileCorrelationCompleted); correlator.TileCorrelatedProgressHandler = new CorrelatorTileCorrelationProgressDelegate(TileCorrelationProgressUpdate); correlator.CorrelationPausedOrResumedHandler = new CorrelatorTileCorrelationPausedOrResumedDelegate(CorrlationPausedOrResumed); if (this.correlator.OptionPanel != null) { this.correlatorOptionPanel.Controls.Add(this.correlator.OptionPanel); if (this.correlatorOptionPanel.Controls.Count > 1) this.correlatorOptionPanel.Controls.RemoveAt(0); this.correlator.OptionPanel.Show(); } this.correlateButton.Enabled = true; }