String getUNString(int length) throws IOException { String s = getString(length); if (s!=null && s.length()>60) s = s.substring(0,60); return s; }
String getUNString(int length) throws IOException { String s = getString(length); if (s!=null && s.length()>60) s = s.substring(0,60); return s; }
byte[] getLut(int length) throws IOException { if ((length&1)!=0) { // odd String dummy = getString(length); return null; } length /= 2; byte[] lut = new byte[length]; for (int i=0; i<length; i++) lut[i] = (byte)(getShort()>>>8); return lut; }
byte[] getLut(int length) throws IOException { if ((length&1)!=0) { // odd String dummy = getString(length); return null; } length /= 2; byte[] lut = new byte[length]; for (int i=0; i<length; i++) lut[i] = (byte)(getShort()>>>8); return lut; }
if (!getString(4).equals(DICM)) { if (!((bytes[0]==8||bytes[0]==2) && bytes[1]==0 && bytes[3]==0)) throw new IOException("This is not a DICOM or ACR/NEMA file"); switch (tag) { case TRANSFER_SYNTAX_UID: s = getString(elementLength); addInfo(tag, s); if (s.indexOf("1.2.4")>-1||s.indexOf("1.2.5")>-1) { break; case MODALITY: modality = getString(elementLength); addInfo(tag, modality); break; case NUMBER_OF_FRAMES: s = getString(elementLength); addInfo(tag, s); double frames = s2d(s); break; case PHOTOMETRIC_INTERPRETATION: photoInterpretation = getString(elementLength); addInfo(tag, photoInterpretation); break; break; case IMAGER_PIXEL_SPACING: case PIXEL_SPACING: String scale = getString(elementLength);
if (!getString(4).equals(DICM)) { if (!((bytes[0]==8||bytes[0]==2) && bytes[1]==0 && bytes[3]==0)) throw new IOException("This is not a DICOM or ACR/NEMA file"); switch (tag) { case TRANSFER_SYNTAX_UID: s = getString(elementLength); addInfo(tag, s); if (s.indexOf("1.2.4")>-1||s.indexOf("1.2.5")>-1) { break; case MODALITY: modality = getString(elementLength); addInfo(tag, modality); break; case NUMBER_OF_FRAMES: s = getString(elementLength); addInfo(tag, s); double frames = s2d(s); break; case PHOTOMETRIC_INTERPRETATION: photoInterpretation = getString(elementLength); addInfo(tag, photoInterpretation); break; break; case IMAGER_PIXEL_SPACING: case PIXEL_SPACING: String scale = getString(elementLength);