APISonar


org.dcm4che3.data.VR.UI

> org > dcm4che3 > data > VR > UI
org APIs dcm4che3 APIs data APIs VR APIs UI APIs

Example 1
public Attributes findStudyRecord(Attributes patRec, String... iuids)
            throws IOException {
        return findLowerDirectoryRecord(patRec, false,
                pk("STUDY", Tag.StudyInstanceUID, VR.UI, iuids),
                false, false);
    }
Example 2
private Attributes refSOP(String cuid, String iuid) {
        Attributes item = new Attributes(2);
        item.setString(Tag.ReferencedSOPClassUID, VR.UI, cuid);
        item.setString(Tag.ReferencedSOPInstanceUID, VR.UI, iuid);
        return item;
    }
Example 3
public Attributes makeActionInfo(List<String> refSOPs) {
        Attributes actionInfo = new Attributes(2);
        actionInfo.setString(Tag.TransactionUID, VR.UI, UIDUtils.createUID());
        int n = refSOPs.size() / 2;
        Sequence refSOPSeq = actionInfo.newSequence(Tag.ReferencedSOPSequence, n);
        for (int i = 0, j = 0; j < n; j++) {
            Attributes refSOP = new Attributes(2);
            refSOP.setString(Tag.ReferencedSOPClassUID, VR.UI, refSOPs.get(i++));
            refSOP.setString(Tag.ReferencedSOPInstanceUID, VR.UI, refSOPs.get(i++));
            refSOPSeq.add(refSOP);
        }
        return actionInfo;
    }
Example 4
private Attributes pk(String... iuids) {
        if (iuids == null || iuids.length == 0)
            return null;

        Attributes pk = new Attributes(1);
        pk.setString(Tag.ReferencedSOPInstanceUIDInFile, VR.UI, iuids);
        return pk;
    }
Example 5
public static Attributes mkCEchoRQ(int msgId, String cuid) {
       Attributes rq = mkRQ(msgId, 0x0030, NO_DATASET);
       rq.setString(Tag.AffectedSOPClassUID, VR.UI, cuid);
       return rq;
    }
Example 6
public DicomServiceException setUID(int tag, String value) {
        rsp.setString(tag, VR.UI, value);
        return this;
    }
Example 7
private static Attributes refSOP(String iuid, String cuid, int failureReason) {
        Attributes attrs = new Attributes(3);
        attrs.setString(Tag.ReferencedSOPClassUID, VR.UI, cuid);
        attrs.setString(Tag.ReferencedSOPInstanceUID, VR.UI, iuid);
        if (failureReason != Status.Success)
            attrs.setInt(Tag.FailureReason, VR.US, failureReason);
        return attrs ;
    }
Example 8
public static boolean updateAttributes(Attributes data, Attributes attrs,
            String uidSuffix) {
        if (attrs.isEmpty() && uidSuffix == null)
            return false;
        if (uidSuffix != null ) {
            data.setString(Tag.StudyInstanceUID, VR.UI,
                    data.getString(Tag.StudyInstanceUID) + uidSuffix);
            data.setString(Tag.SeriesInstanceUID, VR.UI,
                    data.getString(Tag.SeriesInstanceUID) + uidSuffix);
            data.setString(Tag.SOPInstanceUID, VR.UI, 
                    data.getString(Tag.SOPInstanceUID) + uidSuffix);
        }
        data.update(Attributes.UpdatePolicy.OVERWRITE, attrs, null);
        return true;
    }
Example 9
private Sequence refSeriesSeq(String studyIUID) {
        for (Attributes refStudy : evidenceSeq)
            if (studyIUID.equals(refStudy.getString(Tag.StudyInstanceUID)))
                return refStudy.getSequence(Tag.ReferencedSeriesSequence);

        Attributes refStudy = new Attributes(2);
        Sequence refSeriesSeq = refStudy.newSequence(Tag.ReferencedSeriesSequence, 10);
        refStudy.setString(Tag.StudyInstanceUID, VR.UI, studyIUID);
        evidenceSeq.add(refStudy);
        return refSeriesSeq;
    }
Example 10
public static Attributes mkNCreateRSP(Attributes cmd, int status) {
        String iuid = cmd.getString(Tag.AffectedSOPInstanceUID);
        if (iuid == null)
            cmd.setString(Tag.AffectedSOPInstanceUID, VR.UI, UIDUtils.createUID());
        return mkRSP(cmd, status, Dimse.N_CREATE_RQ);
    }
Example 11
private static void supplementMissingUID(Attributes metadata, int tag) {
        if (!metadata.containsValue(tag))
            metadata.setString(tag, VR.UI, UIDUtils.createUID());
    }
Example 12
public void testFormatMD5() {
        Attributes attrs = new Attributes();
        attrs.setString(Tag.StudyDate, VR.DA, "20111012");
        attrs.setString(Tag.StudyTime, VR.TM, "0930");
        attrs.setString(Tag.StudyInstanceUID, VR.UI, "1.2.3");
        attrs.setString(Tag.SeriesInstanceUID, VR.UI, "1.2.3.4");
        attrs.setString(Tag.SOPInstanceUID, VR.UI, "1.2.3.4.5");
        assertEquals("2011/10/12/09/02C82A3A/71668980/08vpsu2l2shpb0kc3orpgfnhv0.dcm",
                new AttributesFormat(TEST_PATTERN_MD5).format(attrs));
    }
Example 13
public static Attributes mkRSP(Attributes rq, int status, Dimse rqCmd) {
        Attributes rsp = new Attributes();
        rsp.setInt(Tag.CommandField, VR.US, rqCmd.commandFieldOfRSP());
        rsp.setInt(Tag.Status, VR.US, status);
        rsp.setInt(Tag.MessageIDBeingRespondedTo, VR.US,
                rq.getInt(Tag.MessageID, 0));
        rsp.setString(Tag.AffectedSOPClassUID, VR.UI,
                rq.getString(rqCmd.tagOfSOPClassUID()));
        int tagOfIUID = rqCmd.tagOfSOPInstanceUID();
        if (tagOfIUID != 0)
            rsp.setString(Tag.AffectedSOPInstanceUID, VR.UI,
                    rq.getString(tagOfIUID));
        return rsp;
    }
Example 14
private Attributes cechorq() {
        Attributes cechorq = new Attributes();
        cechorq.setString(Tag.AffectedSOPClassUID, VR.UI,
                UID.VerificationSOPClass);
        cechorq.setInt(Tag.CommandField, VR.US, 0x0030);
        cechorq.setInt(Tag.MessageID, VR.US, 1);
        cechorq.setInt(Tag.CommandDataSetType, VR.US, 0x0101);
        return cechorq;
    }