Exemplo n.º 1
0
        public IImageProcessor GetImageProcessor(IRobot robot, IProcessingInfo processingInfo)
        {
            IPlateInfo plateInfo = _pip.GetPlateInfo(robot, processingInfo.PlateID);
            IPlateType plateType = _pip.GetPlateType(robot, plateInfo.PlateTypeID);

            return(new ImageProcessor2(robot, processingInfo, plateInfo, plateType));
        }
        /// <summary>
        /// Construct an IImageProcessor instance for the specified IRobot and IProcessingInfo.
        /// </summary>
        /// <param name="robot">The Robot that took the images to be processed by this IImageProcessor instance</param>
        /// <param name="processingInfo">The description of the images to be processed by this IImageProcessor instance</param>
        public ImageProcessor2(IRobot robot, IProcessingInfo processingInfo, IPlateInfo plateInfo, IPlateType plateType)
        {
            // Get Logger.
            _log = LogManager.GetLogger(this.GetType());

            _dateImaged = DateTime.MinValue;
            _lightPath  = 0;

            _robot          = robot;
            _processingInfo = processingInfo;
            _plateInfo      = plateInfo;
            _plateType      = plateType;

            _captureInfo = null;

            SetRegionName(_processingInfo.RegionID);
            SetProfileName(_processingInfo.ProfileID);

            _log.Info(
                "DropNumber=" + processingInfo.DropNumber +
                ";ImagingID=\"" + processingInfo.ImagingID + "\"" +
                ";PlatedID=\"" + processingInfo.PlateID + "\"" +
                ";ProfileID=\"" + processingInfo.ProfileID + "\"" +
                ";RegionID=\"" + processingInfo.RegionID + "\"" +
                ";RegionType=" + processingInfo.RegionType.ToString() +
                ";WellNumber=" + processingInfo.WellNumber +
                ";Robot.Name=\"" + _robot.Name + "\"");
        }
Exemplo n.º 3
0
        private void btnGetPlateInfo_Click(object sender, System.EventArgs e)
        {
            // Cursor to wait
            this.Cursor = Cursors.WaitCursor;

            IPlateInfo pi = pip.GetPlateInfo(getRobot(), getBarcode());

            txtOutput.Text = "";

            if (pi == null)
            {
                txtOutput.AppendText("GetPlateInfo(robot, plateID) returned null");
            }
            else
            {
                txtOutput.AppendText("DateDispensed  = " + pi.DateDispensed.ToString() + "\r\n");
                txtOutput.AppendText("ExperimentName = " + pi.ExperimentName + "\r\n");
                txtOutput.AppendText("PlateNumber    = " + pi.PlateNumber + "\r\n");
                txtOutput.AppendText("PlateTypeID    = " + pi.PlateTypeID + "\r\n");
                txtOutput.AppendText("ProjectName    = " + pi.ProjectName + "\r\n");
                txtOutput.AppendText("UserEmail      = " + pi.UserEmail + "\r\n");
                txtOutput.AppendText("UserName       = "******"\r\n");
            }

            // Cursor to deafult
            this.Cursor = Cursors.Default;
        }
Exemplo n.º 4
0
 /// <summary>
 /// This method is intended to cause any resources that are no
 /// longer necessary to be released
 /// </summary>
 void IDisposable.Dispose()
 {
     _regionName     = null;
     _profileName    = null;
     _captureInfo    = null;
     _robot          = null;
     _processingInfo = null;
     _plateInfo      = null;
     _plateType      = null;
 }
Exemplo n.º 5
0
        public void GetFilenameTest1()
        {
            IImageInfo      imageInfo      = null;         // TODO: Initialize to an appropriate value
            IProcessingInfo processingInfo = null;         // TODO: Initialize to an appropriate value
            IPlateInfo      plateInfo      = null;         // TODO: Initialize to an appropriate value
            IPlateType      plateType      = null;         // TODO: Initialize to an appropriate value
            string          expected       = string.Empty; // TODO: Initialize to an appropriate value
            string          actual;

            actual = FileUtils.GetFilename(imageInfo, processingInfo, plateInfo, plateType);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        /// <summary>
        /// Called once per lifetime before any calls to SetImageInfo.
        /// </summary>
        /// <param name="captureInfo">The ICaptureInfo to use</param>
        public void SetCaptureInfo(ICaptureInfo captureInfo)
        {
            _captureInfo = captureInfo;
            _log.Info("SetCaptureInfo(captureInfo=" + CaptureInfo.ToString(captureInfo) + ")");

            ICaptureInfoExtendedProperties iceip = captureInfo as ICaptureInfoExtendedProperties;

            if (null != iceip)
            {
                _log.Debug("captureInfo is an ICaptureInfoExtendedProperties!");
                this._dateImaged = iceip.DateImaged.ToUniversalTime();
                this._lightPath  = iceip.LightPath;
                this._plateInfo  = iceip.PlateInfo;
                this._plateType  = iceip.PlateType;
            }

            else
            {
                // JMD Had to change the default
                //int lightPath = 0;
                int lightPath = 1;
                foreach (IProperty p in _captureInfo.Properties)
                {
                    //_log.Info(p.Name + "=" + p.Value);

                    // JMD Broken as of 31/03/2011
                    //if (p.Name.EndsWith("UV"))
                    //{
                    //    lightPath = 1;
                    //    break;
                    //}

                    // Try again looking for a visible-only property
                    if (("ImagingCondenser".Equals(p.Name)) || ("ImagingPolarizer".Equals(p.Name)))
                    {
                        lightPath = 0;
                        break;
                    }
                }

                _lightPath = lightPath;
            }
        }
        protected virtual void Dispose(bool disposing)
        {
            if (!this.disposed)
            {
                if (disposing)
                {
                    // dispose managed resources
                }

                // free native resources
                _regionName     = null;
                _profileName    = null;
                _captureInfo    = null;
                _robot          = null;
                _processingInfo = null;
                _plateInfo      = null;
                _plateType      = null;

                disposed = true;
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// This should result in %BARCODE-%WELL-%DROP-R%R%RTP%P-%IT[%II]-z%Z-%DATE-%TIME, eg:
        /// 441312000010-A01-2-R0DRP1-EF-z20-20100316-083621
        /// 441312000010-A01-2-R0DRP1-FL1-z20-20100316-083621
        /// </summary>
        /// <param name="imageInfo"></param>
        /// <param name="processingInfo"></param>
        /// <param name="plateInfo"></param>
        /// <param name="plateType"></param>
        /// <returns></returns>
        public static string GetFilename(IImageInfo imageInfo, IProcessingInfo processingInfo, IPlateInfo plateInfo, IPlateType plateType)
        {
            string filename = "";

            filename += processingInfo.PlateID + "-";
            filename += OPPF.Integrations.ImagerLink.PlateType.WellNumberToString(plateType, processingInfo.WellNumber) + "-";
            filename += processingInfo.DropNumber + "-";

            filename += "R" + processingInfo.RegionID; // Usually 0

            switch (processingInfo.RegionType)         // Usually Drop
            {
            case RegionType.Drop:
                filename += "DR";
                break;

            case RegionType.Overview:
                filename += "OV";
                break;

            case RegionType.RegionOfInterest:
                filename += "RI";
                break;
            }

            filename += "P" + processingInfo.ProfileID + "-"; // Usually 1

            switch (imageInfo.ImageType)
            {
            case ImageType.BestFocus:
                filename += "BF";
                break;

            case ImageType.DropLocation:
                filename += "DL";
                break;

            case ImageType.ExtendedFocus:
                filename += "EF";
                break;

            case ImageType.FocusLevel:
                filename += "FL" + imageInfo.ImageIndex;
                break;
            }

            if (imageInfo.IsZNull)
            {
                filename += "-zN-";
            }
            else
            {
                filename += "-z" + System.Convert.ToInt32(imageInfo.Z) + "-";
            }

            // Assuming ImagingID is plateID-DATE-TIME format.... (with no dashes in the plateID!)
            filename += processingInfo.ImagingID.Remove(0, processingInfo.ImagingID.IndexOf("-") + 1);

            return(filename);
        }