org.dcm4che3.data.Attributes.addSelected()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中org.dcm4che3.data.Attributes.addSelected()方法的一些代码示例,展示了Attributes.addSelected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.addSelected()方法的具体详情如下:
包路径:org.dcm4che3.data.Attributes
类名称:Attributes
方法名:addSelected

Attributes.addSelected介绍

[英]Add selected attributes from another Attributes object to this. The specified array of tag values must be sorted (as by the java.util.Arrays#sort(int[]) method) prior to making this call.
[中]将其他属性对象中的选定属性添加到此属性。在进行此调用之前,必须对指定的标记值数组进行排序(如java.util.Arrays#sort(int[])方法)。

代码示例

代码示例来源:origin: dcm4che/dcm4che

/**
 * Add selected attributes from another Attributes object to this.
 * The specified array of tag values must be sorted (as by the
 * {@link java.util.Arrays#sort(int[])} method) prior to making this call.
 * 
 * @param other the other Attributes object
 * @param selection sorted tag values
 * @return <tt>true</tt> if one ore more attributes were added
 */
public boolean addSelected(Attributes other, int... selection) {
  return addSelected(other, selection, 0, selection.length);
}

代码示例来源:origin: dcm4che/dcm4che

public Attributes(Attributes other, boolean bigEndian, int... selection) {
  this(bigEndian, selection.length);
  if (other.properties != null)
    properties = new HashMap<String, Object>(other.properties);
  addSelected(other, selection);
}

代码示例来源:origin: dcm4che/dcm4che

public Attributes(Attributes other, boolean bigEndian, Attributes selection) {
  this(bigEndian, selection.size());
  if (other.properties != null)
    properties = new HashMap<String, Object>(other.properties);
  addSelected(other, selection);
}

代码示例来源:origin: dcm4che/dcm4che

private void addFunctionGroups(Attributes dest, Attributes fgs) {
  dest.addSelected(fgs, Tag.ReferencedImageSequence);
  Attributes fg;
  for (int sqTag : fgs.tags())
    if (sqTag != Tag.ReferencedImageSequence
        && (fg = fgs.getNestedDataset(sqTag)) != null)
      dest.addAll(fg);
}

代码示例来源:origin: org.dcm4che/dcm4che-emf

private void addFunctionGroups(Attributes dest, Attributes fgs) {
  dest.addSelected(fgs, Tag.ReferencedImageSequence);
  Attributes fg;
  for (int sqTag : fgs.tags())
    if (sqTag != Tag.ReferencedImageSequence
        && (fg = fgs.getNestedDataset(sqTag)) != null)
      dest.addAll(fg);
}

代码示例来源:origin: dcm4che/dcm4che

public void query(File f) throws Exception {
  Attributes attrs;
  String filePath = f.getPath();
  String fileExt = filePath.substring(filePath.lastIndexOf(".")+1).toLowerCase();
  DicomInputStream dis = null;
  try {
    attrs = fileExt.equals("xml")
        ? SAXReader.parse(filePath)
        : new DicomInputStream(f).readDataset(-1, -1);
    if (inFilter != null) {
      attrs = new Attributes(inFilter.length + 1);
      attrs.addSelected(attrs, inFilter);
    }
  } finally {
    SafeClose.close(dis);
  }
  mergeKeys(attrs, keys);
  query(attrs);
}

代码示例来源:origin: org.dcm4che.tool/dcm4che-tool-findscu

public void query(File f) throws Exception {
  Attributes attrs;
  String filePath = f.getPath();
  String fileExt = filePath.substring(filePath.lastIndexOf(".")+1).toLowerCase();
  DicomInputStream dis = null;
  try {
    attrs = fileExt.equals("xml")
        ? SAXReader.parse(filePath)
        : new DicomInputStream(f).readDataset(-1, -1);
    if (inFilter != null) {
      attrs = new Attributes(inFilter.length + 1);
      attrs.addSelected(attrs, inFilter);
    }
  } finally {
    SafeClose.close(dis);
  }
  mergeKeys(attrs, keys);
  query(attrs);
}

代码示例来源:origin: dcm4che/dcm4che

private Attributes keys(RecordType type, Attributes attrs, RecordFactory recFact) {
  int[] selection = recFact.getRecordKeys(type);
  Attributes keys = new Attributes(selection.length + 1);
  keys.setString(Tag.DirectoryRecordType, VR.CS, type.name());
  keys.addSelected(attrs, selection);
  return keys;
}

代码示例来源:origin: dcm4che/dcm4che

private Attributes keys(Attributes attrs, RecordFactory recFact) {
  int[] selection = recFact.getRecordKeys(RecordType.SR_DOCUMENT);
  Attributes keys = new Attributes(selection.length + 1);
  String[] iuids = keys.getStrings(Tag.SOPInstanceUID);
  if (iuids != null && iuids.length > 0)
    keys.setString(Tag.ReferencedSOPInstanceUIDInFile, VR.CS, iuids);
  keys.addSelected(attrs, selection);
  return keys;
}

代码示例来源:origin: dcm4che/dcm4che

protected Attributes adjust(Attributes match) {
    if (match == null)
      return null;

    Attributes filtered = new Attributes(match.size());
    // include SpecificCharacterSet also if not in keys
    if (!keys.contains(Tag.SpecificCharacterSet)) {
      String[] ss = match.getStrings(Tag.SpecificCharacterSet);
      if (ss != null)
        filtered.setString(Tag.SpecificCharacterSet, VR.CS, ss);
    }
    filtered.addSelected(match, keys);
    return filtered;
  }
}

代码示例来源:origin: org.dcm4che/dcm4che-net

protected Attributes adjust(Attributes match) {
    if (match == null)
      return null;

    Attributes filtered = new Attributes(match.size());
    // include SpecificCharacterSet also if not in keys
    if (!keys.contains(Tag.SpecificCharacterSet)) {
      String[] ss = match.getStrings(Tag.SpecificCharacterSet);
      if (ss != null)
        filtered.setString(Tag.SpecificCharacterSet, VR.CS, ss);
    }
    filtered.addSelected(match, keys);
    return filtered;
  }
}

代码示例来源:origin: dcm4che/dcm4che

public void retrieve(File f) throws IOException, InterruptedException {
  Attributes attrs = new Attributes();
  DicomInputStream dis = null;
  try {
    attrs.addSelected(new DicomInputStream(f).readDataset(-1, -1), inFilter);
  } finally {
    SafeClose.close(dis);
  }
  attrs.addAll(keys);
  retrieve(attrs);
}

代码示例来源:origin: dcm4che/dcm4che

public void retrieve(File f) throws IOException, InterruptedException {
  Attributes attrs = new Attributes();
  DicomInputStream dis = null;
  try {
    attrs.addSelected(new DicomInputStream(f).readDataset(-1, -1), inFilter);
  } finally {
    SafeClose.close(dis);
  }
  attrs.addAll(keys);
  retrieve(attrs);
}

代码示例来源:origin: usnistgov/iheos-toolkit2

@SuppressWarnings("resource")
public void retrieve(File f) throws IOException, InterruptedException {
  Attributes attrs = new Attributes();
  DicomInputStream dis = null;
  try {
    attrs.addSelected(new DicomInputStream(f).readDataset(-1, -1), inFilter);
  } finally {
    SafeClose.close(dis);
  }
  attrs.addAll(keys);
  retrieve(attrs);
}

代码示例来源:origin: org.dcm4che.tool/dcm4che-tool-getscu

public void retrieve(File f) throws IOException, InterruptedException {
  Attributes attrs = new Attributes();
  DicomInputStream dis = null;
  try {
    attrs.addSelected(new DicomInputStream(f).readDataset(-1, -1), inFilter);
  } finally {
    SafeClose.close(dis);
  }
  attrs.addAll(keys);
  retrieve(attrs);
}

代码示例来源:origin: org.dcm4che.tool/dcm4che-tool-mppsscu

private Attributes getPerfSeries(Sequence prefSeriesSeq, Attributes inst) {
    String suid = inst.getString(Tag.SeriesInstanceUID);
    for (Attributes prefSeries : prefSeriesSeq) {
      if (suid.equals(prefSeries.getString(Tag.SeriesInstanceUID)))
        return prefSeries;
    }
    Attributes prefSeries = new Attributes();
    prefSeriesSeq.add(prefSeries);
    for (int tag : PERF_SERIES_TYPE_2_ATTRS)
      prefSeries.setNull(tag, dict.vrOf(tag));
    prefSeries.setString(Tag.ProtocolName, VR.LO, protocolName);
    prefSeries.addSelected(inst, PERF_SERIES_ATTRS);
    prefSeries.newSequence(Tag.ReferencedImageSequence, 10);
    if (archiveRequested != null)
      prefSeries.setString(Tag.ArchiveRequested, VR.CS, archiveRequested);
    return prefSeries;
  }
}

代码示例来源:origin: dcm4che/dcm4che

private Attributes getPerfSeries(Sequence prefSeriesSeq, Attributes inst) {
    String suid = inst.getString(Tag.SeriesInstanceUID);
    for (Attributes prefSeries : prefSeriesSeq) {
      if (suid.equals(prefSeries.getString(Tag.SeriesInstanceUID)))
        return prefSeries;
    }
    Attributes prefSeries = new Attributes();
    prefSeriesSeq.add(prefSeries);
    for (int tag : PERF_SERIES_TYPE_2_ATTRS)
      prefSeries.setNull(tag, dict.vrOf(tag));
    prefSeries.setString(Tag.ProtocolName, VR.LO, protocolName);
    prefSeries.addSelected(inst, PERF_SERIES_ATTRS);
    prefSeries.newSequence(Tag.ReferencedImageSequence, 10);
    if (archiveRequested != null)
      prefSeries.setString(Tag.ArchiveRequested, VR.CS, archiveRequested);
    return prefSeries;
  }
}

代码示例来源:origin: dcm4che/dcm4che

fmi.getString(Tag.TransferSyntaxUID, null));
rec.addSelected(dataset, keys, 0, keys.length);
Sequence contentSeq = dataset.getSequence(Tag.ContentSequence);
if (contentSeq != null)

代码示例来源:origin: dcm4che/dcm4che

@Override
public void readValue(DicomInputStream dis, Attributes attrs) throws IOException {
  int tag = dis.tag();
  if (dis.level() == 0 && tag == Tag.PixelData) {
    imageDescriptor = new ImageDescriptor(attrs);
    initDicomOutputStream();
    processPixelData();
    postPixelData = new Attributes(dis.bigEndian());
  } else {
    dis.readValue(dis, attrs);
    if (postPixelData != null && dis.level() == 0)
      postPixelData.addSelected(attrs, attrs.getPrivateCreator(tag), tag);
  }
}

代码示例来源:origin: org.dcm4che.tool/dcm4che-tool-mppsscu

for (int tag : MPPS_TOP_LEVEL_TYPE_2_ATTRS)
  mpps.setNull(tag, dict.vrOf(tag));
mpps.addSelected(inst, MPPS_TOP_LEVEL_ATTRS);
if (newPPSID || !mpps.containsValue(Tag.PerformedProcedureStepID))
  mpps.setString(Tag.PerformedProcedureStepID, VR.CS, mkPPSID());
  for (int tag : SSA_TYPE_2_ATTRS)
    ssa.setNull(tag, dict.vrOf(tag));
  ssa.addSelected(inst, SSA_ATTRS);
} else {
  Sequence ssaSeq =
    for (int tag : SSA_TYPE_2_ATTRS)
      ssa.setNull(tag, dict.vrOf(tag));
    ssa.addSelected(inst, SSA_ATTRS);
    ssa.addSelected(ra, SSA_ATTRS);

相关文章

微信公众号

最新文章

更多