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


C# DICOMBinaryReader.Skip方法代码示例

本文整理汇总了C#中EvilDICOM.Core.IO.Reading.DICOMBinaryReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# DICOMBinaryReader.Skip方法的具体用法?C# DICOMBinaryReader.Skip怎么用?C# DICOMBinaryReader.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EvilDICOM.Core.IO.Reading.DICOMBinaryReader的用法示例。


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

示例1: SkipItemLittleEndian

 public static void SkipItemLittleEndian(DICOMBinaryReader dr, TransferSyntax syntax)
 {
     int length = LengthReader.ReadLittleEndian(VR.Null, dr.Skip(4));
     if (length != -1)
     {
         dr.Skip(length);
     }
     else
     {
         if (syntax == TransferSyntax.EXPLICIT_VR_LITTLE_ENDIAN)
         {
             while (!IsEndOfSequenceItemLittleEndian(dr))
             {
                 dr.StreamPosition -= 8;
                 DICOMElementReader.SkipElementExplicitLittleEndian(dr);
             }
         }
         else
         {
             while (!IsEndOfSequenceItemLittleEndian(dr))
             {
                 dr.StreamPosition -= 8;
                 DICOMElementReader.SkipElementImplicitLittleEndian(dr);
             }
         }
     }
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:27,代码来源:SequenceItemReader.cs

示例2: SkipElementImplicitLittleEndian

 public static void SkipElementImplicitLittleEndian(DICOMBinaryReader dr)
 {
     Tag tag = TagReader.ReadLittleEndian(dr);
     int length = LengthReader.ReadLittleEndian(VR.Null, dr);
     if (length != -1)
     {
         dr.Skip(length);
     }
     else
     {
         dr.Skip(SequenceReader.ReadIndefiniteLengthLittleEndian(dr, TransferSyntax.IMPLICIT_VR_LITTLE_ENDIAN));
         dr.Skip(8);
     }
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:14,代码来源:DICOMElementReader.cs

示例3: SkipItemBigEndian

 public static void SkipItemBigEndian(DICOMBinaryReader dr)
 {
     int length = LengthReader.ReadBigEndian(VR.Null, dr.Skip(4));
     if (length != -1)
     {
         dr.Skip(length);
     }
     else
     {
         while (!IsEndOfSequenceItemBigEndian(dr))
         {
             dr.StreamPosition -= 8;
             DICOMElementReader.SkipElementExplicitBigEndian(dr);
         }
     }
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:16,代码来源:SequenceItemReader.cs

示例4: ReadMaxLength

 public static int? ReadMaxLength(DICOMBinaryReader dr)
 {
     AssertItemType(dr, "Maximum Length", ItemType.MAXIMUM_LENGTH);
     dr.Skip(2); // PDU ID and Reserved Null Byte
     int length = LengthReader.ReadBigEndian(dr, 2);
     return LengthReader.ReadBigEndian(dr, 4);
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:7,代码来源:ItemReader.cs

示例5: ReadUIDItem

 private static string ReadUIDItem(DICOMBinaryReader dr, string itemName, ItemType iType)
 {
     AssertItemType(dr, itemName, iType);
     dr.Skip(2); // PDU ID and Reserved Null Byte
     int length = LengthReader.ReadBigEndian(dr, 2);
     return dr.ReadString(length).Trim();
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:7,代码来源:ItemReader.cs

示例6: ReadAsyncOperations

 public static AsyncOperations ReadAsyncOperations(DICOMBinaryReader dr)
 {
     AssertItemType(dr, "Async Operations", ItemType.ASYNCHRONOUS_OPERATIONS_WINDOW);
     var ao = new AsyncOperations();
     dr.Skip(2); // // PDU ID and Reserved Null Byte
     int length = LengthReader.ReadBigEndian(dr, 2);
     ao.MaxInvokeOperations = LengthReader.ReadBigEndian(dr, 2);
     ao.MaxPerformOperations = LengthReader.ReadBigEndian(dr, 2);
     return ao;
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:10,代码来源:ItemReader.cs

示例7: ReadBigEndian

 /// <summary>
 ///     Reads the data from an element encoded in big endian byte order
 /// </summary>
 /// <param name="lengthToRead">the length of the data</param>
 /// <param name="dr">the binary reader which is reading the DICOM object</param>
 /// <returns>the data from this element</returns>
 public static byte[] ReadBigEndian(int lengthToRead, DICOMBinaryReader dr)
 {
     if (lengthToRead != -1)
     {
         return dr.ReadBytes(lengthToRead);
     }
     int length = SequenceReader.ReadIndefiniteLengthBigEndian(dr);
     byte[] seqBytes = dr.ReadBytes(length);
     dr.Skip(8);
     return seqBytes;
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:17,代码来源:DataReader.cs

示例8: ReadLittleEndian

 /// <summary>
 ///     Reads the data from an element encoded in little endian byte order
 /// </summary>
 /// <param name="lengthToRead">the length of the data</param>
 /// <param name="dr">the binary reader which is reading the DICOM object</param>
 /// <returns>the data from this element</returns>
 public static byte[] ReadLittleEndian(int lengthToRead, DICOMBinaryReader dr, TransferSyntax syntax)
 {
     if (lengthToRead != -1)
     {
         return dr.ReadBytes(lengthToRead);
     }
     int length = SequenceReader.ReadIndefiniteLengthLittleEndian(dr, syntax);
     byte[] seqBytes = dr.ReadBytes(length);
     dr.Skip(8);
     return seqBytes;
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:17,代码来源:DataReader.cs

示例9: ReadBigEndian

        public static DICOMObject ReadBigEndian(DICOMBinaryReader dr, TransferSyntax syntax)
        {
            DICOMObject d;
            int length = LengthReader.ReadLittleEndian(VR.Null, dr.Skip(4));
            if (LengthReader.IsIndefinite(length))
            {
                d = ReadIndefiniteBigEndian(dr, syntax);
            }
            else
            {
                d = DICOMObjectReader.ReadObject(dr.ReadBytes(length), syntax);
            }

            return d;
        }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:15,代码来源:SequenceItemReader.cs

示例10: ReadLittleEndian

        /// <summary>
        ///     Reads the length in little endian byte format from a series of bytes in a stream. The number of bytes is
        ///     automatically determined from
        ///     VR.
        /// </summary>
        /// <param name="vr">the value representation of the element</param>
        /// <param name="dr">the binary stream with a current position on the length parameter</param>
        /// <returns></returns>
        public static int ReadLittleEndian(VR vr, DICOMBinaryReader dr)
        {
            int length = 0;

            switch (VRDictionary.GetEncodingFromVR(vr))
            {
                case VREncoding.Implicit:
                    byte[] byteLength = dr.ReadBytes(4);
                    length = BitConverter.ToInt32(byteLength, 0);
                    break;
                case VREncoding.ExplicitLong:
                    byteLength = dr.Skip(2).ReadBytes(4);
                    length = BitConverter.ToInt32(byteLength, 0);
                    break;
                case VREncoding.ExplicitShort:
                    byteLength = dr.ReadBytes(2);
                    length = BitConverter.ToUInt16(byteLength, 0);
                    break;
            }
            return length;
        }
开发者ID:Baasanjav,项目名称:Evil-DICOM,代码行数:29,代码来源:LengthReader.cs

示例11: ReadPresentationCtxContents

 private static PresentationContext ReadPresentationCtxContents(byte[] contents, bool requestType = false)
 {
     var pc = new PresentationContext();
     pc.TransferSyntaxes = new List<string>();
     using (var dr = new DICOMBinaryReader(contents))
     {
         pc.Id = dr.Take(1)[0];
         dr.Skip(1); //Reserved Null Byte
         pc.Reason = (PresentationContextReason) Enum.ToObject(typeof (PresentationContextReason), dr.Take(1)[0]);
         dr.Skip(1); //Reserved Null Byte
         if (requestType)
         {
             pc.AbstractSyntax = ReadAbstractSyntax(dr).Trim();
         }
         while (dr.StreamPosition < dr.StreamLength)
         {
             long initPos = dr.StreamPosition;
             pc.TransferSyntaxes.Add(ReadTransferSyntax(dr));
             if (dr.StreamPosition == initPos)
             {
                 break;
             }
         }
     }
     return pc;
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:26,代码来源:ItemReader.cs

示例12: ReadPresentationCtxAccept

 public static PresentationContext ReadPresentationCtxAccept(DICOMBinaryReader dr)
 {
     AssertItemType(dr, "Presentation Context Accept", ItemType.PRESENTATION_CONTEXT_ACCEPT);
     dr.Skip(2); // PDU id Reserved Null Byte
     int length = LengthReader.ReadBigEndian(dr, 2);
     return ReadPresentationCtxContents(dr.Take(length));
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:7,代码来源:ItemReader.cs

示例13: ReadUserInfo

 public static UserInfo ReadUserInfo(DICOMBinaryReader dr)
 {
     AssertItemType(dr, "User Info", ItemType.USER_INFO);
     var ui = new UserInfo();
     dr.Skip(2); // PDU ID and Reserved Null Byte
     int length = LengthReader.ReadBigEndian(dr, 2);
     if (length > 0)
     {
         ui.MaxPDULength = (int) ReadMaxLength(dr);
         ui.ImplementationUID = ReadImplementationClassUID(dr);
         if (dr.Peek(1)[0] == (byte) ItemType.ASYNCHRONOUS_OPERATIONS_WINDOW)
         {
             ui.AsynchronousOperations = ReadAsyncOperations(dr);
         }
         ui.ImplementationVersion = ReadImplementationVersion(dr);
     }
     return ui;
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:18,代码来源:ItemReader.cs

示例14: SkipElementExplicitBigEndian

 public static void SkipElementExplicitBigEndian(DICOMBinaryReader dr)
 {
     Tag tag = TagReader.ReadBigEndian(dr);
     VR vr = VRReader.Read(dr);
     int length = LengthReader.ReadBigEndian(vr, dr);
     if (length != -1)
     {
         dr.Skip(length);
     }
     else
     {
         dr.Skip(SequenceReader.ReadIndefiniteLengthBigEndian(dr));
         dr.Skip(8);
     }
 }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:15,代码来源:DICOMElementReader.cs

示例15: ReadBigEndian

        /// <summary>
        ///     Reads the length in big endian byte format from a series of bytes in a stream. The number of bytes is automatically
        ///     determined from
        ///     VR.
        /// </summary>
        /// <param name="vr">the value representation of the element</param>
        /// <param name="dr">the binary stream with a current position on the length parameter</param>
        /// <returns></returns>
        public static int ReadBigEndian(VR vr, DICOMBinaryReader dr)
        {
            byte[] bytes = null;

            switch (VRDictionary.GetEncodingFromVR(vr))
            {
                case VREncoding.Implicit:
                    bytes = dr.ReadBytes(4);
                    break;
                case VREncoding.ExplicitLong:
                    bytes = dr.Skip(2).ReadBytes(4);
                    break;
                case VREncoding.ExplicitShort:
                    bytes = dr.ReadBytes(2);
                    break;
            }
            return ReadBigEndian(bytes);
        }
开发者ID:DMIAOCHEN,项目名称:Evil-DICOM,代码行数:26,代码来源:LengthReader.cs


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