I try to get b/w CT image from dicom by function int DicomImage::getOutputData (void *buffer, ...)
The values of HU units in all pixels in image are by value 32768 = 2^15 bigger than correct values.
In other words the result of getOutputData shifted by the same value 32768 = 2^15.
The dicom could be downloaded from: https://drive.google.com/file/d/1kgCqQd ... sp=sharing
Please find below code used with getOutputData in described case.
Code: Select all
E_TransferSyntax xfer = dcmDataset->getOriginalXfer();
dcmDataset->chooseRepresentation(EXS_LittleEndianExplicit, nullptr);
unique_ptr<DicomImage> image = make_unique<DicomImage>(dcmDataset, xfer, CIF_UsePartialAccessToPixelData, 1, 1);
if (image->getStatus() != EIS_Normal) throw runtime_error("Bad image!");
unique_ptr<Uint16[]> pixelData = make_unique<Uint16[]>(image->getOutputDataSize());
image->getOutputData(pixelData.get(), image->getOutputDataSize(), 0,0,0);
No other flags like CIF_xxx could improve the result.
With kindest regards, Sergey.