fix: fix a thumbnail render bug
This commit is contained in:
@@ -37,6 +37,7 @@ void DICOMPixelDataHelper::FinalizeCodecs() {
|
||||
|
||||
void DICOMPixelDataHelper::GetThumbnailData(ExtendMedicalImageProperties *property, void*& data,
|
||||
unsigned long& length, int & sample) {
|
||||
|
||||
double *wlww = property->GetNthWindowLevelPreset(0);
|
||||
int ww = wlww ? ((int) wlww[0]) : (512);
|
||||
int wl = wlww ? ((int) wlww[1]) : (256);
|
||||
@@ -46,9 +47,8 @@ void DICOMPixelDataHelper::GetThumbnailData(ExtendMedicalImageProperties *proper
|
||||
DcmDataset *dset = fileFormat.getDataset();
|
||||
DicomImage dcmImage(&fileFormat, dset->getOriginalXfer(), CIF_MayDetachPixelData);
|
||||
dcmImage.setWindow(wl, ww);
|
||||
length = dcmImage.getOutputDataSize(8);
|
||||
data = new unsigned char[length];
|
||||
dcmImage.getOutputData(data, length, 8);//按8位的位宽取数据
|
||||
length = dcmImage.getWidth() * dcmImage.getHeight();
|
||||
dcmImage.createWindowsDIB(data, length, 0, 8);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user