public boolean hasItems() { return e.hasItems(); }
public boolean visit(DicomElement attr) { if (attr.vr() == VR.SQ && attr.hasItems()) { for (int i = 0, n = attr.countItems(); i < n; ++i) { attr.getDicomObject(i).cacheGet(cacheGet); } } return true; } });
public boolean visit(DicomElement attr) { if (attr.vr() == VR.SQ && attr.hasItems()) { for (int i = 0, n = attr.countItems(); i < n; ++i) { attr.getDicomObject(i).cachePut(cachePut); } } return true; } });
@Override public DicomElement next() { DicomElement attr = super.next(); if (attr.vr() == VR.SQ && attr.hasItems()) { return attr.filterItems(filter.getNestedDicomObject(attr.tag())); } return attr; }
private DicomObject getItem(int[] itemPath, int pathLen, boolean readonly) { DicomObject item = this; for (int i = 0; i < pathLen; ++i, ++i) { DicomElement sq = item.get(itemPath[i]); if (sq == null || !sq.hasItems()) { if (readonly) { return null; } sq = item.putSequence(itemPath[i]); } while (sq.countItems() <= itemPath[i + 1]) { if (readonly) { return null; } sq.addDicomObject(new BasicDicomObject()); } item = sq.getDicomObject(itemPath[i + 1]); } return item; }
private void writeElement(DicomObject attrs, DicomElement a) throws SAXException, IOException { VR vr = a.vr(); final int tag = a.tag(); if (file != null) file = new File(file, StringUtils.intToHex(tag)); String fpath = fpath(tag, vr, a.length()); startAttributeElement(tag, vr, a.length(), fpath, attrs); if (a.hasItems()) { for (int i = 0, n = a.countItems(); i < n; ++i) { writeItem(a, i); } } else { if (fpath != null) { writeToFile(a.getBytes()); } else { vr.formatXMLValue(a.getBytes(), a.bigEndian(), attrs.getSpecificCharacterSet(), cbuf, ch); } } endAttributeElement(); if (file != null) file = file.getParentFile(); }
if (a.hasItems()) { if (vr == VR.SQ) { for (int i = 0, n = a.countItems(); i < n; i++) {
public void add(DicomElement a) { if (a.hasItems()) { final int n = a.countItems(); DicomElement t; if (a.vr() == VR.SQ) { t = putSequence(a.tag(), n); for (int i = 0; i < n; i++) { DicomObject srcItem = a.getDicomObject(i); BasicDicomObject item = new BasicDicomObject(srcItem.size()); item.setParent(this); srcItem.copyTo(item); t.addDicomObject(item); } } else { t = putFragments(a.tag(), a.vr(), a.bigEndian(), n); for (int i = 0; i < n; i++) { t.addFragment(a.getFragment(i)); } } a = t; } addInternal(a); }
? dest.resolveTag(tag, getPrivateCreator(tag), true) : tag; if (attr.hasItems()) { final int n = attr.countItems(); DicomElement t;