Example #1
0
        public void RetrieveFrame(Frame frame)
        {
            Interlocked.Increment(ref _activeRetrieveThreads);

            try
            {
                string message = String.Format("Retrieving Frame (active threads: {0})", Thread.VolatileRead(ref _activeRetrieveThreads));
                Trace.WriteLine(message);

                IStreamingSopDataSource dataSource = (IStreamingSopDataSource)frame.ParentImageSop.DataSource;
                IStreamingSopFrameData  frameData  = dataSource.GetFrameData(frame.FrameNumber);

                frameData.RetrievePixelData();
            }
            catch (OutOfMemoryException)
            {
                Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data.");
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
            }
            finally
            {
                Interlocked.Decrement(ref _activeRetrieveThreads);
            }
        }
        public void RetrieveFrame(Frame frame)
        {
            Interlocked.Increment(ref _activeRetrieveThreads);

            try
            {
                IStreamingSopDataSource dataSource = (IStreamingSopDataSource)frame.ParentImageSop.DataSource;
                IStreamingSopFrameData  frameData  = dataSource.GetFrameData(frame.FrameNumber);

                frameData.RetrievePixelData();
            }
            catch (OutOfMemoryException)
            {
                Platform.Log(LogLevel.Error, "Out of memory trying to retrieve pixel data.");
            }
            catch (Exception e)
            {
                Platform.Log(LogLevel.Error, e, "Error retrieving frame pixel data.");
            }
            finally
            {
                Interlocked.Decrement(ref _activeRetrieveThreads);
            }
        }