Пример #1
0
        private void _addFileToCurrentSet(string file)
        {
            verifyDicom dicom = new verifyDicom();

            // Make sure the file is legal
            if (dicom.verify(file))
            {
                FileInfo fileInfo = new FileInfo(file);
                ListOfFiles.Add(fileInfo);
            }
        }
Пример #2
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);
        }