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


C# DcmDataset.Contains方法代码示例

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


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

示例1: Match

 public bool Match(DcmDataset dataset)
 {
     if (dataset.Contains(_tag)) {
         string value = dataset.GetValueString(_tag);
         return value.Contains(_value);
     }
     return false;
 }
开发者ID:fo-dicom,项目名称:mdcm,代码行数:8,代码来源:DicomMatch.cs

示例2: Transform

		public void Transform(DcmDataset dataset) {
			if (dataset.Contains(_tag)) {
				string value = dataset.GetValueString(_tag);
				string[] parts = value.Split('\\');
				for (int i = 0; i < parts.Length; i++) {
					if (parts[i].Length > _length)
						parts[i] = parts[i].Substring(0, _length);
				}
				value = String.Join("\\", parts);
				dataset.AddElementWithValueString(_tag, value);
			}
		}
开发者ID:hide1980,项目名称:mdcm,代码行数:12,代码来源:DicomTransform.cs

示例3: DcmPixelData

		public DcmPixelData(DcmDataset dataset) {
			_transferSyntax = dataset.InternalTransferSyntax;
			_lossy = dataset.GetString(DicomTags.LossyImageCompression, "00") != "00";
			_lossyMethod = dataset.GetString(DicomTags.LossyImageCompressionMethod, String.Empty);
			_lossyRatio = dataset.GetString(DicomTags.LossyImageCompressionRatio, String.Empty);
			_frames = dataset.GetInt32(DicomTags.NumberOfFrames, 1);
			_width = dataset.GetUInt16(DicomTags.Columns, 0);
			_height = dataset.GetUInt16(DicomTags.Rows, 0);
			_bitsStored = dataset.GetUInt16(DicomTags.BitsStored, 0);
			_bitsAllocated = dataset.GetUInt16(DicomTags.BitsAllocated, 0);
			_highBit = dataset.GetUInt16(DicomTags.HighBit, (ushort)(_bitsStored - 1));
			_samplesPerPixel = dataset.GetUInt16(DicomTags.SamplesPerPixel, 0);
			_pixelRepresentation = dataset.GetUInt16(DicomTags.PixelRepresentation, 0);
			_planarConfiguration = dataset.GetUInt16(DicomTags.PlanarConfiguration, 0);
			_photometricInterpretation = dataset.GetString(DicomTags.PhotometricInterpretation, String.Empty);
			_rescaleSlope = dataset.GetDouble(DicomTags.RescaleSlope, 1.0);
			_rescaleIntercept = dataset.GetDouble(DicomTags.RescaleIntercept, 0.0);
			_pixelDataItem = dataset.GetItem(DicomTags.PixelData);

			_hasPixelPadding = dataset.Contains(DicomTags.PixelPaddingValue);
			if (_hasPixelPadding) {
				DcmElement elem = dataset.GetElement(DicomTags.PixelPaddingValue);
				if (elem is DcmUnsignedShort)
					_pixelPaddingValue = (elem as DcmUnsignedShort).GetValue();
				else if (elem is DcmSignedShort) {
					_pixelPaddingValue = (elem as DcmSignedShort).GetValue();
				} else
					_pixelPaddingValue = MinimumDataValue;
			}
		}
开发者ID:mcmssupereditor,项目名称:mdcm,代码行数:30,代码来源:DcmPixelData.cs

示例4: Load

		private void Load(DcmDataset ds) {
			_rows = ds.GetUInt16(OverlayTag(DicomTags.OverlayRows), 0);
			_columns = ds.GetUInt16(OverlayTag(DicomTags.OverlayColumns), 0);
			_type = ds.GetString(OverlayTag(DicomTags.OverlayType), "Unknown");

			DicomTag tag = OverlayTag(DicomTags.OverlayOrigin);
			if (ds.Contains(tag)) {
				short[] xy = ds.GetSS(tag).GetValues();
				if (xy != null && xy.Length == 2) {
					_originX = xy[0];
					_originY = xy[1];
				}
			}

			_bitsAllocated = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitsAllocated), 1);
			_bitPosition = ds.GetUInt16(OverlayTag(DicomTags.OverlayBitPosition), 0);

			tag = OverlayTag(DicomTags.OverlayData);
			if (ds.Contains(tag)) {
				DcmElement elem = ds.GetElement(tag);
				_data = elem.ByteBuffer.ToBytes();
			}

			_description = ds.GetString(OverlayTag(DicomTags.OverlayDescription), String.Empty);
			_subtype = ds.GetString(OverlayTag(DicomTags.OverlaySubtype), String.Empty);
			_label = ds.GetString(OverlayTag(DicomTags.OverlayLabel), String.Empty);

			_frames = ds.GetInt32(OverlayTag(DicomTags.NumberOfFramesInOverlay), 1);
			_frameOrigin = ds.GetUInt16(OverlayTag(DicomTags.ImageFrameOrigin), 1);

			//TODO: include ROI
		}
开发者ID:hide1980,项目名称:mdcm,代码行数:32,代码来源:DcmOverlayData.cs

示例5: FromDataset

        public static WindowLevel[] FromDataset(DcmDataset dataset)
        {
            List<WindowLevel> settings = new List<WindowLevel>();

            if (dataset.Contains(DicomTags.WindowCenter) && dataset.Contains(DicomTags.WindowWidth)) {
                string[] wc = dataset.GetDS(DicomTags.WindowCenter).GetValues();
                string[] ww = dataset.GetDS(DicomTags.WindowWidth).GetValues();

                if (wc.Length != ww.Length)
                    throw new DicomImagingException("Window Center count does not match Window Width count");

                string[] desc = null;
                if (dataset.Contains(DicomTags.WindowCenterWidthExplanation)) {
                    desc = dataset.GetLO(DicomTags.WindowCenterWidthExplanation).GetValues();
                }

                for (int i = 0; i < wc.Length; i++) {
                    double window;
                    double level;
                    if (!Double.TryParse(ww[i], out window) &&
                        !Double.TryParse(ww[i], System.Globalization.NumberStyles.Float,
                                         System.Globalization.CultureInfo.InvariantCulture, out window))
                        throw new DicomImagingException("Unable to parse Window/Level [ww: {0}]", ww[i]);

                    if (!Double.TryParse(wc[i], out level) &&
                        !Double.TryParse(wc[i], System.Globalization.NumberStyles.Float,
                                         System.Globalization.CultureInfo.InvariantCulture, out level))
                        throw new DicomImagingException("Unable to parse Window/Level [wc: {0}]", wc[i]);

                    string description = String.Empty;
                    if (desc != null && i < desc.Length)
                        description = desc[i];

                    settings.Add(new WindowLevel(description, window, level));
                }
            }

            return settings.ToArray();
        }
开发者ID:CharlieRoot,项目名称:mdcm,代码行数:39,代码来源:WindowLevel.cs


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