public int getDicomValueMultiplicity(Object value) { if (value == null) { return 0; } try { return vr.vmOf(value); } catch (Exception e) { LOGGER.error("Cannot evaluate mulitplicity from DICOM VR", e); //$NON-NLS-1$ } return getValueMultiplicity(value); }
private void writeDoubleValues(VR vr, Object val, boolean bigEndian) { gen.writeStartArray("Value"); int vm = vr.vmOf(val); for (int i = 0; i < vm; i++) { double d = vr.toDouble(val, bigEndian, i, 0); if (Double.isNaN(d)) { LOG.info("encode {} NaN as null", vr); gen.writeNull(); } else { if (d == Double.POSITIVE_INFINITY) { d = Double.MAX_VALUE; LOG.info("encode {} Infinity as {}", vr, d); } else if (d == Double.NEGATIVE_INFINITY) { d = -Double.MAX_VALUE; LOG.info("encode {} -Infinity as {}", vr, d); } gen.write(d); } } gen.writeEnd(); }
private void writeUIntValues(VR vr, Object val, boolean bigEndian) { gen.writeStartArray("Value"); int vm = vr.vmOf(val); for (int i = 0; i < vm; i++) { gen.write(vr.toInt(val, bigEndian, i, 0) & 0xffffffffL); } gen.writeEnd(); }
private void writeIntValues(VR vr, Object val, boolean bigEndian) { gen.writeStartArray("Value"); int vm = vr.vmOf(val); for (int i = 0; i < vm; i++) { gen.write(vr.toInt(val, bigEndian, i, 0)); } gen.writeEnd(); }
private void writeValues(VR vr, Object val, boolean bigEndian, SpecificCharacterSet cs) throws SAXException { if (vr.isStringType()) val = vr.toStrings(val, bigEndian, cs); int vm = vr.vmOf(val); for (int i = 0; i < vm; i++) { String s = vr.toString(val, bigEndian, i, null); addAttribute("number", Integer.toString(i + 1)); if (vr == VR.PN) { PersonName pn = new PersonName(s, true); startElement("PersonName"); writePNGroup("Alphabetic", pn, PersonName.Group.Alphabetic); writePNGroup("Ideographic", pn, PersonName.Group.Ideographic); writePNGroup("Phonetic", pn, PersonName.Group.Phonetic); endElement("PersonName"); } else { writeElement("Value", s); } } }
int vm = vr.vmOf(value); if (el.maxVM > 0 && vm > el.maxVM || el.minVM > 1 && vm < el.minVM) {