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


C# DicomDataset.RecalculateGroupLengths方法代码示例

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


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

示例1: WriteFileMetaInfo

        /// <summary>
        /// Write DICOM file meta information.
        /// </summary>
        /// <param name="target">Byte target subject to writing.</param>
        /// <param name="fileMetaInfo">File meta information.</param>
        /// <param name="options">Writer options.</param>
        private static void WriteFileMetaInfo(
            IByteTarget target,
            DicomDataset fileMetaInfo,
            DicomWriteOptions options)
        {
            // recalculate FMI group length as required by standard
            fileMetaInfo.RecalculateGroupLengths();

            var writer = new DicomWriter(DicomTransferSyntax.ExplicitVRLittleEndian, options, target);
            var walker = new DicomDatasetWalker(fileMetaInfo);
            walker.Walk(writer);
        }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:18,代码来源:DicomFileWriter.cs

示例2: UpdateDatasetGroupLengths

 /// <summary>
 /// If necessary, update dataset syntax and group lengths.
 /// </summary>
 /// <param name="syntax">Transfer syntax.</param>
 /// <param name="dataset">DICOM dataset.</param>
 /// <param name="options">Writer options.</param>
 private static void UpdateDatasetGroupLengths(
     DicomTransferSyntax syntax,
     DicomDataset dataset,
     DicomWriteOptions options)
 {
     if (options.KeepGroupLengths)
     {
         // update transfer syntax and recalculate existing group lengths
         dataset.InternalTransferSyntax = syntax;
         dataset.RecalculateGroupLengths(false);
     }
     else
     {
         // remove group lengths as suggested in PS 3.5 7.2
         //
         //	2. It is recommended that Group Length elements be removed during storage or transfer 
         //	   in order to avoid the risk of inconsistencies arising during coercion of data 
         //	   element values and changes in transfer syntax.
         dataset.RemoveGroupLengths();
     }
 }
开发者ID:gustavosaita,项目名称:fo-dicom,代码行数:27,代码来源:DicomFileWriter.cs


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