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


C# Data.DicomTransferSyntax类代码示例

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


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

示例1: DcmPresContext

		internal DcmPresContext(byte pcid, DicomUID abstractSyntax, DicomTransferSyntax transferSyntax, DcmPresContextResult result) {
			_pcid = pcid;
			_result = result;
			_abstract = abstractSyntax;
			_transfers = new List<DicomTransferSyntax>();
			_transfers.Add(transferSyntax);
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:7,代码来源:DcmAssociate.cs

示例2: CalculateWriteLength

		internal override uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options) {
			uint length = 4 + 4;
			length += Dataset.CalculateWriteLength(syntax, options & ~DicomWriteOptions.CalculateGroupLengths);
			if (!Flags.IsSet(options, DicomWriteOptions.ExplicitLengthSequenceItem))
				length += 4 + 4; // Sequence Item Delimitation Item
			return length;
		}
开发者ID:hide1980,项目名称:mdcm,代码行数:7,代码来源:DcmItemSequence.cs

示例3: DcmDataset

 public DcmDataset(long streamPosition, uint lengthInStream, DicomTransferSyntax transferSyntax)
 {
     _streamPosition = streamPosition;
     _streamLength = lengthInStream;
     _transferSyntax = transferSyntax;
     _items = new SortedList<DicomTag, DcmItem>(new DicomTagComparer());
 }
开发者ID:karanbajaj,项目名称:mdcm,代码行数:7,代码来源:DcmDataset.cs

示例4: HasCodec

		public static bool HasCodec(DicomTransferSyntax ts) {
			if (ts == DicomTransferSyntax.ImplicitVRLittleEndian ||
				ts == DicomTransferSyntax.ExplicitVRLittleEndian ||
				ts == DicomTransferSyntax.ExplicitVRBigEndian)
				return true;
			if (_codecs == null)
				return false;
			return _codecs.ContainsKey(ts);
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomCodec.cs

示例5: GetCodec

		public static IDcmCodec GetCodec(DicomTransferSyntax ts) {
			if (_codecs == null)
				RegisterCodecs();
			Type cType;
			if (_codecs.TryGetValue(ts, out cType)) {
				return (IDcmCodec)Activator.CreateInstance(cType);
			}
			throw new DicomCodecException("No registered codec for transfer syntax!");
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomCodec.cs

示例6: CalculateWriteLength

 public override uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options)
 {
     uint length = 0;
     length += 4; // element tag
     if (syntax.IsExplicitVR) {
         length += 2; // vr
         length += 6; // length
     } else {
         length += 4; // length
     }
     foreach (DcmItemSequenceItem item in SequenceItems) {
         length += item.CalculateWriteLength(syntax, options);
     }
     if (!Flags.IsSet(options, DicomWriteOptions.ExplicitLengthSequence))
         length += 4 + 4; // Sequence Delimitation Item
     return length;
 }
开发者ID:gogorrr,项目名称:mdcm,代码行数:17,代码来源:DcmItemSequence.cs

示例7: CalculateWriteLength

 public abstract uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options);
开发者ID:gogorrr,项目名称:mdcm,代码行数:1,代码来源:DcmItem.cs

示例8: ChangeTransferSyntax

        public void ChangeTransferSyntax(DicomTransferSyntax newTransferSyntax, DcmCodecParameters parameters)
        {
            DicomTransferSyntax oldTransferSyntax = InternalTransferSyntax;

            if (oldTransferSyntax == newTransferSyntax)
                return;

            if (oldTransferSyntax.IsEncapsulated && newTransferSyntax.IsEncapsulated) {
                ChangeTransferSyntax(DicomTransferSyntax.ExplicitVRLittleEndian, parameters);
                oldTransferSyntax = DicomTransferSyntax.ExplicitVRLittleEndian;
            }

            if (Contains(DicomTags.PixelData)) {
                DcmPixelData oldPixelData = new DcmPixelData(this);
                DcmPixelData newPixelData = new DcmPixelData(newTransferSyntax, oldPixelData);

                if (oldTransferSyntax.IsEncapsulated) {
                    IDcmCodec codec = DicomCodec.GetCodec(oldTransferSyntax);
                    codec.Decode(this, oldPixelData, newPixelData, parameters);
                }
                else if (newTransferSyntax.IsEncapsulated) {
                    IDcmCodec codec = DicomCodec.GetCodec(newTransferSyntax);
                    codec.Encode(this, oldPixelData, newPixelData, parameters);
                }
                else {
                    for (int i = 0; i < oldPixelData.NumberOfFrames; i++) {
                        byte[] data = oldPixelData.GetFrameDataU8(i);
                        newPixelData.AddFrame(data);
                    }
                }

                newPixelData.UpdateDataset(this);
            }

            SetInternalTransferSyntax(newTransferSyntax);
        }
开发者ID:karanbajaj,项目名称:mdcm,代码行数:36,代码来源:DcmDataset.cs

示例9: DcmJpegCodec

 protected DcmJpegCodec(DicomTransferSyntax transferSyntax, DcmJpegParameters defaultParameters = null)
 {
     _transferSyntax = transferSyntax;
     _defaultParameters = defaultParameters ?? new DcmJpegParameters();
 }
开发者ID:GMZ,项目名称:mdcm,代码行数:5,代码来源:DcmJpegCodec.cs

示例10: CalculateWriteLength

 public uint CalculateWriteLength(DicomTransferSyntax syntax, DicomWriteOptions options)
 {
     uint length = 0;
     ushort group = 0xffff;
     foreach (DcmItem item in _items.Values) {
         if (item.Tag.Element == 0x0000)
             continue;
         if (item.Tag.Group != group) {
             group = item.Tag.Group;
             if (Flags.IsSet(options, DicomWriteOptions.CalculateGroupLengths)) {
                 if (syntax.IsExplicitVR)
                     length += 4 + 2 + 2 + 4;
                 else
                     length += 4 + 4 + 4;
             }
         }
         length += item.CalculateWriteLength(syntax, options);
     }
     return length;
 }
开发者ID:karanbajaj,项目名称:mdcm,代码行数:20,代码来源:DcmDataset.cs

示例11: RemoveTransfer

 public void RemoveTransfer(DicomTransferSyntax ts)
 {
     if (_transfers.Contains(ts))
         _transfers.Remove(ts);
 }
开发者ID:hide1980,项目名称:mdcm,代码行数:5,代码来源:DcmAssociate.cs

示例12: RemoveTransferSyntax

 /// <summary>
 /// Removes a Transfer Syntax from the specified Presentation Context.
 /// </summary>
 /// <param name="pcid">Presentation Context ID</param>
 /// <param name="ts">Transfer Syntax</param>
 public void RemoveTransferSyntax(byte pcid, DicomTransferSyntax ts)
 {
     GetPresentationContext(pcid).RemoveTransfer(ts);
 }
开发者ID:hide1980,项目名称:mdcm,代码行数:9,代码来源:DcmAssociate.cs

示例13: ChangeTransferSytnax

		/// <summary>
		/// Changes transfer syntax of dataset and updates file meta information
		/// </summary>
		/// <param name="ts">New transfer syntax</param>
		/// <param name="parameters">Encode/Decode params</param>
		public void ChangeTransferSytnax(DicomTransferSyntax ts, DcmCodecParameters parameters) {
			Dataset.ChangeTransferSyntax(ts, parameters);
			FileMetaInfo.TransferSyntax = ts;
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:9,代码来源:DicomFileFormat.cs

示例14: AddTransfer

 public void AddTransfer(DicomTransferSyntax ts)
 {
     if (!_transfers.Contains(ts))
         _transfers.Add(ts);
 }
开发者ID:hide1980,项目名称:mdcm,代码行数:5,代码来源:DcmAssociate.cs

示例15: IsImageCompression

		public static bool IsImageCompression(DicomTransferSyntax tx) {
			return  tx != DicomTransferSyntax.ImplicitVRLittleEndian &&
					tx != DicomTransferSyntax.ExplicitVRLittleEndian &&
					tx != DicomTransferSyntax.ExplicitVRBigEndian &&
					tx != DicomTransferSyntax.DeflatedExplicitVRLittleEndian;
		}
开发者ID:hide1980,项目名称:mdcm,代码行数:6,代码来源:DicomTransferSyntax.cs


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