public static boolean isPatientRoot(DicomObject rsp) { DicomElement elem = rsp.get(Integer.parseInt("00000002", 16)); String affectedSOP = new String(elem.getBytes()); if (affectedSOP.equals("1.2.840.10008.5.1.4.1.2.2.1")) { return true; } return false; }
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); } } }
DicomElement framed = img.get(Tag.PerFrameFunctionalGroupsSequence); if (framed != null) { int size = framed.countItems();
private static void promptStgCmt(DicomObject cmtrslt, float seconds) { DicomElement refSOPSq = cmtrslt.get(Tag.ReferencedSOPSequence); System.out.print(refSOPSq.countItems()); System.out.println(" successful"); DicomElement failedSOPSq = cmtrslt.get(Tag.FailedSOPSequence); if (failedSOPSq != null) { System.out.print(failedSOPSq.countItems()); System.out.println(" FAILED!"); } }
public DicomElement get(int[] tagPath, VR vr) { DicomElement e = dcmobj.get(tagPath, vr); return e != null ? new UnmodifiableDicomElement(e) : null; }
@Override public DicomElement get(int tag, VR vr) { return filter(tag) ? attrs.get(tag, vr) : null; }
public DicomElement get(int tag) { DicomElement attr = table.get(tag); return (attr != null || defaults == null) ? attr : defaults.get(tag); }
public static boolean isStudyRoot(DicomObject rsp) { DicomElement elem = rsp.get(Integer.parseInt("00000002", 16)); String affectedSOP = new String(elem.getBytes()); if (affectedSOP.equals("1.2.840.10008.5.1.4.1.2.1.1")) { return true; } return false; }
private static void promptStgCmt(DicomObject cmtrslt, float seconds) { DicomElement refSOPSq = cmtrslt.get(Tag.ReferencedSOPSequence); System.out.print(refSOPSq.countItems()); System.out.println(" successful"); DicomElement failedSOPSq = cmtrslt.get(Tag.FailedSOPSequence); if (failedSOPSq != null) { System.out.print(failedSOPSq.countItems()); System.out.println(" FAILED!"); } }
public DicomElement get(int[] tagPath) { DicomElement e = dcmobj.get(tagPath); return e != null ? new UnmodifiableDicomElement(e) : null; }
public DicomElement get(int tag) { return filter(tag) ? attrs.get(tag) : null; }
public DicomElement get(int tag) { DicomElement e = dcmobj.get(tag); return e != null ? new UnmodifiableDicomElement(e) : null; }
public DicomElement get(int tag, VR vr) { DicomElement e = dcmobj.get(tag, vr); return e != null ? new UnmodifiableDicomElement(e) : null; }
public DicomElement get(int[] tagPath) { checkTagPathLength(tagPath); final int last = tagPath.length - 1; final DicomObject item = getItem(tagPath, last, true); return item != null ? item.get(tagPath[last]) : null; }
public DicomElement get(int[] tagPath, VR vr) { checkTagPathLength(tagPath); final int last = tagPath.length - 1; final DicomObject item = getItem(tagPath, last, true); return item != null ? item.get(tagPath[last], vr) : null; }
DicomElement elem = rsp.get(Integer.parseInt("00000002", 16)); String affectedSOP = new String(elem.getBytes());
/** Gets a pixel value from the given field - the field can be a regular integer * or it can be ob data. * @param ds * @param tag * @return */ public static Integer getIntPixelValue(DicomObject ds, int tag, boolean signed, int stored) { DicomElement de = ds.get(tag); if( de==null ) return null; VR vr = de.vr(); if( vr==VR.OB || vr==VR.OW ) { int ret = ByteUtils.bytesLE2ushort(de.getBytes(),0); if( signed ) { if( (ret & (1 << (stored-1))) !=0 ) { int andmask = (1 << stored) - 1; int ormask = ~andmask; ret |= ormask; } } return ret; } return de.getInt(true); }
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; }