c#.net で dicom ビューアーを開発しています。Pixel の HU 値の計算について少し助けが必要です。HUの計算式は、
HU = Pixel Value * Rescale Slope + Rescale Intercept
いくつかの計算を行い、元の dicom ピクセル値から取得しましたが、正しい HU 値が得られません。私の質問は、ピクセル値とは正確には何ですか。誰でも私を助けてください。
これは私のコードです
public void calculateHU(string x,string y)
{
Int32 intercept, slope,pix;
intercept = -1024;
slope = 1;
int xx, yy;
xx = Convert.ToInt32(x);
yy = Convert.ToInt32(y);
xx = xx +Convert.ToInt32( imagerect.X);
yy = yy + Convert.ToInt32( imagerect.Y);
pix = getpixelvalue(xx,yy);
double hu = pix * slope + intercept;
}
public Int32 getpixelvalue(int x, int y)
{
string c;
c = pix16[imgno][y * bmd.width + x].ToString();
return Convert.ToInt32(c);
}