@Override public synchronized List<Codec> getCodecPlugins() { ArrayList<Codec> codecPlugins = new ArrayList<>(1); synchronized (BundleTools.CODEC_PLUGINS) { for (Codec codec : BundleTools.CODEC_PLUGINS) { if (codec != null && "Sun java imageio".equals(codec.getCodecName()) == false //$NON-NLS-1$ && codec.isMimeTypeSupported("application/dicom") && !codecPlugins.contains(codec)) { //$NON-NLS-1$ codecPlugins.add(codec); } } } return codecPlugins; }
public static Codec getCodec(String mimeType, String preferredCodec) { Codec codec = null; synchronized (BundleTools.CODEC_PLUGINS) { for (Codec c : BundleTools.CODEC_PLUGINS) { if (c.isMimeTypeSupported(mimeType)) { if (c.getCodecName().equals(preferredCodec)) { codec = c; break; } // If the preferred codec cannot be find, the first-found codec is retained if (codec == null) { codec = c; } } } return codec; } }
if (isDicomMedia(mediaElement) && codec != null && codec.isMimeTypeSupported("application/dicom")) { //$NON-NLS-1$ if (reader.getMediaElement() == null) {
private MediaSeries buildSeriesFromMediaElement(E mediaElement) { if (mediaElement != null) { MediaReader reader = mediaElement.getMediaReader(); TagW tname; String tvalue; Codec codec = reader.getCodec(); String sUID; String gUID; if (isDicomMedia(mediaElement) && codec != null && codec.isMimeTypeSupported("application/dicom")) { //$NON-NLS-1$ if (reader.getMediaElement() == null) { // DICOM is not readable return null; } sUID = (String) reader.getTagValue(TagW.get("SeriesInstanceUID")); //$NON-NLS-1$ gUID = (String) reader.getTagValue(TagW.get("PatientID")); //$NON-NLS-1$ tname = TagW.get("PatientName"); //$NON-NLS-1$ tvalue = (String) reader.getTagValue(tname); } else { sUID = mediaElement.getMediaURI().toString(); gUID = sUID; tname = TagW.FileName; tvalue = mediaElement.getName(); } return ViewerPluginBuilder.buildMediaSeriesWithDefaultModel(reader, gUID, tname, tvalue, sUID); } return null; }