Ejemplo n.º 1
0
        public new static DicomStructuredReport Open(string fileName)
        {
            var df = new DicomStructuredReport();

            // reset datasets
            df.FileMetaInfo.Clear();
            df.Dataset.Clear();

            try {
                df.File = new FileReference(fileName);

                using (var source = new FileByteSource(df.File)) {
                    DicomFileReader reader = new DicomFileReader();

                    var datasetObserver = new DicomDatasetReaderObserver(df.Dataset);

                    reader.Read(source,
                                new DicomDatasetReaderObserver(df.FileMetaInfo),
                                datasetObserver);

                    df.Format = reader.FileFormat;

                    df.Dataset.InternalTransferSyntax = reader.Syntax;

                    return(df);
                }
            } catch (Exception e) {
                throw new DicomFileException(df, e.Message, e);
            }
        }
Ejemplo n.º 2
0
        public new static IAsyncResult BeginOpen(string fileName, AsyncCallback callback, object state)
        {
            var df = new DicomStructuredReport();

            // reset datasets
            df.FileMetaInfo.Clear();
            df.Dataset.Clear();

            df.File = new FileReference(fileName);

            FileByteSource source = new FileByteSource(df.File);

            EventAsyncResult result = new EventAsyncResult(callback, state);

            DicomFileReader reader = new DicomFileReader();

            var datasetObserver = new DicomDatasetReaderObserver(df.Dataset);

            reader.BeginRead(source,
                             new DicomDatasetReaderObserver(df.FileMetaInfo),
                             datasetObserver,
                             OnReadComplete, new Tuple <DicomFileReader, DicomStructuredReport, EventAsyncResult>(reader, df, result));

            return(result);
        }
Ejemplo n.º 3
0
		protected override void OnLoad(EventArgs e) {
			try {
				tvReport.BeginUpdate();
				tvReport.Nodes.Clear();

				var sr = new DicomStructuredReport(_file.Dataset);
				var node = tvReport.Nodes.Add(sr.ToString());
				foreach (var child in sr.Children())
					AddTreeNode(child, node);

				tvReport.ExpandAll();
				node.EnsureVisible();
				tvReport.EndUpdate();
			} catch (Exception ex) {
				OnException(ex);
			}
		}