int getNextTag() throws IOException { int groupWord = getShort(); if (groupWord==0x0800 && bigEndianTransferSyntax) { littleEndian = false; groupWord = 0x0008; } int elementWord = getShort(); int tag = groupWord<<16 | elementWord; elementLength = getLength(); // hack needed to read some GE files // The element length must be even! if (elementLength==13 && !oddLocations) elementLength = 10; // "Undefined" element length. // This is a sort of bracket that encloses a sequence of elements. if (elementLength==-1) { elementLength = 0; inSequence = true; } //IJ.log("getNextTag: "+tag+" "+elementLength); return tag; }
int getNextTag() throws IOException { int groupWord = getShort(); if (groupWord==0x0800 && bigEndianTransferSyntax) { littleEndian = false; groupWord = 0x0008; } int elementWord = getShort(); int tag = groupWord<<16 | elementWord; elementLength = getLength(); // hack needed to read some GE files // The element length must be even! if (elementLength==13 && !oddLocations) elementLength = 10; // "Undefined" element length. // This is a sort of bracket that encloses a sequence of elements. if (elementLength==-1) { elementLength = 0; inSequence = true; } //IJ.log("getNextTag: "+tag+" "+elementLength); return tag; }
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; }
break; case SAMPLES_PER_PIXEL: samplesPerPixel = getShort(); addInfo(tag, samplesPerPixel); break; break; case PLANAR_CONFIGURATION: planarConfiguration = getShort(); addInfo(tag, planarConfiguration); break; case ROWS: fi.height = getShort(); addInfo(tag, fi.height); break; case COLUMNS: fi.width = getShort(); addInfo(tag, fi.width); break; break; case BITS_ALLOCATED: bitsAllocated = getShort(); if (bitsAllocated==8) fi.fileType = FileInfo.GRAY8; break; case PIXEL_REPRESENTATION: int pixelRepresentation = getShort();
break; case SAMPLES_PER_PIXEL: samplesPerPixel = getShort(); addInfo(tag, samplesPerPixel); break; break; case PLANAR_CONFIGURATION: planarConfiguration = getShort(); addInfo(tag, planarConfiguration); break; case ROWS: fi.height = getShort(); addInfo(tag, fi.height); break; case COLUMNS: fi.width = getShort(); addInfo(tag, fi.width); break; break; case BITS_ALLOCATED: bitsAllocated = getShort(); if (bitsAllocated==8) fi.fileType = FileInfo.GRAY8; break; case PIXEL_REPRESENTATION: int pixelRepresentation = getShort();