private void OnWindowLoaded(object sender, RoutedEventArgs e) { Network = new CnnNet(Constants.NetworkWidth, Constants.NetworkHeight); #region Viewer Network InitializeViewer(_viewerManager = new ViewerManagerNetwork(Network), new ViewerBase[] { _viewerDesirability = new ViewerNetworkDesirability(Network), _viewerUndesirability = new ViewerNetworkUndesirability(Network) }, ImageNetwork); _viewerManager.NeuronSelectedChanged += OnViewerManagerNeuronSelectedChanged; #endregion #region Viewer Axon Terminal Guidance Forces InitializeViewer (_viewerManagerAxonTerminal = new ViewerManager (Constants.AxonGuidanceForcesImageWidth, Constants.AxonGuidanceForcesImageHeight, true), new ViewerBase[] { _viewerAxonTerminalGuidanceForces = new ViewerGuidanceForce(Network.AxonGuidanceForces.ElementAt(0), ColorIndex.Green) }, ImageAxonTerminalGuidanceForces); #endregion #region Viewer Soma Guidance Forces InitializeViewer (_viewerManagerSoma = new ViewerManager (Constants.SomaGuidanceForcesImageWidth, Constants.SomaGuidanceForcesImageHeight, true), new ViewerBase[] { _viewerSomaDesirabilityMapGuidanceForce = new ViewerGuidanceForce(Network.SomaGuidanceForces.ElementAt(0), ColorIndex.Green) }, ImageSomaDesirabilityMapGuidanceForce); #endregion Network.ActiveNeuronGenerator = cboxGenerateInput.IsChecked.Value ? Network.NormalActiveNeuronGenerator : Network.BindedActiveNeuronGenerator; CompositionTarget.Rendering += OnCompositionTargetRendering; }
private void InitializeViewer(ViewerManager viewerManager, IEnumerable<ViewerBase> viewers, Image image) { viewers.ToList().ForEach(viewerManager.RegisterViewer); image.Source = viewerManager.WriteableBitmap; }