Example #1
0
        /// <summary>
        /// Saves the output from the processor to the data-store. This is invoked
        /// when no corresponding input is found.
        /// </summary>
        /// <param name="output">The output from the processor.</param>
        protected override void Save(IProcessedImage output)
        {
            readImage reader = new readImage();

            byte[] blob = reader.ImageToByteArray(output.Output);

            ProcessedImageRepository processed = new ProcessedImageRepository();

            processed.saveImage(null, blob);
        }
Example #2
0
        /// <summary>
        /// Saves the output from the processor to the data-store.
        /// </summary>
        /// <param name="input">The input object provided to the processor.</param>
        /// <param name="output">The output from the processor.</param>
        protected override void Save(JobInput input, IProcessedImage output)
        {
            FileInfo  file   = (FileInfo)output.Identifier;
            readImage reader = new readImage();

            byte[] blob = reader.ImageToByteArray(output.Output);

            ProcessedImageRepository processed = new ProcessedImageRepository();

            processed.saveImage(file, blob);
        }
Example #3
0
        /// <summary>
        /// Extracts the image from the file
        /// </summary>
        /// <param name="file">The file to extract the image from</param>
        /// <returns>The image contained within the file</returns>
        private Image _extractImage(FileInfo file)
        {
            Image  theImg = null;
            string path   = string.Format(@"{0}/{1}", file.Directory, file.Name);

            // Ensure we have a DICOM file
            verifyDicom d = new verifyDicom();

            if (d.verify(path))
            {
                readImage i     = new readImage();
                byte[]    bytes = i.blob(path);
                using (Stream stream = new MemoryStream(bytes))
                {
                    Image tmp = Image.FromStream(stream);
                    theImg = new Bitmap(tmp);
                }
            }

            return(theImg);
        }
Example #4
0
 void Awake()
 {
     _instance = this;
     test      = GameObject.Find("TestController").GetComponent <TestController>();
 }