public boolean isEmpty() { return e.isEmpty(); }
public DicomElement bigEndian(boolean bigEndian) { if (e.bigEndian() == bigEndian || e.isEmpty()) return this; throw new UnsupportedOperationException(); }
public boolean containsValue(int tag) { DicomElement attr = get(tag); return attr != null && !attr.isEmpty(); }
private Date[] toDates(DicomElement a, Date[] defVal) { return a == null || a.isEmpty() ? defVal : a.getDates(cacheGet()); }
private int[] toInts(DicomElement a, int[] defVal) { return a == null || a.isEmpty() ? defVal : a.getInts(cacheGet()); }
private float[] toFloats(DicomElement a, float[] defVal) { return a == null || a.isEmpty() ? defVal : a.getFloats(cacheGet()); }
public DicomObject getNestedDicomObject(int tag) { DicomElement a = get(tag, VR.SQ); return a == null || a.isEmpty() ? null : a.getDicomObject(); }
private double toDouble(DicomElement a, double defVal) { return a == null || a.isEmpty() ? defVal : a.getDouble(cacheGet()); }
private int toInt(DicomElement a, int defVal) { return a == null || a.isEmpty() ? defVal : a.getInt(cacheGet()); }
private DateRange toDateRange(DicomElement a, DateRange defVal) { return a == null || a.isEmpty() ? defVal : a.getDateRange(cacheGet()); }
private short[] toShorts(DicomElement a, short[] defVal) { return a == null || a.isEmpty() ? defVal : a.getShorts(cacheGet()); }
private float toFloat(DicomElement a, float defVal) { return a == null || a.isEmpty() ? defVal : a.getFloat(cacheGet()); }
private double[] toDoubles(DicomElement a, double[] defVal) { return a == null || a.isEmpty() ? defVal : a.getDoubles(cacheGet()); }
private Date toDate(DicomElement a, Date defVal) { return a == null || a.isEmpty() ? defVal : a.getDate(cacheGet()); }
private String toString(DicomElement a, String defVal) { return a == null || a.isEmpty() ? defVal : a.getString( getSpecificCharacterSet(), cacheGet()); }
private String[] toStrings(DicomElement a, String[] defVal) { return a == null || a.isEmpty() ? defVal : a.getStrings( getSpecificCharacterSet(), cacheGet()); }
public DicomElement get(int tag, VR vr) { DicomElement e = get(tag); if (e == null || e.vr() == vr) { return e; } if (e.vr() != VR.UN) { throw new UnsupportedOperationException("Update VR from " + e.vr() + " to " + vr + " not supported"); } if (vr != VR.SQ) { return putBytes(tag, vr, e.getBytes()); } DicomElement sq = putSequence(tag); if (!e.isEmpty()) { try { byte[] b = e.getBytes(); DicomInputStream in = new DicomInputStream( new ByteArrayInputStream(b), UID.ImplicitVRLittleEndian); in.readItems(sq, b.length); } catch (IOException e1) { throw new RuntimeException("Failed to parse value of " + e + " as sequence of items", e1); } } return sq; } }
dcmElmt = (DicomElement) itKeys.next(); if (dcmElmt.isEmpty()) { continue;
public boolean visit(DicomElement key) { DicomElement el = get(key.tag()); if (el == null) return false; if (key.hasDicomObjects()) { DicomObject itemKeys = key.getDicomObject(); if (itemKeys != null && !itemKeys.isEmpty()) { if (!el.hasDicomObjects() || el.isEmpty()) return false; for (int i = 0, n = el.countItems(); i < n; i++) { if (!el.getDicomObject(i).containsAll(itemKeys)) return false; } } } return true; } });