in src/tiffFrame.cpp [337:352]
void TiffFrame::setDicomFrameBytes(std::unique_ptr<uint8_t[]> dcmdata,
uint64_t size) {
size_ = size;
// Store a copy of the data for downsampling.
rawCompressedBytesSize_ = size;
rawCompressedBytes_ = std::move(dcmdata);
// Pointer will be handed to DCMTK when frame is written. DCMTK will take
// ownership of pointer.
dcmPixelItem_ = std::make_unique<DcmPixelItem>(DcmTag(DCM_Item, EVR_OB));
dcmPixelItem_->putUint8Array(rawCompressedBytes_.get(), size_);
// if frame is jpeg2000 decode don't save encoded tiff.
// frame will be read using openslide
if (!storeRawBytes_ || tiffDirectory()->isJpeg2kCompressed()) {
rawCompressedBytes_ = nullptr;
}
}