/////////////////////////////////////////////////////////////////////////////<br>
1. How to implement <a href="http://www.leadtools.com/SDK/Image%20Processing/functions/Get%20Bitmap%20Statistics%20Information/">Get Bitmap Statistics Information</a> in V14.5.0.74(com) with VC++<br>
<br>
//<br>
pRast->GetRaster().SetRgnEllipse(l, t, r, b, L_RGN_SET); // or SetRgnRect(..........);<br>
int nMax = (1
//ILEADRasterProcess* pProc = NULL;<br>
pProc->GetBitmapStatisticsInfo(pRast->GetRaster(), CHANNEL_MASTER, 0, nMax);<br>
<br>
pRast->SetRgnFrameType(RGNFRAME_ANIMATED);<br>
pProc->GetRgnPerimeterLength(pRast->GetRaster());<br>
int nLength = pProc->GetRgnPerimeterLength();<br>
<br>
/*<br>
pProc->BitmapMean<br>
pProc->BitmapStandardDeviation<br>
pProc->BitmapMedian<br>
pProc->BitmapMinValue<br>
pProc->BitmapMaxValue<br>
pProc->BitmapPixelsCount<br>
pProc->BitmapSelectedPixelPercent<br>
*/<br>
<br>
<br>
<br>
/////////////////////////////////////////////////////////////////////////////<br>
2. How to save 16bits allocated, 12bit stored Dicom image from bitmap in V14.5.0.74(Classlib) with VC++?<br>
<br>
LBitmap & LDicomDS is not work.<br>
<br>
//<br>
LBitmap lBmp;<br>
int nRet = -1;<br>
<br>
#if FALSE<br>
nRet = lBmp.Load("d:\\ct_test_24.bmp", 12, ORDER_RGBORGRAY);<br>
#else<br>
nRet = lBmp.Load(_T("d:\\ct_test_24.bmp"), 0, ORDER_RGBORGRAY);<br>
nRet = lBmp.GrayScale(12);<br>
#endif<br>
<br>
pBITMAPHANDLE pHandle = lBmp.GetHandle();<br>
<br>
lBmp.SetFileName(_T("d:\\out_16A_12S.dcm"));<br>
nRet = lBmp.Save(FILE_DICOM_GRAY, // FILE_DICOM_GRAY, FILE_DICOM_COLOR<br>
12, // 16 ?<br>
FILE_RAW, // FILE_DICOM_GRAY, FILE_RAW, FILE_BMP<br>
1, //MULTIPAGE_OPERATION_OVERWRITE,<br>
NULL);<br>
<br>
LDicomDS ds;<br>
ds.InitDS(CLASS_CT_IMAGE_STORAGE,<br>
DS_METAHEADER_PRESENT | DS_LITTLE_ENDIAN | DS_EXPLICIT_VR | DS_GROUP_LENGTHS | DS_LENGTH_EXPLICIT | DS_KEEP_PIXEL_DATA_INTACT);<br>
<br>
pDICOMELEMENT pElement = ds.FindFirstElement(NULL, TAG_PIXEL_DATA, TRUE);<br>
<br>
/*<br>
pHandle = lBmp.GetHandle();<br>
pHandle is OK. (as 12Bits Image value)<br>
Max Value = 4095 and so on<br>
*/<br>
#if TRUE<br>
nRet = ds.SetImage(pElement, pHandle,<br>
IMAGE_COMPRESSION_NONE,<br>
IMAGE_PHOTOMETRIC_MONOCHROME2,<br>
12, // 16?<br>
0,<br>
DICOM_SETIMAGE_AUTO_SET_VOI_LUT | DICOM_SETIMAGE_KEEP_LUTS_INTACT,<br>
NULL, NULL);<br>
#else<br>
nRet = ds.InsertImage(NULL, pHandle, 0, <br>
IMAGE_COMPRESSION_NONE,<br>
IMAGE_PHOTOMETRIC_MONOCHROME2,<br>
12, // or 16?<br>
0,<br>
DICOM_SETIMAGE_KEEP_LUTS_INTACT | DICOM_SETIMAGE_AUTO_SET_VOI_LUT,<br>
NULL, NULL);<br>
#endif<br>
<br>
nRet = ds.SaveDS(_T("d:\\out_16A_12S-1.dcm"), NULL);<br>
<br>
<br>
<br>