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

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

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

Attributes.isEmpty介绍

暂无

代码示例

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

private int getEncodedItemLength(DicomEncodingOptions encOpts,
    boolean explicitVR) {
  if (isEmpty())
    return encOpts.undefEmptyItemLength ? -1 : 0;
  if (encOpts.undefItemLength)
    return -1;
  if (length == -1)
    calcLength(encOpts, explicitVR);
  return length;
}

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

@Override
public int calcLength(DicomEncodingOptions encOpts, boolean explicitVR, VR vr) {
  int len = 0;
  for (Attributes item : this) {
    len += 8 + item.calcLength(encOpts, explicitVR);
    if (item.isEmpty() ? encOpts.undefEmptyItemLength
              : encOpts.undefItemLength)
      len += 8;
  }
  if (isEmpty() ? encOpts.undefEmptySequenceLength
         : encOpts.undefSequenceLength)
    len += 8;
  length = len;
  return len;
}

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

public int calcLength(DicomEncodingOptions encOpts, boolean explicitVR) {
  if (isEmpty())
    return 0;
  this.groupLengths = encOpts.groupLength 
      ? new int[countGroups()]
      : null;
  this.length = calcLength(encOpts, explicitVR, 
      getSpecificCharacterSet(), groupLengths);
  return this.length;
}

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

public boolean containsValue(String privateCreator, int tag) {
  int index = indexOf(privateCreator, tag);
  return index >= 0 
      && !isEmpty(vrs[index].isStringType()
          ? decodeStringValue(index)
          : values[index]);
}

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

private boolean matches(String privateCreator, int tag, boolean ignorePNCase, 
    boolean matchNoValue, Sequence keySeq) {
  int n = keySeq.size();
  if (n > 1)
    throw new IllegalArgumentException("Keys contain Sequence "
        + TagUtils.toString(tag) + " with " + n + " Items");
  Attributes keys = keySeq.get(0);
  if (keys.isEmpty())
    return true;
  Object value = getValue(privateCreator, tag);
  if (value == null || isEmpty(value))
    return matchNoValue;
  if (value instanceof Sequence) {
    Sequence sq = (Sequence) value;
    for (Attributes item : sq)
      if (item.matches(keys, ignorePNCase, matchNoValue))
        return true;
  }
  return false;
}

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

public void writeTo(DicomOutputStream out)
    throws IOException {
  if (isEmpty())
    return;
  if (groupLengths == null && out.getEncodingOptions().groupLength)
    throw new IllegalStateException(
        "groupLengths not initialized by calcLength()");
  SpecificCharacterSet cs = getSpecificCharacterSet();
  if (tags[0] < 0) {
    int index0 = -(1 + indexOf(0));
    writeTo(out, cs, index0, size, groupLengthIndex0);
    writeTo(out, cs, 0, index0, 0);
  } else {
    writeTo(out, cs, 0, size, 0);
  }
}

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

private void set(String privateCreator, int tag, Sequence src,
    Attributes selection) {
  Sequence dst = newSequence(privateCreator, tag, src.size());
  for (Attributes item : src)
    dst.add(selection != null && !selection.isEmpty()
      ? new Attributes(item, bigEndian, selection)
      : new Attributes(item, bigEndian));
}

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

/**
 * Invokes {@link Visitor#visit} for each attribute in this instance. The
 * operation will be aborted if <code>visitor.visit()</code> returns <code>false</code>.
 * 
 * @param visitor
 * @param visitNestedDatasets controls if <code>visitor.visit()</code>
 *  is also invoked for attributes in nested datasets
 * @return <code>true</code> if the operation was not aborted.
 */
public boolean accept(Visitor visitor, boolean visitNestedDatasets)
    throws Exception{
  if (isEmpty())
    return true;
  if (tags[0] < 0) {
    int index0 = -(1 + indexOf(0));
    return accept(visitor, visitNestedDatasets, index0, size)
      && accept(visitor, visitNestedDatasets, 0, index0);
  } else {
    return accept(visitor, visitNestedDatasets, 0, size);
  }
}

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

public void writeGroupTo(DicomOutputStream out, int groupLengthTag)
    throws IOException {
  if (isEmpty())
    throw new IllegalStateException("No attributes");
  
  checkInGroup(0, groupLengthTag);
  checkInGroup(size-1, groupLengthTag);
  SpecificCharacterSet cs = getSpecificCharacterSet();
  out.writeGroupLength(groupLengthTag,
      calcLength(out.getEncodingOptions(), out.isExplicitVR(), cs, null));
  writeTo(out, cs, 0, size, 0);
}

代码示例来源:origin: nroduit/Weasis

if (dicomLutObject == null || dicomLutObject.isEmpty()) {
  return null;

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

public static boolean updateAttributes(Attributes data, Attributes attrs,
    String uidSuffix) {
  if (attrs.isEmpty() && uidSuffix == null)
    return false;
  if (uidSuffix != null ) {
    data.setString(Tag.StudyInstanceUID, VR.UI,
        data.getString(Tag.StudyInstanceUID) + uidSuffix);
    data.setString(Tag.SeriesInstanceUID, VR.UI,
        data.getString(Tag.SeriesInstanceUID) + uidSuffix);
    data.setString(Tag.SOPInstanceUID, VR.UI, 
        data.getString(Tag.SOPInstanceUID) + uidSuffix);
  }
  data.update(Attributes.UpdatePolicy.OVERWRITE, attrs, null);
  return true;
}

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

public static boolean updateAttributes(Attributes data, Attributes attrs,
    String uidSuffix) {
  if (attrs.isEmpty() && uidSuffix == null)
    return false;
  if (uidSuffix != null ) {
    data.setString(Tag.StudyInstanceUID, VR.UI,
        data.getString(Tag.StudyInstanceUID) + uidSuffix);
    data.setString(Tag.SeriesInstanceUID, VR.UI,
        data.getString(Tag.SeriesInstanceUID) + uidSuffix);
    data.setString(Tag.SOPInstanceUID, VR.UI, 
        data.getString(Tag.SOPInstanceUID) + uidSuffix);
  }
  data.update(Attributes.UpdatePolicy.OVERWRITE, attrs, null);
  return true;
}

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

rspHandlerFactory.createDimseRSPHandler(f));
} else {
  if (uidSuffix == null && attrs.isEmpty() && ts.equals(filets)) {
    FileInputStream in = new FileInputStream(f);
    try {

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

rspHandlerFactory.createDimseRSPHandler(f));
} else {
  if (uidSuffix == null && attrs.isEmpty() && ts.equals(filets)) {
    FileInputStream in = new FileInputStream(f);
    try {

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

if (isEmpty(keyValue))
  continue;

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

if (updatePolicy != UpdatePolicy.OVERWRITE && isEmpty(value))
  continue;
int j = indexOf(tag);
    continue;
  Object origValue = vrs[j].isStringType() ? decodeStringValue(j) : values[j];
  if (updatePolicy == UpdatePolicy.SUPPLEMENT && !isEmpty(origValue))
    continue;
  if (modified != null && !isEmpty(origValue) && !modified.contains(privateCreator, tag)) {
    if (origValue instanceof Sequence) {
      modified.set(privateCreator, tag, (Sequence) origValue, null);

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

if (isEmpty(value)) {
  if (el.type == IOD.DataElementType.TYPE_1) {
    result.addMissingAttributeValue(el);

相关文章

微信公众号

最新文章

更多