private Attributes selectFctGroup(Attributes imgAttrs, Attributes sharedFctGroups, Attributes frameFctGroups, int tag) { if (frameFctGroups == null) { return imgAttrs; } Attributes group = frameFctGroups.getNestedDataset(tag); if (group == null && sharedFctGroups != null) { group = sharedFctGroups.getNestedDataset(tag); } return group != null ? group : imgAttrs; }
public Attributes getNestedDataset(int sequenceTag) { return getNestedDataset(null, sequenceTag, 0); }
public Attributes getNestedDataset(String privateCreator, int sequenceTag) { return getNestedDataset(privateCreator, sequenceTag, 0); }
public Attributes getNestedDataset(ItemPointer... itemPointers) { return getNestedDataset(Arrays.asList(itemPointers)); }
private static String identifierTypeCodeOf(Attributes attrs) { Attributes qualifiers = attrs.getNestedDataset(Tag.IssuerOfPatientIDQualifiersSequence); return qualifiers != null ? qualifiers.getString(Tag.IdentifierTypeCode) : null; }
protected Attributes item(Attributes attrs) { for (int sqtag : itemPath) { if (sqtag == -1) attrs = (sqtag == -1) ? attrs.getParent() : attrs.getNestedDataset(sqtag); } return attrs; } }
private void writeSharedFunctionalGroupsSequence(Attributes header) { if (header != null) { DicomMediaUtils.writeFunctionalGroupsSequence(this, header.getNestedDataset(Tag.SharedFunctionalGroupsSequence)); } }
public String selectStringValue(Attributes attrs, int valueIndex, String defVal) { Attributes item = attrs.getNestedDataset(itemPointers); return item != null ? item.getString(privateCreator, tag, valueIndex, defVal) : defVal; }
public Code getNestedCode(int tag) { Attributes item = dcmItems.getNestedDataset(tag); return item != null ? new Code(item) : null; }
public Code getReasonForRequestedProcedureCode() { Attributes item = dcmItems.getNestedDataset(Tag.ReasonForRequestedProcedureCodeSequence); return item != null ? new Code(item) : null; }
protected String getLabelWithoutPrefix() { Attributes dicom = ((DicomMediaIO) mediaIO).getDicomObject(); Attributes item = dicom.getNestedDataset(Tag.ContentSequence); if (item != null) { return item.getString(Tag.TextValue); } return null; }
public void setModalityLUT(Attributes attrs) { rescaleIntercept = attrs.getFloat(Tag.RescaleIntercept, 0); rescaleSlope = attrs.getFloat(Tag.RescaleSlope, 1); modalityLUT = createLUT(storedValue, attrs.getNestedDataset(Tag.ModalityLUTSequence)); }
public static IDWithIssuer valueOf(Attributes attrs, int idTag, int issuerSeqTag) { String id = attrs.getString(idTag); if (id == null) return null; return new IDWithIssuer(id, Issuer.valueOf(attrs.getNestedDataset(issuerSeqTag))); }
private void addFunctionGroups(Attributes dest, Attributes fgs) { dest.addSelected(fgs, Tag.ReferencedImageSequence); Attributes fg; for (int sqTag : fgs.tags()) if (sqTag != Tag.ReferencedImageSequence && (fg = fgs.getNestedDataset(sqTag)) != null) dest.addAll(fg); }
public void setModalityLUT(Attributes attrs) { rescaleIntercept = attrs.getFloat(Tag.RescaleIntercept, 0); rescaleSlope = attrs.getFloat(Tag.RescaleSlope, 1); modalityLUT = createLUT(storedValue, attrs.getNestedDataset(Tag.ModalityLUTSequence)); }
public String getDocumentTitle() { Attributes dcmItems = getMediaReader().getDicomObject(); if (dcmItems != null) { Attributes item = dcmItems.getNestedDataset(Tag.ConceptNameCodeSequence); if (item != null) { return item.getString(Tag.CodeMeaning, null); } } return null; }
private void addFunctionGroups(Attributes dest, Attributes fgs) { dest.addSelected(fgs, Tag.ReferencedImageSequence); Attributes fg; for (int sqTag : fgs.tags()) if (sqTag != Tag.ReferencedImageSequence && (fg = fgs.getNestedDataset(sqTag)) != null) dest.addAll(fg); }
private static SRImageReference getReferencedImage(Map<String, SRImageReference> map, String level, Attributes attributes) { Attributes item = attributes.getNestedDataset(Tag.ReferencedSOPSequence); if (item == null) { return null; } SRImageReference imgRef = map.computeIfAbsent(level, k -> new SRImageReference(level)); if (imgRef.getSopInstanceReference() == null) { imgRef.setSopInstanceReference(new SOPInstanceReference(item)); } return imgRef; }
public static void readPRLUTsModule(Attributes dcmItems, Tagable tagable) { if (dcmItems != null && tagable != null) { // Modality LUT Module applyModalityLutModule(dcmItems, tagable, null); // VOI LUT Module applyVoiLutModule(dcmItems.getNestedDataset(Tag.SoftcopyVOILUTSequence), dcmItems, tagable, Tag.SoftcopyVOILUTSequence); // Presentation LUT Module applyPrLutModule(dcmItems, tagable); } }
public static Issuer fromIssuerOfPatientID(Attributes attrs) { String issuerOfPatientID = attrs.getString(Tag.IssuerOfPatientID); Attributes qualifiers = attrs.getNestedDataset(Tag.IssuerOfPatientIDQualifiersSequence); if (qualifiers != null) { String universalEntityID = qualifiers.getString(Tag.UniversalEntityID); String universalEntityIDType = qualifiers.getString(Tag.UniversalEntityIDType); if (universalEntityID != null && universalEntityIDType != null) return new Issuer(issuerOfPatientID, universalEntityID, universalEntityIDType); } return (issuerOfPatientID != null) ? new Issuer(issuerOfPatientID, null, null) : null; }