本文整理汇总了C#中DicomDataset.Where方法的典型用法代码示例。如果您正苦于以下问题:C# DicomDataset.Where方法的具体用法?C# DicomDataset.Where怎么用?C# DicomDataset.Where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DicomDataset
的用法示例。
在下文中一共展示了DicomDataset.Where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegenerateAll
public void RegenerateAll(DicomDataset dataset) {
foreach (var ui in dataset.Where(x => x.ValueRepresentation == DicomVR.UI).ToArray()) {
dataset.Add(ui.Tag, Generate(dataset.Get<DicomUID>(ui.Tag)));
}
foreach (var sq in dataset.Where(x => x.ValueRepresentation == DicomVR.SQ).Cast<DicomSequence>().ToArray()) {
foreach (var item in sq) {
RegenerateAll(item);
}
}
}
示例2: RegenerateAll
public void RegenerateAll(DicomDataset dataset) {
foreach (var ui in dataset.Where(x => x.ValueRepresentation == DicomVR.UI).ToArray()) {
var uid = dataset.Get<DicomUID>(ui.Tag);
if (uid.Type == DicomUidType.SOPInstance || uid.Type == DicomUidType.Unknown)
dataset.Add(ui.Tag, Generate(uid));
}
foreach (var sq in dataset.Where(x => x.ValueRepresentation == DicomVR.SQ).Cast<DicomSequence>().ToArray()) {
foreach (var item in sq) {
RegenerateAll(item);
}
}
}
示例3: FromDataset
/// <summary>
/// Gets all overlays in a DICOM dataset.
/// </summary>
/// <param name="ds">Dataset</param>
/// <returns>Array of overlays</returns>
public static DicomOverlayData[] FromDataset(DicomDataset ds) {
var groups = new List<ushort>();
groups.AddRange(ds.Where(x => x.Tag.Group >= 0x6000 && x.Tag.Group <= 0x60FF && x.Tag.Element == 0x0010).Select(x => x.Tag.Group));
var overlays = new List<DicomOverlayData>();
foreach (var group in groups) {
// ensure that 6000 group is actually an overlay group
if (ds.Get<DicomElement>(new DicomTag(group, 0x0010)).ValueRepresentation != DicomVR.US)
continue;
try {
DicomOverlayData overlay = new DicomOverlayData(ds, group);
overlays.Add(overlay);
} catch {
// bail out if not an overlay group
}
}
return overlays.ToArray();
}
示例4: HasEmbeddedOverlays
public static bool HasEmbeddedOverlays(DicomDataset ds)
{
var groups = new List<ushort>();
groups.AddRange(
ds.Where(x => x.Tag.Group >= 0x6000 && x.Tag.Group <= 0x60FF && x.Tag.Element == 0x0010)
.Select(x => x.Tag.Group));
foreach (var group in groups)
{
if (!ds.Contains(new DicomTag(group, DicomTag.OverlayData.Element))) return true;
}
return false;
}
示例5: FromDataset
/// <summary>
/// Gets all overlays in a DICOM dataset.
/// </summary>
/// <param name="ds">Dataset</param>
/// <returns>Array of overlays</returns>
public static DicomOverlayData[] FromDataset(DicomDataset ds)
{
var groups = new List<ushort>();
groups.AddRange(ds.Where(x => x.Tag.Group >= 0x6000 && x.Tag.Group <= 0x60FF && x.Tag.Element == 0x0010).Select(x => x.Tag.Group));
var overlays = new List<DicomOverlayData>();
foreach (var group in groups) {
DicomOverlayData overlay = new DicomOverlayData(ds, group);
overlays.Add(overlay);
}
return overlays.ToArray();
}