Could anyone please help me to fix this problem.
I am having an abnormal termination problem, when using the function createScaledImage of the DicomImage class.
Error is happening from the internal function
Code: Select all
void reducePixel(const T *src[], T *dest[])
Following is the code for scaling an image, reduce the size to 800
Code: Select all
#define MAX_VALUE 800
int nOrgWidth = 1576;
int nOrgHeight = 1976;
// scale the image to 800
if(nOrgWidth > MAX_VALUE || nOrgHeight > MAX_VALUE)
{
if(nOrgWidth > nOrgHeight)
dScaleFactor = nOrgWidth / (double) MAX_VALUE;
else
dScaleFactor = nOrgHeight / (double) MAX_VALUE;
// dScaleFactor = 2.4700000000000002
unsigned long widthTotal = nOrgWidth / dScaleFactor; // 638
unsigned long heightTotal = nOrgHeight / dScaleFactor; // 799
DicomImage *pCurImage = orgDi->createScaledImage(widthTotal, heightTotal, 2);
}
Code: Select all
int nOrgWidth = 1576;
int nOrgHeight = 1976;
unsigned long widthTotal = nOrgWidth / 2;
unsigned long heightTotal = nOrgHeight / 2;
DicomImage *pCurImage = orgDi->createScaledImage(widthTotal, heightTotal, 2);
viewtopic.php?t=473&highlight=createscaledimage
, I understand that here c't Interpolation algorithm is used for scaling.
Also, there is no similar abnormal termination problem in pbmplus algorithm with createScaledImage (when using the above code).
Please provide a solution
Thanks and Regards
Alvin