コード例 #1
0
        public void StartSimulationTimer(int interval)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            LoadSimulationConfiguration();

            int hBinning = 1, vBinning = 1;

            ChartArray.BuildChartArray(m_mask.Rows, m_mask.Cols, hBinning, vBinning, m_indicatorList);

            ////////////////////////////////////////////////////
            //m_uiTask = TaskScheduler.FromCurrentSynchronizationContext();
            Dictionary <int, ImageDisplay> idDictionary = ChartArray.GetImageDisplayDictionary();

            m_displayPipeline = m_imager.CreateDisplayPipeline(m_uiTask, idDictionary);


            m_storagePipeline = m_imager.CreateImageStoragePipeline(GlobalVars.CompressionAlgorithm, m_iParams.imageWidth, m_iParams.imageHeight);

            if (ChartArray != null)
            {
                m_analysisPipeline = m_imager.CreateAnalysisPipeline(ChartArray, m_mask, m_iParams.imageWidth,
                                                                     m_iParams.imageHeight, m_iParams.HorzBinning, m_iParams.VertBinning,
                                                                     m_iParams.ExperimentIndicatorID, m_controlSubtractionWellList, m_numFoFrames,
                                                                     m_dynamicRatioNumerator.ExperimentIndicatorID,
                                                                     m_dynamicRatioDenominator.ExperimentIndicatorID);
            }

            if (m_histogram != null)
            {
                m_histogramPipeline = m_imager.CreateHistogramPipeline(m_uiTask, m_histogram);
            }



            /////////////////////////////////////////////////////////
            // use reference images as simulated images from camera
            bool success = m_wgDB.GetAllReferenceImages();

            m_simulationImageList = new List <ushort[]>();
            foreach (ReferenceImageContainer image in m_wgDB.m_refImageList)
            {
                ushort[] img = new ushort[image.Width * image.Height];
                Buffer.BlockCopy(image.ImageData, 0, img, 0, image.NumBytes);
                m_simulationImageList.Add(img);
            }

            m_simulationTimer          = new DispatcherTimer();
            m_simulationTimer.Tick    += m_simulationTimer_Tick;
            m_simulationTimer.Interval = TimeSpan.FromMilliseconds(interval);
            m_simulationTime           = 0;
            m_timerStartDateTime       = DateTime.Now;
            m_simulationTimer.Start();

            stopwatch.Stop();
            PostMessage("startup time = " + stopwatch.ElapsedMilliseconds.ToString());
        }
コード例 #2
0
        public void Configure(ImagingParameters iParams, ProjectContainer project, PlateContainer plate, ExperimentContainer experiment,
                              MethodContainer method,
                              MaskContainer mask, PlateTypeContainer plateType,
                              ObservableCollection <ExperimentIndicatorContainer> indicatorList,
                              ObservableCollection <ExperimentCompoundPlateContainer> compoundPlateList,
                              ObservableCollection <Tuple <int, int> > controlSubtractionWellList,
                              int numFoFrames,
                              ExperimentIndicatorContainer dynamicRatioNumerator,
                              ExperimentIndicatorContainer dynamicRatioDenominator)
        {
            m_iParams                    = iParams;
            m_project                    = project;
            m_experimentPlate            = plate;
            m_experiment                 = experiment;
            m_method                     = method;
            m_mask                       = mask;
            m_plateType                  = plateType;
            m_indicatorList              = indicatorList;
            m_compoundPlateList          = compoundPlateList;
            m_controlSubtractionWellList = controlSubtractionWellList;
            m_numFoFrames                = numFoFrames;
            m_dynamicRatioNumerator      = dynamicRatioNumerator;
            m_dynamicRatioDenominator    = dynamicRatioDenominator;


            m_vworksProtocolFilename = m_method.BravoMethodFile;

            ChartArray.BuildChartArray(mask.Rows, mask.Cols, m_iParams.HorzBinning, m_iParams.VertBinning, m_indicatorList);

            Dictionary <int, ImageDisplay> idDictionary = ChartArray.GetImageDisplayDictionary();

            m_displayPipeline = m_imager.CreateDisplayPipeline(m_uiTask, idDictionary);


            m_storagePipeline = m_imager.CreateImageStoragePipeline(GlobalVars.CompressionAlgorithm, m_iParams.imageWidth, m_iParams.imageHeight);

            int numerID = 0;
            int denomID = 0;

            if (m_dynamicRatioNumerator != null)
            {
                numerID = m_dynamicRatioNumerator.ExperimentIndicatorID;
            }
            if (m_dynamicRatioDenominator != null)
            {
                denomID = m_dynamicRatioDenominator.ExperimentIndicatorID;
            }

            m_analysisPipeline = m_imager.CreateAnalysisPipeline(ChartArray, m_mask, m_iParams.imageWidth,
                                                                 m_iParams.imageHeight, m_iParams.HorzBinning, m_iParams.VertBinning,
                                                                 m_iParams.ExperimentIndicatorID, m_controlSubtractionWellList, m_numFoFrames,
                                                                 numerID, denomID);


            if (m_histogram != null)
            {
                m_histogramPipeline = m_imager.CreateHistogramPipeline(m_uiTask, m_histogram);
            }
        }