public DicomElement putNestedDicomObject(int tag, DicomObject item) { DicomElement a = putSequence(tag, 1); a.addDicomObject(item); return a; }
private void onStartItem(String offStr, String src) { this.src = src; if (state != State.EXPECT_VAL_OR_FIRST_ITEM && state != State.EXPECT_NEXT_ITEM) { throw new IllegalStateException("state:" + state); } if (state == State.EXPECT_VAL_OR_FIRST_ITEM) { sqStack.push(vr == VR.SQ ? attrs.putSequence(tag) : attrs .putFragments(tag, vr, false)); } DicomElement sq = sqStack.peek(); if (sq.vr() == VR.SQ) { DicomObject parent = attrs; attrs = new BasicDicomObject(); ((BasicDicomObject) attrs).setParent(parent); if (offStr != null) { attrs.setItemOffset(Long.parseLong(offStr)); } sq.addDicomObject(attrs); state = State.EXPECT_ELM; } else { sb.setLength(0); state = State.EXPECT_FRAG; } }
private void copyConceptNameModifiers(DicomObject dcmobj, DicomObject rec) { DicomElement objsq = dcmobj.get(Tag.ContentSequence); if (objsq == null) { return; } DicomElement recsq = null; DicomObject item; for (int i = 0, n = objsq.countItems(); i < n; i++) { item = objsq.getDicomObject(i); if ("HAS CONCEPT MOD".equals(item.getString(Tag.RelationshipType))) { if (recsq == null) { // lazy sequence creation recsq = rec.putSequence(Tag.ContentSequence); } recsq.addDicomObject(item); } } }
refSOP.putString(Tag.ReferencedSOPInstanceUID, VR.UI, info.iuid); refSOPSq.addDicomObject(refSOP);
refSOP.putString(Tag.ReferencedSOPInstanceUID, VR.UI, info.iuid); refSOPSq.addDicomObject(refSOP);
DicomObject item = new BasicDicomObject(); dis1.readDicomObject(item, b.length); tmp.addDicomObject(item); item.setItemOffset(tagpos); readDicomObject(item, vallen); sq.addDicomObject(item); } else { sq.addFragment(readBytes(vallen));
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; }
public enum QUERYLEVEL { PATIENT, STUDY, SERIE, IMAGE}
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); }
item.setParent(dest); srcItem.copyTo(item, resolveDestinationPrivateTags); t.addDicomObject(item);