private static void readCorner(ModalityInfoData data, CornerDisplay corner, XMLStreamReader xmler) throws XMLStreamException { TagView[] disElements = data.getCornerInfo(corner).getInfos(); boolean state = true; int index = -1; String format = null; while (xmler.hasNext() && state) { switch (xmler.next()) { case XMLStreamConstants.CHARACTERS: if (index > 0 && index <= 7) { disElements[index - 1] = getTag(xmler.getText(), format); index = -1; // Reset current index and format format = null; } break; case XMLStreamConstants.START_ELEMENT: if ("p".equals(xmler.getName().getLocalPart()) && xmler.getAttributeCount() >= 1) { // $NON-NLS-1$ index = TagUtil.getIntegerTagAttribute(xmler, "index", -1); // $NON-NLS-1$ format = xmler.getAttributeValue(null, "format"); // $NON-NLS-1$ } break; case XMLStreamConstants.END_ELEMENT: if ("corner".equals(xmler.getName().getLocalPart())) { // $NON-NLS-1$ state = false; } break; default: break; } } }
static { // Format associated to DICOM field: // $V => the value // $V:l$25$ => the value is limited to 25 characters followed by "..." // $V:f$#,##0.##$ => java pattern to display decimal number /* * See IHE BIR RAD TF-‐2: 4.16.4.2.2.5.8 */ // Default profile of tag formats TagView[] disElements = DEFAULT_MODALITY_VIEW.getCornerInfo(CornerDisplay.TOP_LEFT).getInfos(); disElements[0] = new TagView(TagD.get(Tag.PatientName)); disElements[1] = new TagView(TagD.get(Tag.PatientBirthDate)); disElements[2] = new TagView(Messages.getString("ModalityView.id"), TagD.get(Tag.PatientID)); // $NON-NLS-1$ disElements[3] = new TagView( Messages.getString("ModalityView.sex"), TagD.get(Tag.PatientSex)); // $NON-NLS-1$ disElements[4] = new TagView(TagD.get(Tag.PatientAge)); disElements = DEFAULT_MODALITY_VIEW.getCornerInfo(CornerDisplay.TOP_RIGHT).getInfos(); disElements[0] = new TagView(TagD.get(Tag.InstitutionName)); disElements[1] = new TagView( Messages.getString("ModalityView.desc25"), TagD.get(Tag.StudyDescription)); // $NON-NLS-1$ disElements[2] = new TagView(Messages.getString("ModalityView.study"), TagD.get(Tag.StudyID)); // $NON-NLS-1$ disElements[3] = new TagView( Messages.getString("ModalityView.ac_nb"), TagD.get(Tag.AccessionNumber)); // $NON-NLS-1$ // else content date, else Series date, else Study date disElements[4] = new TagView( Messages.getString("ModalityView.acq"), // $NON-NLS-1$ TagD.getTagFromIDs( Tag.AcquisitionDate, Tag.ContentDate, Tag.DateOfSecondaryCapture, Tag.SeriesDate, Tag.StudyDate)); // else content time, else Series time, else Study time disElements[5] = new TagView( Messages.getString("ModalityView.acq"), // $NON-NLS-1$ TagD.getTagFromIDs( Tag.AcquisitionTime, Tag.ContentTime, Tag.TimeOfSecondaryCapture, Tag.SeriesTime, Tag.StudyTime)); disElements = DEFAULT_MODALITY_VIEW.getCornerInfo(CornerDisplay.BOTTOM_RIGHT).getInfos(); disElements[1] = new TagView( Messages.getString("ModalityView.series_nb"), TagD.get(Tag.SeriesNumber)); // $NON-NLS-1$ disElements[2] = new TagView( Messages.getString("ModalityView.laterality"), TagD.getTagFromIDs( Tag.FrameLaterality, // $NON-NLS-1$ Tag.ImageLaterality, Tag.Laterality)); // TODO add sequence // derived from Contrast/Bolus Agent Sequence (0018,0012), if // present, else Contrast/Bolus Agent (0018,0010) // http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.4b.html disElements[3] = new TagView( Messages.getString("ModalityView.desc25"), TagD.get(Tag.ContrastBolusAgent)); // $NON-NLS-1$ disElements[4] = new TagView( Messages.getString("ModalityView.desc25"), TagD.get(Tag.SeriesDescription)); // $NON-NLS-1$ disElements[5] = new TagView( Messages.getString("ModalityView.thick"), TagD.get(Tag.SliceThickness)); // $NON-NLS-1$ disElements[6] = new TagView( Messages.getString("ModalityView.location"), TagD.get(Tag.SliceLocation)); // $NON-NLS-1$ /* * Spacing Between Slices (0018,0088), if present, else a value derived from successive values of Image Position * (Patient) (0020,0032) perpendicular to the Image Orientation (Patient) (0020,0037) */ MODALITY_VIEW_MAP.put(Modality.DEFAULT, DEFAULT_MODALITY_VIEW); readTagDisplayByModality(); }