Commit 3a20bf00 authored by 刘劭荣(20软)'s avatar 刘劭荣(20软)

更新输出类型

parent e28d50b9
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
### socket ### socket
* 用户必须要在接收到CT序列成功读取的信息后,才能进行该功能 * 用户必须要在接收到CT序列成功读取的信息后,才能进行该功能
* 用户向本端口发送 `PARA(rx, ry, rz, dx, dy, threshold, flag)` 即可启动该功能 * 用户向本端口发送 `PARA(rx, ry, rz, dx, dy, threshold)` 即可启动该功能
* rx, ry, rz (float): 模型的绕XYZ轴的旋转角度(-180~180) * rx, ry, rz (float): 模型的绕XYZ轴的旋转角度(-180~180)
* dx, dy (int): 生成图像的大小 * dx, dy (int): 生成图像的大小
* threshold (float): DRR筛选阈值 * threshold (float): DRR筛选阈值
* flag (int): 选择数组的返回类型,0为float数组,1为unsigned char数组 * 例如 `PARA(90.0, 0.0, 0.0, 1024, 1024, 0.0)`
* 例如 `PARA(90.0, 0.0, 0.0, 1024, 1024, 0.0, 1)` * 生成的图像数组类型为 unsigned char*
* DRR生成完毕后,用户将接收一个一维数组,长度为dx*dy,用来表示生成的DRR图像 * DRR生成完毕后,用户将接收一个一维数组,长度为dx*dy,用来表示生成的DRR图像
## 客户端示例 ## 客户端示例
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet> <CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset> <PlatformToolset>v141</PlatformToolset>
<UseOfMfc>Static</UseOfMfc> <UseOfMfc>false</UseOfMfc>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
......
...@@ -195,11 +195,10 @@ int main() { ...@@ -195,11 +195,10 @@ int main() {
cout << " Help: " << endl; cout << " Help: " << endl;
cout << " Send the message \"CT(__folder_path__)\" for loading a CT sequence." << endl; cout << " Send the message \"CT(__folder_path__)\" for loading a CT sequence." << endl;
cout << " Client will receive the message to inform if the operation is completed." << endl; cout << " Client will receive the message to inform if the operation is completed." << endl;
cout << " Send the message \"PARA(rx,ry,rz,dx,dy,threshold,flag)\" for generating a DRR image." << endl; cout << " Send the message \"PARA(rx,ry,rz,dx,dy,threshold)\" for generating a DRR image." << endl;
cout << " rx,ry,rz(float) are the rotation angle for the DRR image." << endl; cout << " rx,ry,rz(float) are the rotation angle for the DRR image." << endl;
cout << " dx,dy(int) are the width and height of the DRR image." << endl; cout << " dx,dy(int) are the width and height of the DRR image." << endl;
cout << " threshold(float) can filter the required pixels for DRR images." << endl; cout << " threshold(float) can filter the required pixels for DRR images." << endl;
cout << " flag(int) can decide the type of DRR array. 0 for float while 1 for unsigned char." << endl;
cout << " Client will receive a DRR array if the operation is completed." << endl; cout << " Client will receive a DRR array if the operation is completed." << endl;
cout << "*******************************************************************************" << endl; cout << "*******************************************************************************" << endl;
if (!cuda_check()) return 0; if (!cuda_check()) return 0;
......
...@@ -90,16 +90,9 @@ void socketManager::open_socket() { ...@@ -90,16 +90,9 @@ void socketManager::open_socket() {
float * data = handleString(szMessage, ret); float * data = handleString(szMessage, ret);
//////// 生成DRR //////// 生成DRR
try { try {
if ((int)data[6] == 0) { unsigned char* object2D = get_UCharDRR(data[0], data[1], data[2], (int)data[3], (int)data[4], data[5]);
float* object2D = get_FloatDRR(data[0], data[1], data[2], (int)data[3], (int)data[4], data[5]); send(sClient, (char*)object2D, sizeof(unsigned char)*(int)data[3] * (int)data[4], 0);
send(sClient, (char*)object2D, sizeof(float)*(int)data[3] * (int)data[4], 0); free(object2D);
free(object2D);
}
else {
unsigned char* object2D = get_UCharDRR(data[0], data[1], data[2], (int)data[3], (int)data[4], data[5]);
send(sClient, (char*)object2D, sizeof(unsigned char)*(int)data[3] * (int)data[4], 0);
free(object2D);
}
} }
catch (exception& e) { catch (exception& e) {
printf("Failed to generate DRR, please check your parameters.\n"); printf("Failed to generate DRR, please check your parameters.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment