private long endPos() throws IOException { if (recordSeqLen == -1) { long endPos = raf.length() - 12; raf.seek(endPos); if (in.readHeader() == Tag.SequenceDelimitationItem) { recordSeqLen = (int) (endPos - firstRecordPos); } else { endPos = filesetInfo.getOffsetLastRootRecord(); raf.seek(endPos); in.setStreamPosition(endPos); DicomObject dcmobj = new BasicDicomObject(); while (in.readHeader() == Tag.Item) { in.readDicomObject(dcmobj, in.valueLength()); dcmobj.clear(); endPos = in.getStreamPosition(); } if (in.tag() != Tag.SequenceDelimitationItem) { throw new IOException("Unexpected Tag " + TagUtils.toString(in.tag()) + " at offset " + endPos); } recordSeqLen = (int) (endPos - firstRecordPos); } } return firstRecordPos + recordSeqLen; }
public DicomDirWriter(File file) throws IOException { super(new RandomAccessFile(checkExists(file), "rw")); this.file = file; offsetFirstRootRecord(filesetInfo.getOffsetFirstRootRecord()); offsetLastRootRecord(filesetInfo.getOffsetLastRootRecord()); this.firstRecordPos = in.getStreamPosition(); this.recordSeqLen = in.valueLength(); out = new DicomOutputStream(raf); out.setExplicitSequenceLength(recordSeqLen != -1); out.setExplicitItemLength(recordSeqLen != -1); if (filesetInfo.isEmpty()) { this.recordSeqLen = 0; } }
public boolean readValue(DicomInputStream in) throws IOException { boolean skip = isSkip(in); if(!skip){ if (subHandler != null){ return subHandler.readValue(in); }else{ return in.readValue(in); } } in.getDicomObject().add(new SkippedDicomElement(in.tag(), in.vr(), false, in.valueLength(), in.getStreamPosition())); in.skip(in.valueLength()); return true; }
in.getStreamPosition() + vr.toInt(val, bigEndian));
"Big Endian color-by-plane with Pixel Data VR=OW not implemented"); pixelDataPos = dis.getStreamPosition(); pixelDataLen = dis.valueLength(); compressed = pixelDataLen == -1;
public void readPostPixeldata() throws IOException{ readMetaData(); long currentPosition = dis.getStreamPosition();