当前位置: 首页>>代码示例>>C#>>正文


C# DicomTag类代码示例

本文整理汇总了C#中DicomTag的典型用法代码示例。如果您正苦于以下问题:C# DicomTag类的具体用法?C# DicomTag怎么用?C# DicomTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DicomTag类属于命名空间,在下文中一共展示了DicomTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBeginSequence

		public void OnBeginSequence(IByteSource source, DicomTag tag, uint length) {
			DicomSequence sq = new DicomSequence(tag);
			_sequences.Push(sq);

			DicomDataset ds = _datasets.Peek();
			ds.Add(sq);
		}
开发者ID:dremerdt,项目名称:fo-dicom,代码行数:7,代码来源:DicomDatasetReaderObserver.cs

示例2: DicomReaderEventArgs

 public DicomReaderEventArgs(long position, DicomTag tag, DicomVR vr, IByteBuffer data)
 {
     Position = position;
     Tag = tag;
     VR = vr;
     Data = data;
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:7,代码来源:DicomReaderEventArgs.cs

示例3: OnBeginSequence

 public void OnBeginSequence(IByteSource source, DicomTag tag, uint length)
 {
     _currentSequenceTag.Push(tag);
     if (tag == DicomTag.DirectoryRecordSequence) {
         _directoryRecordSequence = _dataset.Get<DicomSequence>(tag);
     }
 }
开发者ID:anqin888,项目名称:fo-dicom,代码行数:7,代码来源:DicomDirectoryReaderObserver.cs

示例4: TestFile

        public void TestFile()
        {
            string filename = "OutOfRange.dcm";

            DicomFile file = new DicomFile(filename, new DicomAttributeCollection(), new DicomAttributeCollection());
            SetupMR(file.DataSet);
            SetupMetaInfo(file);

            DicomTag tag = new DicomTag(0x00030010, "Test", "TestBad", DicomVr.LOvr, false, 1, 1, false);

            file.DataSet[tag].SetStringValue("Test");

            file.Save(filename);

            file = new DicomFile(filename);

            file.DataSet.IgnoreOutOfRangeTags = true;

            file.Load();

            Assert.IsNotNull(file.DataSet.GetAttribute(tag));

            file = new DicomFile(filename);

            file.DataSet.IgnoreOutOfRangeTags = false;

            try
            {
                file.Load();
                Assert.Fail("file.Load failed");
            }
            catch (DicomException)
            {
            }
        }
开发者ID:khaha2210,项目名称:radio,代码行数:35,代码来源:AttributeCollectionTest.cs

示例5: IsStoredTag

        private bool IsStoredTag(DicomTag tag)
        {
            if (_metaInfo.Contains(tag))
                return true;

            //if it's meta info, just defer to the file.
            if (tag.TagValue <= 0x0002FFFF)
                return false;

            if (_xml.IsTagExcluded(tag.TagValue))
                return false;

            if (tag.VR == DicomVr.SQvr)
            {
                var items = _xml[tag].Values as DicomSequenceItem[];
                if (items != null)
                {
                    if (items.OfType<InstanceXmlDicomSequenceItem>().Any(item => item.HasExcludedTags(true)))
                        return false;
                }
            }

            bool isBinary = tag.VR == DicomVr.OBvr || tag.VR == DicomVr.OWvr || tag.VR == DicomVr.OFvr;
            //these tags are not stored in the xml.
            if (isBinary || tag.IsPrivate || tag.VR == DicomVr.UNvr)
                return false;

            return true;
        }
开发者ID:yjsyyyjszf,项目名称:ClearCanvas-1,代码行数:29,代码来源:SopInstance.cs

示例6: BeginRead

		public IAsyncResult BeginRead(IByteSource source, IDicomReaderObserver observer, DicomTag stop, AsyncCallback callback, object state) {
			_stop = stop;
			_observer = observer;
			_result = DicomReaderResult.Processing;
			_exception = null;
			_async = new EventAsyncResult(callback, state);
			ThreadPool.QueueUserWorkItem(ParseProc, source);
			return _async;
		}
开发者ID:peerct,项目名称:fo-dicom,代码行数:9,代码来源:DicomReader.cs

示例7: OnElement_ValidData_AddsCorrectTypeToDataset

        public void OnElement_ValidData_AddsCorrectTypeToDataset(DicomTag tag, DicomVR vr, string data, Type expected)
        {
            var dataset = new DicomDataset();
            var observer = new DicomDatasetReaderObserver(dataset);
            var buffer = new MemoryByteBuffer(Encoding.ASCII.GetBytes(data));

            observer.OnElement(null, tag, vr, buffer);
            Assert.IsType(expected, dataset.First());
        }
开发者ID:aerik,项目名称:fo-dicom,代码行数:9,代码来源:DicomDatasetReaderObserverTest.cs

示例8: DicomNGetRequest

 public DicomNGetRequest(
     DicomUID requestedClassUid,
     DicomUID requestedInstanceUid,
     DicomTag[] attributes,
     DicomPriority priority = DicomPriority.Medium)
     : base(DicomCommandField.NGetRequest, requestedClassUid, priority)
 {
     SOPInstanceUID = requestedInstanceUid;
 }
开发者ID:GMZ,项目名称:fo-dicom,代码行数:9,代码来源:DicomNGetRequest.cs

示例9: OnBeginFragmentSequence

 public void OnBeginFragmentSequence(IByteSource source, DicomTag tag, DicomVR vr)
 {
     _log.Log(
         _level,
         "{marker:x8}: {padding}{tag} {vrCode} {tagDictionaryEntryName}",
         source.Marker,
         _pad,
         tag,
         vr.Code,
         tag.DictionaryEntry.Name);
     IncreaseDepth();
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:12,代码来源:DicomParserLogger.cs

示例10: OnBeginSequence

 public void OnBeginSequence(IByteSource source, DicomTag tag, uint length)
 {
     _log.Log(
         _level,
         "{marker:x8}: {padding}{tag} SQ {length}",
         source.Marker,
         _pad,
         tag,
         tag.DictionaryEntry.Name,
         length);
     IncreaseDepth();
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:12,代码来源:DicomParserLogger.cs

示例11: OnElement

 public void OnElement(IByteSource source, DicomTag tag, DicomVR vr, IByteBuffer data)
 {
     _log.Log(
         _level,
         "{marker:x8}: {padding}{tag} {vrCode} {tagDictionaryEntryName} [{size}]",
         source.Marker,
         _pad,
         tag,
         vr.Code,
         tag.DictionaryEntry.Name,
         data.Size);
 }
开发者ID:aerik,项目名称:fo-dicom,代码行数:12,代码来源:DicomParserLogger.cs

示例12: OnBeginFragmentSequence

        public void OnBeginFragmentSequence(IByteSource source, DicomTag tag, DicomVR vr)
        {
            if (vr == DicomVR.OB)
                _fragment = new DicomOtherByteFragment(tag);
            else if (vr == DicomVR.OW)
                _fragment = new DicomOtherWordFragment(tag);
            else
                throw new DicomDataException("Unexpected VR found for DICOM fragment sequence: {0}", vr.Code);

            DicomDataset ds = _datasets.Peek();
            ds.Add(_fragment);
        }
开发者ID:jwake,项目名称:fo-dicom,代码行数:12,代码来源:DicomDatasetReaderObserver.cs

示例13: DicomDictionaryEntry

        public DicomDictionaryEntry(DicomTag tag, string name, string keyword, DicomVM vm, bool retired,
                                    params DicomVr[] vrs)
        {
            Tag = tag;

            Name = string.IsNullOrWhiteSpace(name) ? tag.ToString() : name;

            Keyword = string.IsNullOrWhiteSpace(keyword) ? Name : keyword;

            ValueMultiplicity = vm;
            ValueRepresentations = vrs;
            IsRetired = retired;
        }
开发者ID:kevinpig,项目名称:MyRepository,代码行数:13,代码来源:DicomDictionaryEntry.cs

示例14: ConvertAttributeToUN

        public void ConvertAttributeToUN(DicomAttributeCollection theSet, uint tag)
        {
            ByteBuffer theData =
                theSet[tag].GetByteBuffer(TransferSyntax.ImplicitVrLittleEndian,
                                          theSet.SpecificCharacterSet);

            DicomTag baseTag = DicomTagDictionary.GetDicomTag(tag);
            DicomTag theTag = new DicomTag(tag,
                baseTag.Name, baseTag.VariableName, DicomVr.UNvr, baseTag.MultiVR, baseTag.VMLow, baseTag.VMHigh, baseTag.Retired);

            DicomAttribute unAttrib = DicomVr.UNvr.CreateDicomAttribute(theTag, theData);
            theSet[tag] = unAttrib;
        }
开发者ID:emmandeb,项目名称:ClearCanvas-1,代码行数:13,代码来源:AbstractTest.cs

示例15: TestIgnoreOutOfRangeTags

		public void TestIgnoreOutOfRangeTags()
		{
			DicomFile file = new DicomFile();
			DicomAttributeCollection collection = file.DataSet;

			SetupMR(collection);
			collection.IgnoreOutOfRangeTags = true;

			DicomTag tag = new DicomTag(0x00030010, "Test", "TestBad", DicomVr.STvr, false, 1, 1, false);

			Assert.IsNotNull(collection.GetAttribute(tag));
			Assert.IsNotNull(collection[tag]);
	
			try
			{
				DicomAttribute attrib = collection[tag.TagValue];
				Assert.Fail("DicomAttributeCollection.GetAttribute failed");
			}
			catch (DicomException)
			{
			}

			collection.IgnoreOutOfRangeTags = false;

			try
			{
				collection.GetAttribute(tag);
				Assert.Fail("DicomAttributeCollection.GetAttribute failed");
			}
			catch (DicomException)
			{
			}

			try
			{
				DicomAttribute attrib = collection[tag];
				Assert.Fail("DicomAttributeCollection.GetAttribute failed");
			}
			catch (DicomException)
			{
			}

			try
			{
				DicomAttribute attrib = collection[tag.TagValue];
				Assert.Fail("DicomAttributeCollection.GetAttribute failed");
			}
			catch (DicomException)
			{
			}
		}
开发者ID:khaha2210,项目名称:radio,代码行数:51,代码来源:AttributeCollectionTest.cs


注:本文中的DicomTag类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。