You are on page 1of 120

API User Manual

江苏康众数字医疗科技股份有限公司
CareRay Digital Medical Technology Co., Ltd.

地址(Addr): 江苏省苏州市工业园区星湖街 218 号生物纳米科技园 B3 楼 5 层

5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123

电话(Tel): +86-0512-86860288 传真(Fax): +86-0512-86860388


Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Update Log

Version Date Version Description Author


Rev 1.0 2011/06/01 Initial draft Jieqing.liu
Rev 2.0 2011/10/13 Update Shuai.li
Rev 2.1 2011/11/07 .dll Addition Shuai.li
Rev 2.2 2012/01/05 Release .dll Shuai.li
Rev 2.3 2012/04/23 Add new API functions Shuai.li
Add open/close option function for removal
Rev 2.4 2012/06/07 Shuai.li
low density grid
Rev 2.5 2012/07/12 Give more details of the API illustration Shuai.li
Rev2.6 2012/11/23 Add new API functions Shuai.li
Rev3.0 2012/12/20 Update Shuai.li
Rev3.0.1 2013/03/20 Update, no change in API interfaces Shuai.li
Add filter grid_suppression module for low
density grid;
Rev3.3 2013/04/23 Add API log record feature; Shuai.li
Add support for CareView 1800R and 500P;
No change of interfaces and work flow.
Correct the release memory error(cause
procedure crash);
Rev3.3.1 2013/05/06 Modify the generation method of Gain image; Shuai.li
Update the Microsoft library to eliminate
runtime error in certain OS.
1, Band correction at Auto Sync Mode;
2, Generate fixed and portable calibration files
for all types of detectors;
Rev4.0 2013/05/31 Shuai.li
3,Correct the calibration files in disorder;
4, Correct the calibration dir error;
5, Repair grey level inconformity.
1, Add API functions for dual-panel system,
such as: CR_switch_detector() and
CR_get_active_detector_id();
2, Change pulseNum member of struct
ExpProgress to inside_offs_corrflag
Rev 4.0.1 2013/.7/19 3, Add detector temperature status structure Shuai.li
overhot_flag;
4, Search bad pixels, and correct the edge black
part mistakes of bad pixel;
5, Add cal_time_interval item in cfg file\
CareRay\conf folder used as waiting intervals
www.careray.com
I
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

when calibrating images;


6, Add description about shielded zone, which
is defined as the zone of transmitted image
where the X-ray signal would reach such a low
level that will affect image quality;
7, Add definition for CareRay’s *.raw image
format.
1, Add new API functions:
CR_select_cal_type(char* name);
Rev 4.0.2 2013/12/19 2, Add appendix 8 (switch calibration files); Shuai.li
3, Fix a bug of mistaking normal lines as bad
lines after calibration for some detectors.
1, Fix a bug of image data overflow after doing
offset correction;
Rev 4.0.2.1 2014/02/28 Shuai.li
2, Improve defect detection method for 500M
detector.
Rev4.0.3 Beta 2014/05/29 Support Software Sync Mode function. Shuai.li
Improve the functions bellow based on Rev
4.0.1,
1, Revise the bug that the grid suppression
function only works well for the first time, but
failed for another time;
Rev4.0.4 2014/04/24 2, Revise the bug that the image automatically Shuai.li
do the realtime Offset correction in Manual
Sync Mode and Auto Sync Mode;
3, Support multi-kV calibration files;
4. Revise the bug the image value overflow
during Offset correction.
1, Add SCAN_SYNC Mode for 1500C and
1500P;
2, Add two API functions used for real time
offset correction in SCAN_SYNC Mode;
3, Fix the bug of grid suppression only
successful for the first time;
4, Fix a bug of subtracting offset image in any
Rev 4.0.5 Beta 2014/03/24 Shuai.li
case when acquiring image at Manual or Auto
sync mode;
5, Fix the bug of inpainting step section in
SCAN_SYNC Mode;
6, Fix the bug of getting Rad image failed in
AUTO_SYNC Mode;
7, Fix the bug that the defect classification
www.careray.com
II
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

function will crash if too much bad pixels exist.


1, Merge AUTO_SYNC Mode and
SCAN_SYNC Mode into AED_SYNC Mode;
Rev 4.0.5.3 Beta 2014/06/22 Shuai.li
2, Modify the image quality in AED_SYNC
Mode.
1, Improve the step and strip correction method
when using AED Sync Mode
Rev4.0.5.3 2014/07/15 Shuai.li
2, Support real time offset correction for each
type of detectors and sync modes
1, Improve the step and stripe correction quality
at AED Sync Mode;
2, Support real time Offset correction method;
3, Modify and add API functions for dual-panel
Rev4.1.0 2014/07/28 DR system application; Shuai.li
4, Optimize the defect detection and correction
method;
5, Abandon some old API functions whose
names are unreasonable.
1, Modify defection classification bug after
calibration;
2, Support 1500L, 1500W, 300P, 750M
prototype detectors;
Rev4.1.1 Beta 2014/09/02 3, Remove logs generated one month ago; Shuai.li
4, Improve bad line inpainting;
5, Fix data overflow bug in AED sync mode
6, Fix crash bug at unknown case when
disconnect detector
1, Modify issue that costing much time to
connect in disconnected state
2, Modify issue that costing much time to
Rev4.1.1 2014/09/13 detect connection state while network is in Shuai.li
offline state
3, Cancel restriction that using administrator
authority at win7 or higher OS
1, Process false trigger problem;
2, Fix downloading manufacture defect file
failure problem;
3, Improve AED image quality;
Rev4.1.1.1 2015/01/15 Shuai.li
4, Support switching power mode for 1500Cw;
5, Fix image with grid problem when set
filter=0 in Config.ini file
6, Improve bad line inpainting;
www.careray.com
III
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

7, Improve data pick up accuracy in AED train


process;
8, Improve manual modify defect file function;
9, Increase rate of success for AED image
preprocess;
10, Support multiple integration time offset
calibration files
1, Improve image quality at AUTO SYNC (For
500P prototype detectors);
Rev4.1.1.2 2015/03/04 Shuai.li
2, Improve data pick up accuracy in AED train
process
1,Optimize network connection and
Rev4.2.0 2015/04/03 disconnection Shuai.li
2, Improve image quality at AED SYNC
1,Optimize upload file function and fix some
Rev4.2.1 2015/07/10 Shuai.li
bugs
1, Add one key calibration function
2, Add CareTouch 100 function
3, Add quros real time offset correction
4, Add AEC function
5, Add network resume function
6, Improve defect detection and inpaint
Rev4.3.0 Beta 2015/09/30 Shuai.li
7, Improve real time defect detection and
inpaint
8, Modify API log content format
9, Save temp images
10, Improve image quality at AutoSync
11, Fix some bugs exists in former versions
Rev4.3.0 2015/12/24 Fix bugs in 4.3.0 Beta
Fix bugs in previous version, add error code,
Rev4.5.0 2016/06/20 support one key calibration, grid suppression,
AED small window exposure
Rev4.5.1 2017/01/20 Fix bugs in previous version, support 1800Cw
1, Fix some bugs
2, Add new API functions to get / set wireless
Rev4.5.3 2018/03/08 IP and mode
3, Add NDT_mode function
4,Support 750S, 1500S
Optimize network transfer performance for
Rev4.7.0 2018/05/15
WiFi, improve reliability
Rev4.8.0 2019/08/21 Support 1800Le, 1800Cwe, D4343

www.careray.com
IV
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Contents
API USER MANUAL.................................................................................................................................................. 1

1 INTRODUCTION .................................................................................................................................................... 1

2 GENERAL DESCRIPTION OF API FUNCTIONS, STRUCTURES, CONSTANTS, AND ERROR CODES ..... 3

2.1 DATA TYPE .................................................................................................................................................................. 3


2.2 API FUNCTION LIST ..................................................................................................................................................... 3
2.3 DATA STRUCTURES ...................................................................................................................................................... 6
2.3.1 Common structures .............................................................................................................................................. 6
2.3.2 Common constants............................................................................................................................................. 17
2.4 CONFIGURATION FILES ............................................................................................................................................... 21
2.4.1 Config.ini ........................................................................................................................................................... 21
2.4.2 cfg.properties ..................................................................................................................................................... 22
2.5 ERROR CODES ............................................................................................................................................................ 23
2.5.1 API error codes ................................................................................................................................................. 23
2.5.2 Firmware error codes ........................................................................................................................................ 30

3 API FUNCTION SPECIFICATIONS .....................................................................................................................32

3.1 COMMON FUNCTIONS ................................................................................................................................................ 33


3.1.1 CR_connect_detector() ...................................................................................................................................... 33
3.1.2 CR_disconnect_detector() ................................................................................................................................. 34
3.1.3 CR_reset_detector()........................................................................................................................................... 34
3.1.4 CR_set_check_mode() ....................................................................................................................................... 35
3.1.5 CR_set_sync_mode() ......................................................................................................................................... 35
3.1.6 CR_set_cycle_time() .......................................................................................................................................... 36
3.1.7 CR_set_normal_power() ................................................................................................................................... 37
3.1.8 CR_set_save_power() ........................................................................................................................................ 37
3.1.9 CR_permit_exposure() ....................................................................................................................................... 38
3.1.10 CR_start_acq_full_image() ............................................................................................................................. 39
3.1.11 CR_start_acq_prev_image() ............................................................................................................................ 39
3.1.12 CR_start_acq_def_image() .............................................................................................................................. 39
3.1.13 CR_stop_acq_frame() ...................................................................................................................................... 40
3.1.14 CR_stop_acq_frame_cleanup() ....................................................................................................................... 40
3.1.15 CR_set_user_correction() ................................................................................................................................ 40
3.1.16 CR_get_user_correction() ............................................................................................................................... 41
3.1.17 CR_inpaint_bad_pixels() ................................................................................................................................. 42
3.1.18 CR_set_dose() ................................................................................................................................................. 42
3.1.19 CR_get_API_version() .................................................................................................................................... 43
3.1.20 CR_get_conn_state() ....................................................................................................................................... 43
3.1.21 CR_get_detector_type() ................................................................................................................................... 44
3.1.22 CR_get_detector_info() ................................................................................................................................... 44
www.careray.com
V
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.23 CR_get_mode_info()........................................................................................................................................ 44
3.1.24 CR_get_status_info() ....................................................................................................................................... 45
3.1.25 CR_get_image_attr() ....................................................................................................................................... 45
3.1.26 CR_get_image()............................................................................................................................................... 45
3.1.27 CR_query_prog_info() ..................................................................................................................................... 48
3.1.28 CR_select_cal_type() ....................................................................................................................................... 48
3.1.29 CR_register_callback().................................................................................................................................... 49
3.1.30 CR_send_exp_request() ................................................................................................................................... 50
3.1.31 CR_ready_state_request() ............................................................................................................................... 50
3.1.32 CR_start_soft_acquisition()............................................................................................................................. 51
3.1.33 CR_set_active_detector() ................................................................................................................................ 51
3.1.34 CR_get_dual_detector_state() ......................................................................................................................... 52
3.1.35 CR_get_cal_params() ...................................................................................................................................... 53
3.1.36 CR_cal_offset() ................................................................................................................................................ 54
3.1.37 CR_execute_linear_cal() ................................................................................................................................. 54
3.1.38 CR_execute_portable_cal() ............................................................................................................................. 55
3.1.39 CR_stop_cal_procedure() ................................................................................................................................ 55
3.1.40 CR_set_cal_thread() ........................................................................................................................................ 56
3.1.41 CR_switch_detector() ...................................................................................................................................... 56
3.1.42 CR_get_active_detector_ID() .......................................................................................................................... 57
3.1.43 CR_linear_calibration() .................................................................................................................................. 57
3.1.44 CR_portable_calibration() .............................................................................................................................. 58
3.1.45 CR_get_one_key_cal () ................................................................................................................................... 58
3.1.46 CR_check_img_for_factory_cal ()................................................................................................................... 58
3.1.47 CR_download_factory_cal_files () .................................................................................................................. 59
3.1.48 CR_execute_one_key_cal () ............................................................................................................................ 59
3.1.49 CR_set_AEC_integ_time ().............................................................................................................................. 60
3.1.50 CR_register_AEC_callback () ......................................................................................................................... 60
3.1.51 CR_start_AEC_acquire_process () ................................................................................................................. 60
3.1.52 CR_set_smart_hand_switch () ......................................................................................................................... 61
3.1.53 CR_get_SHS_status () ..................................................................................................................................... 61
3.1.54 CR_get_unuploaded_img_info () .................................................................................................................... 61
3.1.55 CR_start_acq_dark_full_image () ................................................................................................................... 61
3.1.56 CR_set_offset_correction () ............................................................................................................................. 62
3.1.57 CR_start_acq_dark_prev () ............................................................................................................................. 62
3.1.58 CR_get_status_info_Ex() ................................................................................................................................. 62
3.1.59 CR_get_wireless_info() ................................................................................................................................... 63
3.1.60 CR_set_wireless_info () ................................................................................................................................... 63
3.1.61 CR_get_station_mode_conf() .......................................................................................................................... 63
3.1.62 CR_set_station_mode_conf() ........................................................................................................................... 64
3.1.63 CR_get_temperature_cal_data ........................................................................................................................ 64
3.1.64 CR_check_temperature_slot ............................................................................................................................ 64

www.careray.com
VI
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.65 CR_start_acq_NDT_dark_image .................................................................................................................... 65


3.1.66 CR_execute_NDT_CAL ................................................................................................................................... 65
3.1.67 CR_correct_NDT_image ................................................................................................................................. 65
3.1.68 CR_set_NDT_frame_num ................................................................................................................................ 66
3.1.69 CR_finish_NDT_acquisition ............................................................................................................................ 66
3.1.70 CR_check_NDT_CAL_Files ............................................................................................................................ 66

4 IMAGE ACQUISITION .........................................................................................................................................67

4.1 CHECK MODE ............................................................................................................................................................. 67


4.2 SYNCHRONIZATION MODE.......................................................................................................................................... 67
4.2.1 External Sync Mdoe ........................................................................................................................................... 67
4.2.2 Manual Sync Mode ............................................................................................................................................ 69
4.2.3 Software Sync Mode .......................................................................................................................................... 71
4.2.4 AED Sync Mode ................................................................................................................................................. 75
4.2.5 Sync mode and parameter setting for each type of detector .............................................................................. 76
4.3 IMAGE ACQUISITION .................................................................................................................................................. 78
4.4 IMAGE CALIBRATION.................................................................................................................................................. 81
4.4.1 Conventional calibration ................................................................................................................................... 81
4.4.2 One-shot calibration .......................................................................................................................................... 85
4.5 DUAL-PANEL APPLICATION......................................................................................................................................... 89
4.6 DETECTOR MONITOR.................................................................................................................................................. 93
4.6.1 Temperature flag ................................................................................................................................................ 93
4.6.2 Battery Info ........................................................................................................................................................ 94
4.6.3 Wireless Info ...................................................................................................................................................... 94
4.7 RECONNECT AND RESUME TRANSFER ........................................................................................................................ 95
4.8 CARETOUCH 100 ....................................................................................................................................................... 97
4.9 FFAEC ...................................................................................................................................................................... 98
4.9.1 Application Scenarios ........................................................................................................................................ 98
4.9.2 AEC Implementation and Usage Guide ............................................................................................................. 98
4.9.3 AEC acquisition flow ........................................................................................................................................ 100
4.10 THINGS YOU NEED TO KNOW ABOUT F2AED ......................................................................................................... 102

5 IMAGE CORRECTION .......................................................................................................................................104

5.1 CALIBRATION FILES MANAGEMENT AND USAGE ....................................................................................................... 104


5.1.1 Load calibration files ...................................................................................................................................... 104
5.1.2 Switch calibration files .................................................................................................................................... 104
5.1.3 Upload and download calibration files ........................................................................................................... 105
5.2 IMAGE CORRECTION FLOW WITH GRID ..................................................................................................................... 105
5.3 CARERAY GRID SUPPRESSION MODULE .................................................................................................................... 107
5.3.1 Grid spec ......................................................................................................................................................... 107
5.3.2 Grid detection and suppression ....................................................................................................................... 107
5.3.3 Potential risk ................................................................................................................................................... 108

www.careray.com
VII
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

5.4 IMAGE EDGE PROCESS.............................................................................................................................................. 108

Figure Contents
Figure 1 Raw image matrix ....................................................................................................................................... 46

Figure 2 State machine and exchange flow at external sync mode............................................................................ 68

Figure 3 Detector flow chart in External Sync Mode ................................................................................................ 69

Figure 4 Timing flow at manual sync mode .............................................................................................................. 70

Figure 5 Time flow chart in Manual Sync Mode ....................................................................................................... 71

Figure 6 Time flow chart in Software Sync Mode..................................................................................................... 72

Figure 7 Work flow in Software Sync Mode ............................................................................................................. 73

Figure 8 API flow in Software Sync Mode................................................................................................................ 75

Figure 9 Time flow chart in AED Sync Mode ........................................................................................................... 76

Figure 10 Image acquisition flow 1 ........................................................................................................................... 80

Figure 11 Image acquisition flow 2 ........................................................................................................................... 81

Figure 12 Offset calibration flow............................................................................................................................... 83

Figure 13 Gain calibration flow ................................................................................................................................. 85

Figure 14 Gain calibration flow ................................................................................................................................. 86

Figure 15 Gain calibration flow ................................................................................................................................. 88

Figure 14 Connection recommendation for dual-panel system ................................................................................. 90

Figure 15 Detector management page login GUI ...................................................................................................... 91

Figure 16 Network Configuration page ..................................................................................................................... 91

Figure 17 software work flow for dual-panel system ................................................................................................ 92

Figure 18 Temperature controlling ............................................................................................................................ 93

Figure 19 Different CareTouch 100 icons to indicate different states (refer to the original PDF file for colored

images)............................................................................................................................................................... 98

Figure 20 Image correction flow with grid .............................................................................................................. 106

Figure 21 Defection process flow ............................................................................................................................ 106

Figure 22 Blind and low sensitive area .................................................................................................................... 109

www.careray.com
VIII
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

www.careray.com
IX
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1 Introduction
This manual describes API interface of medical X-ray flat panel detector produced by CareRay, including

interface functions and detailed instructions. Interface functions provide to customer in the form of

DLL(Dynamic Link Library). Customer’s program can import these DLL files and follow the predefined

workflow to control CareRay’s detector and image acquisition.

Following figure shows the overall software system architecture. API interface includes detector

configuration, detector calibration, image acquisition and correction functions. Please make sure all the

relevant documents for detector configuration and image correction are saved in the corresponding directory.

This directory must be specified when PC connects to the detector.

The interface functions are programmed using ANSIC. The return type of all functions is integer,

indicating the functions called successfully or not.

This software can run on Windows XP/Vista/7/8/10, 32 bits or 64 bits OS. As the details specified bellow,

the Yellow shaded contents stand for the updated places in this version compared with the last version.

www.careray.com
1
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

User Interface
DROC Layer
Detector Control
Image Display

API Invoke

System/configuration/network
management
Middle Layer Sync control、Image acquisition
and calibration Image
Acquisition/Correction

Network

Platform Layer Detector embedded software


platform

!
Configuration and calibration files should be saved under the host’s specified
directories.

www.careray.com
2
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

2 General description of API functions, structures,


constants, and error codes

2.1 Data Type

The data types used for the definition of functions and parameters are:

Type Description Size

int signed integer 4 bytes

short signed short integer 2 bytes

WORD unsigned short 2 bytes

char char 1 bytes

BOOL signed integer 4 bytes

float single precision float 4 bytes

UINT unsigned integer 4 bytes

The data type of Rad image and 2×2 Binning image is WORD, while Preview
image (32×32 Binning) is UINT.

2.2 API Function List

Index Function Description

1 CR_connect_detector Establish network connection between detector and PC

2 CR_disconnect_detector Disconnect detector and PC

3 CR_reset_detector Reset detector

4 CR_set_check_mode Set detector’s X-ray check mode

www.careray.com
3
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

5 CR_set_sync_mode Set detector sync mode

6 CR_set_cycle_time Set each phase time of one acquisition cycle

7 CR_set_normal_power Set detector in Full-power state

8 CR_set_save_power Set detector in Low-power state

9 CR_permit_exposure Permit exposure

10 CR_start_acq_full_frame Start exposure flow, ready to acquire full resolution image

Start exposure flow, ready to acquire preview resolution image


11 CR_start_acq_prev_frame
(testing)

//Start exposure flow, ready to acquire user-defined resolution


12 CR_start_acq_def_frame
image(testing)

13 CR_stop_acq_frame Stop exposure flow

14 CR_stop_acq_frame_cleanup Stop exposure flow, and clear the buffer of image sending end

15 CR_set_user_correction Set image correction options

16 CR_get_user_correction Get image correction options

17 CR_inpaint_bad_pixels Inpaint bad pixels

18 CR_set_dose Set certain KV’s calibration images

19 CR_get_API_version Get API version

20 CR_get_conn_state Get socket connection state

21 CR_get_detector_type Get detector type

22 CR_get_detector_info Get detector system information

23 CR_get_mode_info Get detector mode information

24 CR_get_status_info Get detector status information

25 CR_get_image_attr Get attribute of target image

26 CR_get_image Get target image from detector to PC

27 CR_query_prog_info Query exposure progress

28 CR_select_cal_type Load specified calibration files while doing image correction

www.careray.com
4
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Register the callback function, which is used for Software Sync


29 CR_register_callback
Mode.

30 CR_send_exp_request Send exposure request to detector

31 CR_ready_state_request Send ready state request to detector

Open the image acquisition thread used for Software Sync


32 CR_start_soft_acquisition
Mode

33 CR_set_active_detector Switch to appointed detector (used in dual-panel system)

34 CR_get_dual_detector_state Get the detector state of dual-panel system

35 CR_get_cal_params Get image calibration parameters

36 CR_cal_offset Execute offset calibration flow

37 CR_execute_linear_cal Generate calibration files for fixed detector

38 CR_execute_portable_cal Generate calibration files for portable detector

39 CR_stop_cal_procedure Stop the calibration procedure

40 CR_set_cal_thread Set image calibration state

41 CR_switch_detector Switch to appointed detector(used in dual-panel system)

Get current active panel ID(0: the first detector,;1: the second
42 CR_get_active_detector_ID
one)

Generate calibration files for fixed detector. Not recommend to


43 CR_linear_calibration
use. Please use CR_execute_linear_cal() instead.

Calibration function, generate calibration, for portable detector.

44 CR_portable_calibration Not recommend to use. Please use CR_execute_portable_cal()

instead.

45 CR_get_one_key_cal check if use one key calibration function


check the first rad image generated in factory calibration
46 CR_check_img_for_factory_cal satisfied the requirements, such as mean value, collimator open,
center alignment.
47 CR_download_factory_cal_files Download gain and defect files generated in factory calibration
Calculate one key calibration files according to input rad and
48 CR_execute_one_key_cal
offset images

www.careray.com
5
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

49 CR_set_AEC_integ_time Set integration time for AEC

50 CR_register_AEC_callback Register AEC callback function

51 CR_start_AEC_acquire_process Start AEC acquisition flow

52 CR_set_smart_hand_switch Set CareTouch 100 parameters

53 CR_get_SHS_status Get CareTouch 100 status

54 CR_get_unuploaded_img_info Get resume broken image information


Start acquisition flow, ready to acquire full resolution dark
55 CR_start_acq_dark_full_image
image
56 CR_set_offset_correction Set offset correction

57 CR_start_acq_dark_prev Ready to acquire preview resolution dark image

58 CR_get_status_info_Ex Get specified detector status information

59 CR_get_wireless_ip Get wireless ip

60 CR_set_wireless_ip Set wireless ip

61 CR_get_station_mode_conf Get station mode configurations

62 CR_set_station_mode_conf Set station mode configurations

63 CR_get_temperature_cal_data Get temperature slots’ information

64 CR_check_temperature_slot Check the temperature slot status

65 CR_start_acq_NDT_dark_image Start to acquire dark image of NDT_mode

66 CR_execute_NDT_CAL Calibration function, generate calibration files of NDT_mode

67 CR_correct_NDT_image Correct the acquired image of NDT_mode

68 CR_set_NDT_frame_num Set the accumulated images in detector for NDT_mode

For NDT_mode + manual sync mode, finish the acquisition


69 CR_finish_NDT_acquisition
process, the detector will stop accumulating image.
70 CR_check_NDT_CAL_Files Check calibration files if exist for NDT_mode

2.3 Data structures

2.3.1 Common structures

1. UserCorrection
www.careray.com
6
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

struct UserCorrection
Define the image correction options
Index Member Description

TRUE, means to enable fixed-position correction. The output image


1 BOOL fixedCorr will be corrected using fixed-position correction method;

FALSE, means to disable fixed-position correction.

TRUE, means to enable non-fixed-position correction. The image will


2 BOOL non_fixedCorr be corrected using non-fixed-position correction method;

FALSE, means to disable non-fixed-position correction.

TRUE, means to enable portable correction. The image will be


3 BOOL portableCorr
corrected using portable correction method
FALSE, means to disable portable correction.

Only one correction method can be set as TRUE. When setting certain item as

!
TRUE, the acquired image will be corrected using corresponding offset, gain, and
defect correction files. If all the items are set as FALSE, the acquired image will not
do any correction.

!
Correction type varies from each type of detector.

Correction modes specified for panels:

Detector Type fixedCorr non_fixedCorr portableCorr


CareView 1800R √ √ ×
CareView 1800I √ √ ×
CareView 1800L √ √ ×
CareView 500M √ √ ×

www.careray.com
7
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

CareView 1500R √ √ ×
CareView 1500L √ √ ×
CareView 750M √ √ ×
CareView 1500C √ × √

CareView 1500P √ × √

CareView 1500Rm √ × √

CareView 500P √ × √

CareView 1500Cw √ × √
CareView 300P √ × √
CareView 750M √ √ ×
CareView 1800L √ √ ×
CareView 1800RV2 √ √ ×
CareView 1500PRV2 √ × √
CareView 750Cw √ × √
CareView 750C √ × √
CareView 1800Cw √ × √
CareView 1500S √ × √
CareView 750S √ × √

2. DetectorInfo

struct DetectorInfo
Define the detector’s system information structure
Index Member Description
1 int rawImageWidth Width of raw image
2 int rawImageHeight Height of raw image
3 int maxPixelValue Max pixel value, 65535
4 int bitsPerPixel Single pixel bit depth
5 char hardWareVersion[STRLEN] Hardware version information
6 char softWareVersion[STRLEN] Software version information
7 char serialNumber[STRLEN] Serial number of detector
8 char detectorDescription[STRLEN] Descriptions about current detector

www.careray.com
8
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3. ModeInfo

struct ModeInfo
Define detector work mode structure
Index Member Description
1 int modeId Work mode id
Image acquisition type at current work mode. 0: Rad mode; 1:
2 int acqType
Fluoro mode
3 int imageWidth Image width at current work mode
4 int imageHeight Image height at current work mode
Pixel number per image line occupies. The value is greater
5 int linesPerPixel
than 1 means that the detector works inBinning mode
Pixel number per image column occupies. The value is
6 int colsPerPixel
greater than 1 means that the detector works inBinning mode
Total image length, including image head length and data
7 int imageSize
length. Unit: byte.
8 float maxFrameRate Max frame rate per second in current work mode
9 char modeDescription[STRLEN] Descriptions about current mode

4. StatusInfo

struct StatusInfo
Description of detector status infomation
Index Member Description
1 int currentMode Current check mdoe
2 int detectorState Current detector state
3 float frameRate Frame rate
4 Temperature temperature Internal temperature information, see following table
5 BatteryInfo batInfo Battery information, see following table
6 Wireless Infowireless_info Wireless communication information, see following table

5. Temperature

struct Temperature
Define detector’s temperature information
Index Member Description

www.careray.com
9
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1 float reserved[5] Reserved


Max temperature in detector. If the value equals -128 ℃, it
2 float maxTemperature
means there is no temperature sensor in current detector.
Average temperature in detector. If the value equals -128 ℃,
3 float aveTemperature which means there is no temperature sensor in current
detector.
4 int overhot_flag Overheat flag, see section 2.3.2 of enum TempStatus

6. Battery

struct BatteryInfo
Define wireless detector’s battery information
Index Member Description
1 int manu_access
2 int alarm_capa Unit: mAh
3 int alarm_time Unit: min
4 int mode Range: 0x0000~0xffff
5 int atrate Range: -32768mA~32768mA
6 int atrate_tofull Unit: min
7 int atrate_toempty Unit: min
8 int atrate_ok Unit: min
9 float temperature Unit: C
10 float voltage Unit: V
11 float current Unit: A
12 float ave_current Unit: A
13 float max_error
14 float relative_state_of_charge Dump energy (decimals format)
15 float absolute_state_of_charge
16 int rest_capacity Unit: mAh
17 int full_capacity Unit: mAh
18 int run_time_to_empty
19 int ave_time_to_empty
20 float charging_current Unit: A
21 float charging_voltage Unit: V
22 int battery_status Battery state, 0: charge, 1: discharge

www.careray.com
10
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

23 int cycle_count
24 int design_capacity Unit: mAh
25 float design_voltage Unit: V
26 float cell4_voltage Unit: V
27 float cell3_voltage Unit: V
28 float cell2_voltage Unit: V
29 float cell1_voltage Unit: V

7. WirelessInfo

struct WirelessInfo
Define wireless detector’s wireless status
Index Member Description
1 char essid[32] Session ID
2 char mode[16] Wireless mode ID
3 char freq[16] Wireless mode frequency
4 char channel[16] Wireless mode channel
5 char bit_rate[16] Bit rate
6 char encypt_key[64] Encypt key
7 char security_mode[16] Security mode
8 char link_quality[16] Wireless link quality
9 char signal_level[16] Signal level
10 char noise_level[16] Noise level
11 char sensitivity[16]
12 char reserved1[16]
13 unsigned long long tx_packets Sent data package number
14 unsigned long long rx_packets Received data package number
15 unsigned long long tx_bytes Sent data length in bytes
16 unsigned long long rx_bytes Received dala length in bytes
17 int reserved[64]

8. FrameAttr

struct FrameAttr
Define image’s attribute information
Index Member Description

www.careray.com
11
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1 int image_width Image width


2 int image_height Image height
3 int pixel_bits Pixel depth, unit: bit
Image type, see enum ImageDataType. UINT_16 means
4 int image_datatype
unsigned short (16bit); UINT_32 means unsigned int (32bit)

9. ExpProgress

struct ExpProgress
Define image acquisition progress and status information
Index Member Description
Work state:
 CR_EXP_ERROR(-1): detector stays in error state
 CR_EXP_INIT(0): detector stays in initial state
 CR_EXP_READY(1): detector is in ready state, and
waiting for exposure signal to come (only for External
Sync Mode)
 CR_EXP_WAIT_PERMISSION(2): detector gets the
1 int expStatus X-ray exposure request signal arrives, and waits for
PC’s permission.
 CR_EXP_PERMITTED(3): detector gets the permitted
signal from PC.
 CR_EXP_EXPOSE(4): detector works in integration
time state.
 CR_EXP_COMPLETE(5): X-ray exposure finishes, and
detector is ready to transfer the image.
2 BOOL inside_offs_corrflag
3 BOOL dark_reqflag
4 int frameNum
5 BOOL fetchable TRUE(1), the image is ready; otherwise is FALSE(0).
6 int errorCode Nonzero means calibration error.
TRUE(1), image calibration finish; FALSE(0), image
7 BOOL calComplete
calibration is still in process.
Used at AED or Manual Sync Mode (no sync cable).
8 BOOL expose_flag FALSE(0) means not press hand switch, while TRUE(1)
means hand switch pressed.

www.careray.com
12
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

!
This structure plays an important role at Rad mode, ExpStatus saved current
detector’s work state, whose value varies from work state’s change.

Only expStatus in CR_EXP_READY(1), user can press hand switch at external


sync mode.User can call CR_permit_exposure to tell detector that PC program runs

! well and permit it to start image acquisition progress when expStatus in


CR_EXP_WAIT_PERMISSION(2).

10. DetectorActiveState

struct DetectorActiveState
Define the dual detectors’ state information
Index Member Description
Current applicate detector number
1 int detectorNum 1, single panel
2, two panels
2 int detectorAType Detector A type in dual_panel system, see enum DetectorType
3 int detectorBType Detector B type in dual_panel system, see enum DetectorType
Active detector ID
4 int activeDetectorID 0 means detector A, whose IP is 192.168.68.1
1 means detector B, whose IP is 192.168.68.2
Detector A connection state,
5 BOOL detectorAstate TRUE(1), connected
FALSE(0), disconnected
Detector B connection state
6 BOOL detectorBstate TRUE(1), connected
FALSE(0), disconnected

11. irDA

struct irDA
Define the infrared distance sensor parameters
Index Member Description
1 int irDAEnable Sensor enable / disable

www.careray.com
13
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

2 int irDAOffset Sensor offset compensation


3 int irDAPulse Sensor pulse frequency
4 int irDAIHTL Sensor threshold upper limit
5 int irDALTL Sensor threshold lower limit
6 int irDAGain Sensor infrared gain
7 int irDADrive Sensor infrared drive current

12. SHSParam

struct SHSParam
Define the CareTouch 100 parameters

Index Member Description


char
1 CareTouch 100 hardware version
hardwareVersion[256]
2 char pairedID[256] CareTouch 100 default id
3 int heartbeatInterval CareTouch 100 paired id
4 int timeoutPeriod CareTouch 100 heart beat interval (unit : s)
5 int buzzerEnabled Enable / disable CareTouch 100 buzzer
6 int touchSensorEnabled Enable / disable CareTouch 100 touch sensor
7 irDA irDACfg Infrared distance sensor parameters structure
8 int handSwitchEnabled Enable / disable CareTouch 100

13. SHSStatus

struct SHSStatus
Define CareTouch 100 status information
Index Member Description
Connection state between hand switch and detector, please refer to
1 int connectedToDetector
Chapter 4.7
2 int beingTouched Jf the hand switch had been touched
int
3 Hand switch battery remain capacity (0 ~ 100)
batteryRemainingCapacity
4 int signalIntensity Communication quality between hand switch and detector (0~100)
5 int secondsLeft Auto shut down seconds left time (0~7200s)
SHSParam
6 Hand parameter configuration, see above structure
handSwitchSettings

www.careray.com
14
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

14. SurfaceFitResult

struct SurfaceFitResult
Define the return result of one key calibration
Index Member Description
1 float R2 Score of calibration
2 int x0 Reserved
3 int y0 Reserved
4 float param1 Reserved
5 float param2 Reserved
6 float param3 Reserved
7 float param4 Reserved

15. UnuploadedImgInfo

struct UnuploadedImgInfo
Define the resume broken image information
Index Member Description
1 BOOL existFlag If exist resume broken image flag
2 int width Image width
3 int height Image height
4 float finishedRate Resume image transferred rate
5 BOOL withHead If with head flag
6 int bitDepth Resume image pixel bit depth

16. WirelessStationConf

struct WirelessStationConf
Wirelss station mode configurations
Index Member Description
char
1 Wireless SSID
wireless_station_SSID[256]
2 char wireless_mode[256] Wireless mode, supported “6” and “11”

www.careray.com
15
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Wireless channel, if wireless_mode equals “6”, the supported channels are


"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11" /* '6' 2.4G */
3 char wireless_channel[256] If wireless_mode equals “11”, the supported channels are "149", "153",
"157", "161", "165" /* '11' 5G for FDA */, "36", "40", "44", "48", "52",
"56", "60", "64", "100", "104", "108", "112", "116" /* '11' 5G for CE */

17. TrainHead

struct TrainHead
Temperature slot information
Index Member Description
1 float temperature Temperature of slot
2 int integTime Integration time of slot
3 int generatedTime Generated time of slot (unit: total days)

18. TemperatureSlotWarnMsg

struct TemperatureSlotWarnMsg
Information about temperature slot absence
Index Member Description
1 int nDetectorID Detector ID
2 int nMissingExpTime Integration time of absence temperature slot
float Temperature of absence temperature slot
3
fMissingTemperature
float Detector temperature
4
fCurrentTemperature
float Temperature tolerance range
5
fToleranceTemperature

19. TemperatureSlotTrainMsg

struct TemperatureSlotTrainMsg
Temperature slot train information
Index Member Description
1 int nDetectorID Detector ID
2 int nExpTimeOfSlot Integration time of training slot
3 int fTemperatureOfSlot Temperature of training slot

www.careray.com
16
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

2.3.2 Common constants

1. ExposureStatus

enum ExposureStatus

Define all the work state at External Sync Mode. Call CR_query_prog_info() to get current state
Index Member Enum Value Description

1 CR_EXP_ERROR -1 Detector in error state

2 CR_EXP_INIT 0 Detector in initializing state

Detector in READY state, and waiting for

3 CR_EXP_READY 1 hand switchbeing pressed to invoke

exposure request

Detector in waiting permission state. The

detector has received exposure request


4 CR_EXP_WAIT_PERMISSION 2
signal and is waiting for the exposure

permission from console.

5 CR_EXP_PERMITTED 3 Detector receives the permit from console.

Detector in integration time, and the


6 CR_EXP_EXPOSE 4
exposure is undergoing during this time.

X-ray Exposure completes and the image is


7 CR_EXP_COMPLETE 5
ready to be transmitted.

2. SyncMode

enum SyncMode

Define all the sync mode


Index Member Enum Value Description

1 UNDEF_SYNC 0 Undefined sync mode

2 EXT_SYNC 1 External Sync Mode

3 SOFT_SYNC 2 Software Sync Mode (without sync cable attached)

www.careray.com
17
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4 AUTO_SYNC 3 Auto Sync Mode (without sync cable attached)

5 MANUAL_SYNC 4 Manual Sync Mode (without sync cable attached)

6 SCAN_SYNC 5 Another Auto Sync Mode (without sync cable attached)

AED Sync Mode (without sync cable attached). It can be

7 AED_SYNC 6 used instead of the two AUTO Sync Mode

(AUTO_SYNC and SCAN_SYNC above).

3. ImageDataType

enum ImageDataType

Define the image pixel data type, call CR_get_image_attr() to get image data type in structure FrameArrt
Index Member Enum Value Description

1 UINT_16 0 unsigned short, Rad image pixel data type

2 UINT_32 1 unsigned int, Preview image pixel data type

3 INT_16 2 Reserved

4 INT_32 3 Reserved

5 FLOAT_32 4 Reserved

6 DOUBLE_64 5 Reserved

4. DetectorType

enum DetectorType

Define all the CareRay's detectors types


Index Member Enum Value Description

1 CareView_1500R 0 14’’×17’’, Static, fixed flat panel detector

2 CareView_1500Rm 1 14’’×17’’, Static, mobile-use flat panel detector

3 CareView_1500P 2 14’’×17’’, Static, portable flat panel detector

4 CareView_1500C 3 14’’×17’’, Static, cassette-size flat panel detector

5 CareView_1800R 4 17’’×17’’ , Static, fixed flat panel detector

www.careray.com
18
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

8’’×10’’(20cm×24cm)Static, fixed mammography flat


6 CareView_500M 5
panel detector (used for infant radiography as well)

8’’×10’’(20cm×24cm) Static, fixed flat panel detector


7 CareView_500I 6
used for industrial purpose

8’’×10’’(20cm×24cm) Static, portable flat panel detector


8 CareView_500P 7
for diagnostic purpose

9 CareView_900F 8 Dynamic flat panel detector (Reserved)

17’’×17’’, Static, fixed flat panel detector (used for


10 CareView_1800I 9
industry and radiography)

11 CareView_1500L 10 Static, fixed flat panel detector

12 CareView_1500Cw 11 Static, portable flat panel detector

13 CareView_300P 12 Dentistic used flat panel detector

Static, fixed mammography flat panel detector (used for


14 CareView_750M 13
infant radiography as well)

15 CareView_1800L 14 Static, fixed flat panel detector

16 CareView_1800RV2 15 17’’×17’’ , Static, fixed flat panel detector

17 CareView_1800PRV2 16 14’’×17’’, Static, portable flat panel detector

18 CareView_750Cw 17 Static, portable flat panel detector

19 CareView_750C 21 Static, cassette-size flat panel detector

20 CareView_1800Cw 22 Static, portable flat panel detector

21 CareView_1500S 23 Static, portable flat panel detector

22 CareView_750S 24 Static, portable flat panel detector

5. TempStatus

enum TempStatus

Define every value of the overhot_flag item in Temperature


Index Member Enum Value Description

www.careray.com
19
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1 IN_NORMAL_TEMP 0 In normal work temperature range (green)

2 IN_WARN_TEMP 1 In warning temperature range (yellow)

In standby state temperature range (greater than


3 OVER_MAX_TEMP_LIMIT 2
upper warning temperature, red)

In standby state temperature range (less than


4 OVER_MIN_TEMP_LIMIT 3
lower warning temperature, red)

5 INVAILD_TEMP 4 Invalid temperature range (orange)

6. EventId

enum EventId

Define work state value at software sync mode


Index Member Enum Value Description

1 EVT_DISCONNECT 0 Detector disconnected

2 EVT_READY 1 Detector has entered ready state

3 EVT_EXP_EN 2 Notify generator to exposure

4 EVT_IMAGE_ARRIVE 3 Image has arrived

5 EVT_EXPOSE_FLAG_TRUE 4 Reserved

6 EVT_EXPOSE_FLAG_FALSE 5 Reserved

……
19 EVT_TEMPERATURE_SLOT_MISSING 18 Temperature slot absence
20 EVT_TEMPERATURE_SLOT_TRAIN_START 19 One temperature slot train starts
One temperature slot train
21 EVT_TEMPERATURE_SLOT_TRAIN_FINISH 20
successfully finished
22 EVT_TEMPERATURE_SLOT_TRAIN_ABORT 21 One temperature slot train aborted

7. TemperatureSlotStatus

enum TemperatureSlotStatus

Temperature slot status


Index Member Enum Value Description

www.careray.com
20
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1 TEMP_SLOT_EXIST 0 Temperature slot existed

2 TEMP_SLOT_ABSENCE 1 Temperature slot absence

2.4 Configuration files

In the ".../CareRay" folder, there are "Config.ini" file, "conf" folder and "logs" folder.

 Config.ini: It contains some important detector configuration and protocol parameters. It is used by

API functions.

 conf: "cfg.properties" file in this folder also contains some detector configuration and calibration

parameters. CAL, CarerayImageNDT and API need to read this file and get some value.

 logs: It saves the running log of API.

2.4.1 Config.ini
Following lists some common used data:

Item Description
ipAddress Default IP address of detector, if there is only one detector in DR system
IP address of the second detector. User should remove the semicolon before
ipAddress1 the item to enable this parameter when the system needs to apply dual
panels
Pixel number need to be cut off at vertical edges of the image (default as 4
vertical_cutoff
for each vertical edge. API will set the gray level value of these pixels as 0)
Pixel number need to be cut off at horizontal edges of the image (default as
horizontal_cutoff 4 for each horizontal edge. API will set the gray level value of these pixels
as 0)

realtime_offset Real time offset correction option (default as 0, disable the option)

Time interval of getting a real time offset image. If the time exceeds the
realtime_offset_interval time interval, detector will get a real time offset image before acquiring

Rad image

Temperature interval of getting a real time offset image. If temperature


realtime_offset_temperature
exceeds the threshold, detector will get a real time offset image before
www.careray.com
21
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

acquiring Rad image


Reconnect-matic feature configuration item (0: disable, 1: enable), default
resumeConnectEnableFlag
as 1
Resume transfer feature configuration item (0: disable, 1: enable), default
resumeTransferEnableFlag
as 0
filter Grid suppression feature (0: never; 1: forever suppress; 2: auto suppress)

2.4.2 cfg.properties
The following table lists some common used data:

Item Description

ofstNumEachTime Number of dark image aquired during Offset Calibration procedure

linearDoseNum Number of dose settings during Gain Calibration procedure

linearNumPerDose Number of Rad image per dose setting during Gain Calibration procedure

Time interval between two images acquisition during Offset and Gain

cal_time_interval Calibration procedure.

Unit: ms.

The path where Calibration files save. If such path is not created, the
base_dir
default path is under the application directory.

Recommended kV value used for image Calibration. It is 70kV for most

app_kv_normal detector types, and it is 30kV for Mammo detector.

Unit: kV.

The types of calibration files, such as table, wall, and son on. If it is need to

change the calibration files, user can enable the corresponding item. If

cal_type using CarerayImageNDT or CareView CAL software to do image

calibration, API will generate calibration files in corresponding calibration

type.

Real time offset correction option. Default value as 0, disable this function.
enableRealTimeOffset
It mainly uses in AED Sync Mode.

Type selection of Auto Sync Mode. Default value as 0, which means


AEDSyncType
SCAN_SYNC. User can also set it to 1, which means AUTO_SYNC.

www.careray.com
22
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

2.5 Error codes

The return value CR_NO_ERR(0) means the function is called successfully. Mostly the return value with

nonzero means that the function is called failed. The error value shows specified error type. The error codes and

their descriptions can be found in errors.h file.

2.5.1 API error codes

Err NO. Error string (API) Description Reason

Unable to connect detector.


Possible causes include, but
not limited to, employment
1000 Connect detector failed
of incompatible SDK
versions, wrong IP settings,
network issue
Unable to disconnect
1001 Disconnect detector failed
detector
Warning: job aborted,
1002 Detector had connected
detector already connected
Warning: job aborted,
1003 detector already Detector had disconnected
Network socket error, the connection
disconnected
is blocked, IP set error, or application
1004 Error reconnecting socket Re connect socket failed
version error
1005 Error closing socket Close socket failed

1006 Error initiating Winsock Initialize winsock failed

1007 Error creating socket Create socket failed

1008 Error getting socket options Get socket attribute failed

1009 Error setting socket options Set socket attribute failed

1010 Error sending data Send data failed

1011 Error receiving data Received data failed

1012 Detector disconnected Connection had

www.careray.com
23
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

while receiving data disconnected when

receive data
Mismatched versions
1013 Set version failed
between detector and SDK
1014 Wrong command ID Command ID error -
Wrong version. This error
1015 will be obsoleted in a future Version error -
release
Wrong parameter in a
1016 command package sent Parameter error -
from API to detector
A NULL pointer must not
1017 Buffer is null Software allocate memory failed
be passed to a function
Read configuration files failed, the

1018 Error reading configure file Read configuration failed file may had error or the file is not

match with API version

Modify configuration Modify configuration file in CareRay


1019 Error writing configure file
failed folder failed

Parameters passed by user


1020 Wrong user parameter Passed the wrong parameters
is invalid
Unspecified check mode.
Select the check mode as
one of
1021 User had not select mode User had not select mode
RAD|BINNING|PREVIEW|
FLUOROSCOPY (for
future version)
Dll files and CareRay folder are not

1022 Error loading DLL files Load dll failed in the same directorydirectory or lack

of dll files.

1023 Error freeing DLL files Free dll failed -

1024 Error creating an event Create event failed -

1025 Error terminating an event Close event faile -

1026 Mismatched function ID Function ID is not match -

www.careray.com
24
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

sent to the detector and


replied back from it

Error getting function Get function’s address


1027 -
address failed

Error creating a thread for Create image acquisition


1028 -
image acquisition thread failed

Error creating a real-time Create real time thread


1029 -
thread failed

Error creating a heartbeat Create heart beat thread


1030 -
thread failed

Error creating a thread for Create dark image


1031 -
offset image acquisition acquisition thread failed

Error creating a thread for Create calibration thread


1032 -
image calibration failed
Error creating a logger
1033 Create log thread failed -
thread
1034 Error terminating a thread Close thread failed -

1035 Error allocating memory Allocate memory failed Program allocate memory failed

Warning: job aborted,


1036 Video thread is running Program is getting image
image acquisition in process
Many reasons, such as network

1037 Error acquiring an image Get image failed connection in abnormal state, or

program version error


Chinese characters Found in Software is not under the English
1038 path. Path must not contain File path error
Chinese characters directory
No calibration file found in There are no calibration files, need to
1039 the specified path, or wrong Open specified file failed
path calibrate detector

1040 Error reading a file Read file failed -

1041 Error writing a file Write file failed -

www.careray.com
25
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Error exchanging files with Exchange file with


1042 -
detector detector failed
Warning: job aborted,
1043 fluoroscopic image Grabbing image is running -
acquisition in process
Warning: job aborted,
1044 fluoroscopic image Grab had been stopped -
acquisition stopped
Warning: job aborted,
1045 fluoroscopic image Recording is in process -
recording in process
Warning: job aborted,
1046 fluoroscopic image Had stopped recording -
recording stopped
1047 Index out of boundary Index is out of boundary -
Error acquiring
1048 Grab image failed -
fluoroscopic images
Error recording
1049 Record image failed -
fluoroscopic images
Error receiving image
1050 Receive image failed -
header
Unspecified check mode.
Select the check mode as
one of Detector doesn’t support the select
1051 Mode is not match
RAD|BINNING|PREVIEW| mode
FLUOROSCOPY (for
future version)

Unspecified fluoroscopy Fluoro mode parameter


1052 -
mode had not been set
Warning: job aborted,
1053 Calibration is in progress -
calibration in process
Warning: job aborted, the Offset image thread is
1054 thread for offset image -
acquisition in process running
Warning: job aborted, the
thread for offset image Offset acquisition thread
1055 acquisition stopped. This -
warning will be obsoleted had been stopped
in a future release
www.careray.com
26
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Error: calibration process Calibration had been


1056 -
interrupted interrupted
String or array must not be
1057 Empty string or array -
empty
Unspecified gain image. Gain image is not
1058 This error will be obsoleted -
in a future release specified

1059 No machine ID There is no machine id There is no machine ID in detector


Unqualified mean value of
the image. This error will Image mean value is out
1060 -
be obsoleted in a future of standard
release

Unqualified standard Image std is out of


1061 -
deviation of the image standard

Unqualified image Image uniform is out of


1062 -
uniformity standard

Unqualified mean values of Image strip mean is out of


1063 -
the image strips standard
Unqualified row correlated
1064 RCN is out of standard -
noise (RCN) of the image
Image linear is out of
1065 Unqualified image linearity -
standard
Unqualified mean value of
the image. This error will Image gray mean is out of
1066 -
be obsoleted in a future standard
release
Unsynchronized detector. Error exist in
1067 This error will be obsoleted Check the sync problem
in a future release synchronization
Part of the detector panel
does not receive X-ray.
Make sure the tube, the Collimator alignment should be
1068 collimator, and the detector Collimator error
are properly aligned, and adjusted
the generated X-ray
illuminates the entire panel

www.careray.com
27
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1069 Tube misaligned Tube error Tube alignment should be adjusted


Offset calibration requires Offset calibration image Offset calibration image number
1070 more than 2 (inclusive)
offset images number error should bigger than 1
Gain calibration requires a
minimum number of 5 Gain calibration image Dose number in gain calibration
1071 (inclusive) different doses
and a maximum number of number error should between 5 and 9
9 (inclusive)
Gain calibration requires
acquiring more than 2 Gain calibration image Exposure number per dose should be
1072
(inclusive) images at each number error bigger than 1
dose
Wrong string for setting
1073 Portable KV string error Format error
portable KV
Information of the bad
pixels does not pair with the Machine id error when Machine ID error when adding bad
1074
detector. Bad pixels are not adding bad pixels pixels
obtained from this detector
A newer calibration file on
detector must not be Files time in console is
1075 Calibration files in detector is newer
overwritten with an older older than the detector
version

Calibration file does not Machine ID is not match The file is not generated by current
1076
pair with the detector when exchange files detector

No calibration files exist on There are no calibration files in


PC or detector. Calibrate There are no calibration in
1077 console, and the file download from
the detector to obtain the detector
calibration files detector is also failed
Error creating AEC acquire Create AEC acquisition
1078
thread thread faied
One key fit result One key fit result
1079
unacceptable unacceptable
Error creating monitor Create state monitor
1080
thread thread failed
Error creating clear image Create clear images thread
1081
thread failed
Auto Sync input dark image Input offset image error
1082
error for Auto sync mode

www.careray.com
28
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Auto Sync input images Input images sequence


1083
sequence error error for Auto sync mode
Auto Sync input images Auto Sync input images
1084 error, can't find reasonable error, can't find reasonable
band indexes band indexes
Auto Sync boundary Auto Sync boundary
indexes error, can't find indexes error, can't find
1085
reasonable boundary reasonable boundary
indexes indexes
The order to do polyfit The order to do polyfit
1086
should not bigger than 6 should not bigger than 6
The intensity of X-ray The intensity of X-ray
1087 received by detector is not received by detector is not
uniform enough uniform enough
The image SNR of 1key The image SNR of 1key
calibration is low! Please calibration is low! Please
check: 1.if something on the check: 1.if something on
1088
detector; 2.The shutter the detector; 2.The shutter
shadow; 3.The uniformity shadow; 3.The uniformity
of exposure of exposure
Cannot find an average dark
/ offset image that
corresponds to the exposure
time currently employed. In
order to improve the quality
of the resulting RAD image,
it is highly recommended to
walk through the calibration
process to obtain an average
1089
dark / offset image with
current exposure time. If
you decide to skip the
calibration step, the average
dark / offset image with the
default 500 ms exposure
time will be used instead,
and the image quality is
expected to be degraded
The effect of calibration is
1090
excellent
The effect of calibration is
1091
good
www.careray.com
29
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

The effect of calibration is


not good enough, it is
1092 recommended to do the
calibration again with the
condition suggested
Fail to load calibration file
generated by one shot
calibration. It's strongly
1093
recommended to perform
one shot calibration before
acquisition.
The image was false
1094
triggered and useless

2.5.2 Firmware error codes

Err NO. Error String (Firmware) Description Reason

0 No error No error -
1 load device driver failed load device driver failed
open detector file open detector file descriptor
2
descriptor failed failed
map detector
3 map detector memory failed
memory failed
allocate detector memory allocate detector memory
4
failed failed
No enough space on SD
5 No enough space on SD card
card -
6 No enough Space on Flash No enough Space on Flash
File name is invalid, failed File name is invalid, failed to
7
to exchange exchange
File path is Invalid, failed File path is Invalid, failed to
8
to exchange exchange
9 File read error File read error
10 file write error file write error
11 Bad XML file Bad XML file

Command cannot be Command cannot be


12
recognized recognized

www.careray.com
30
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

13 Unknown software version Unknown software version -


Incorrect number of Incorrect number of
14 -
parameters parameters
Send frame error,
Send frame error,
15 transmission pipeline -
transmission pipeline closed
closed
Execution Logic of API Execution Logic of API goes
16 -
goes wrong wrong
17 Have no select mode Have no select mode -
Setting detector version Setting detector version
18 -
failed failed
19 Undefined command ID Undefined command ID -
20 Undefined mode Undefined mode -
21 Hand Switch in error state Hand Switch in error state -
22 setting detector time failed setting detector time failed -
23 access FPGA register failed access FPGA register failed -
24 update file failed update file failed -
25 Invalid parameter Invalid parameter -
Forbid to change mode at Forbid to change mode at
26 -
current transfer state current transfer state
Forbid this operation at Forbid this operation at
27 -
current mode current mode
Invalid license, Please Invalid license, Please
28 contact this detector contact this detector -
manufacturer manufacturer
Error happens in the Error happens in the self-test
29 -
self-test phase phase
30 ioctl calling failed ioctl calling failed -
31 frame stability test failed frame stability test failed -
32 Exchange config files error Exchange config files error -
33 Offset is unavailable Offset is unavailable -
34 Create thread failed Create thread failed -
Error happens during
35 Error happens during readout -
readout
Function is not supported at Function is not supported at
36 -
present present
get the corrective image's get the corrective image's
37 -
CRC32 error CRC32 error
38 software has expired software has expired -
39 have no fetchable frame have no fetchable frame -

www.careray.com
31
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

read frame number from read frame number from FE


40 -
FE is invalid is invalid
read frame attribution
41 read frame attribution failed -
failed
42 invalid acquisition option invalid acquisition option -
read-frame sequence is
43 read-frame sequence is empty -
empty
Current detector doesn't Current detector doesn't
44 -
support this sync mode support this sync mode
Current detector doesn't
Current detector doesn't
45 support this acquisition -
support this acquisition mode
mode
Real time Dark setting
46 Real time Dark setting error -
error
47 Undefined config file Undefined config file -
There are no files in detector,
Warning: Configure file not
48 Configure file not exist DROC needs to take this error as
exist
warning
49 Error to create file Error to create file -

50 CRC check error CRC check error -

51 Configure file already exist Configure file already exist -

52 Fail to open file Fail to open file -


Read the file attribution Read the file attribution
55 -
failed failed
56 The size of file is 0 bytes The size of file is 0 bytes -
The previous homonymous The previous homonymous
57 -
file can't be deleted file can't be deleted
For the network quality reason,
Image that transferred failed
last acquisition process failed, and
58 Unuploaded image exist last time exists in detector,
the detector saved the image, need
need to be resume transferred
to be resume transferred

3 API Function specifications

www.careray.com
32
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Config.ini is the configuration file for API, which is located in ".../CareRay" folder.Please do

! not change its path.

!
The dll files, "CareRay" folder, and all software application files *.exe should be located in the
same directory.

!
The path of CarerayImageNDT.exe file can’t contain Chinese characters.

3.1 Common Functions

3.1.1 CR_connect_detector()

Signature int CR_connect_detector (char* work_dir)

Load and initialize the DLL, and establish network connection with detector.
Description
It’s the first function called by customer’s application.

 work_dir
Params
Directory where Config.ini file locates . It’s a string with length less than 256 characters.

Zero , means the function call successful;

Nonzero, means the function call failed.


Return
If the function call failed , please confirm that the dll file directory does not have Chinese

characters, the network state is normal, and the IP address sets right at first.

www.careray.com
33
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

If call CR_connect_detector() failed, please confirm that:

1) Path contains the application should be English characters

! 2) Network connection between detector and PC should be normal (cable or WIFI)

3) IP, MAC address should be correct

3.1.2 CR_disconnect_detector()
Signature int CR_disconnect_detector ()

Free resources and disconnect the detector.


Description
It’s the last function called by customer application.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.3 CR_reset_detector()
Signature int CR_reset_detector (BOOL reboot)

Description Reset detector state or reboot detector to initial state.

 reboot
Params FALSE, set detector state to default value;
TRUE, reboot the detector.
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

!
After connecting successfully, reset the detector state by calling this function (set reboot to
FALSE). If reconnecting, this step can be skipped.

! No error returns in normal cases.

www.careray.com
34
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.4 CR_set_check_mode()
Signature int CR_set_check_mode (int mode_id)

Description Set check mode, such as Rad Mode, Preview Mode, Fluoro Mode, etc.

 mode_id
Params
check mode ID, see enum CheckMode in structures.h file provided by API

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function should be called after CR_reset_detector().

All supported check mode please see the table in section 4.2.5.

If current detector doesn’t support the selected check mode, or the image acquisition is in

! process while setting check mode, this function will return error.

3.1.5 CR_set_sync_mode()
Signature int CR_set_sync_mode (int sync_mode)

Description Set sync mode for detectors such as external, manual, software, AED sync mode.

 sync_mode
Params
sync mode ID, see enum type of SyncMode in structures.h in API_demo

Zero , means the function call successful;


Return
Nonzero, means the function call failed (if set AED sync mode, then return error 48, DROC

www.careray.com
35
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

needs to take it as warning that the acquired image may contain step).

All supported sync mode please see the table in section 4.2.5.

!
This function should be called after CR_set_check_mode().

If user does not select a sync mode,or selected sync mode does not match the check mode, this

! function will return error.

3.1.6 CR_set_cycle_time()
Signature int CR_set_cycle_time (int exp_time, int delay_time, int wait_time)

Set each phase time in an image acquisition period in certain sync mode;

Description The default values of the parameters are given in attached file 1 “Overall image acquisition

flow diagram”.

 exp_time

Integration time, , numbergreater than 0. Unit: millisecond.

 delay_time
Params
delay time, number greater than 0. Unit: millisecond.

 wait_time

wait time, number greater than 0. Unit: millisecond.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
36
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

The default sycle time settings please see details of the table in section 4.2.5.

After calling CR_set_sync_mode() or changing the sync mode by other way, please call this

! function.

3.1.7 CR_set_normal_power()
Signature int CR_set_normal_power ()

Description Switch the detector to Full-Power work condition;

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

During image acquisition procedure, call this function before acquiring an image, otherwise the

! output image will be invalid.

The application of using the second gear to trigger the power change should not use this

function.

Don’t let detector stay in full-power work condition for a long time. Call the function

! CR_set_save_power() after image acquisition to reduce heat generation and save energy.

3.1.8 CR_set_save_power()
Signature int CR_set_save_power ()

Description Switch the detector to save power condition.

Params None

www.careray.com
37
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

If the parameter “fetchable” in structure exp_info turns to TRUE, user should call this function.

Developers should pay attention to this function to reduce system heat and improve system

stability.

The following strategy is suggested for DROC integration:


 Switch the detector to normal power work condition when DROC has selected a check mode;

 When quit the check mode, or there is no more position to be checked, switch the detector to save power

condition;
 Last more than 5 minutes in check mode, switch the detector to save power condition, and quit current
GUI;
 when enter the GUI with none-check mode, switch the detector to save power condition.

3.1.9 CR_permit_exposure()
Signature int CR_permit_exposure ()

Permit the detector to accept the X-ray exposure and start to acquire an image.
Description
This function is only used at External Sync Mode (EXT_SYNC).

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
38
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

This function is only used in External Sync Mode (EXT_SYNC). When the detector is already

! in WAIT_PERMISSION state, call this function to permit the detector to acquire an image.

3.1.10 CR_start_acq_full_image()
Signature int CR_start_acq_full_image ()

Description Tell the detector to prepare for acquiring a Rad Mode image.

Params None

Zero , means the function call successful;

Return Nonzero, means the function call failed.

If return 58, means the transfer failed image exists in detector need to be resume transferred.

3.1.11 CR_start_acq_prev_image()
Signature int CR_start_acq_prev_image ()

Description Tell the detector to prepare for acquiringa preview resolution image under Preview Mode.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.12 CR_start_acq_def_image()

Signature int CR_start_acq_def_image ()

Description Tell the detector to prepare for acquiringa user-defined resolution image (testing).

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
39
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.13 CR_stop_acq_frame()
Signature int CR_stop_acq_frame ()

Stop the image acquisition flow.


Description
This function is called to stop an image acquisition flow when the detector is already in it.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

If the detector is in ready state, the user can call this function to go back to initial state. Another

!
condition is that, When the DROC software is working in patient check page and the detector is

in ready state, but the user presses the stop button to quit, this function should be called.

3.1.14 CR_stop_acq_frame_cleanup()
Signature int CR_stop_acq_frame_cleanup ()

Description Stop the image acquisition flow, and clear up the DMA image buffer of the detector.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

If fail in getting an image from the detector buffer and the user choosing not to resend the image,

! this function should be called.

3.1.15 CR_set_user_correction()
Signature int CR_set_user_correction (UserCorrection* corr)

www.careray.com
40
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

This function is called to enable or disable the image correction procedure, or select the

proper image correction algorithms.


Description
Current image correction algorithms include fixed position correction, none-fixed position

correction and portable correction.

Params Set image correction options.

Zero , means the function call successful;

Return Nonzero, means the function call failed.

If return 1089, please refer to chapter 2.5.1

The acquired image will be corrected by relevant method after calling this method.

!
This function will work based on the existence of the calibration files, which are generated

! during image calibration procedure.

If this function called failed, the probable reason are: 1) The detector does not support the

!
correction option; 2) There are no calibration files: 3) User deletes the calibration files by

mistake.

3.1.16 CR_get_user_correction()
Signature int CR_get_user_correction (UserCorrection* corr)

Description Get image correction options set by user.

 corr

Params Current image correction option will be stored in structure corr if this function is called

successfully.

www.careray.com
41
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.17 CR_inpaint_bad_pixels()
Signature int CR_inpaint_bad_pixels (WORD* rad_img)

Inpaint the defects in an acquired image according to the bad pixels map generated in image
Description
calibration procedure.

 rad_img

Params A target image pointer which starts from the origin address of image buffer allocated by

user.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

After DROC removing the grid pattern, call this function to inpaint bad pixels existing in the

! image.

3.1.18 CR_set_dose()
Signature int CR_set_dose (int kv_num)

Description Load calibration file at specific kV value

 kv_num

Params kV value used for next exposure .

Mark: NA for CareView 1500R, 1800R, 500M.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
42
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

When using CareView 1500Rm or 1500P to get a Rad image, the reference gain image

specified at specific kV value should be loaded in advance;

! When solving the X-ray backscatter problem of some type of detectors, the gain correction

method needs to use the reference gain image at the actual set kV value.

When entering a new image acquisition procedure, user can obtain the kV value recommended

!
by DROC. The kV value must be set the same as next X-ray exposure used.

!
This function is not used for CareView 1500R, 1800R, 500M, 1800I.

3.1.19 CR_get_API_version()
Signature int CR_get_API_version (char* ver)

Description Get current API version information.

 ver
Params
version information. Size: 50 bytes.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.20 CR_get_conn_state()
Signature int CR_get_conn_state ()

Description Get current connection state with detector.

Params None

1, means connected;
Return
0, means disconnected.

www.careray.com
43
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

It will take about 20 seconds for API to find out that the connection is disconnected.

!
3.1.21 CR_get_detector_type()
Signature int CR_get_detector_type ()

Description Get detector type, which are defined in enum DetectorType.

Params None

Return The return value represents the detector type

!
Connect the detector before calling this function. The return value of this function gives the

detector type.

3.1.22 CR_get_detector_info()
Signature int CR_get_detector_info (DetectorInfo* detector_info)

Description Get system information of the detector.

Params See structure DetectorInfo

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.23 CR_get_mode_info()
Signature int CR_get_mode_info (int modeId, ModeInfo* mode_info)

www.careray.com
44
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Description Get the check mode information of image acquisition procedure.

Params See structure ModeInfo

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.24 CR_get_status_info()
Signature int CR_get_status_info (StatusInfo* status_info)

Description Get status information of the detector.

Params See structure StatusInfo

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.25 CR_get_image_attr()
Signature int CR_get_image_attr (FrameAttr* obj)

Description Get image information such as width, height, pixel depth, and so on

Params See structure FrameAttr

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

Call this function before calling get_image() when “fetchable” is TRUE, and aftercalling

! CR_start_acq_full_image() to get Rad Mode image.

3.1.26 CR_get_image()
Signature int CR_get_image (int image_size, BOOL with_head, void* image_ptr)

www.careray.com
45
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Read image from detector (Rad or dark image) to the buffer image_ptr. Image
Description
format is named *.raw. See the following form.

 image_size

image size, unit: byte

 with_head

Params TRUE: ouput image with head whose size is 65536 bytes;

FALSE: output image without head.

 image_ptr

buferr start address which allocated by user application software.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

User application software needs to convert the *.raw image format to DICOM which widely

! used in PACS and HIS.


Height

Image

Width
Figure 1 Raw image matrix

The *.raw image data received from detector is a one-dimensional array, sorted as follows:

Head Width Width Width ……

www.careray.com
Height
46 lines Pixel data
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Data sequentially arranged direction

Detector Type Check Mode Width Height Data Depth

CareView 1800R Rad Mode 2816 2816 16 bit

CareView 1800I Rad Mode 2816 2816 16 bit

CareView 1800L Rad Mode 2816 2816 16 bit

CareView 1800Cw Rad Mode 2816 2816 16 bit

CareView 1500C Rad Mode 2816 2304 16 bit

CareView 1500L Rad Mode 2816 2304 16 bit

CareView 1500Cw Rad Mode 2816 2304 16 bit

CareView 1500P Rad Mode 2816 2304 16 bit

CareView 1500R Rad Mode 2816 2304 16 bit

CareView 1500Rm Rad Mode 2816 2304 16 bit

Rad Mode 3072 2560 16 bit


CareView 500M
Preview Mode 96 80 16 bit

Bin Mode 1536 1280


CareView 500P 16 bit
Rad Mode 3072 2560

CareView 500M-s103 Rad Mode 2304 1920 16 bit

Rad Mode 4096 3072 16 bit


CareView 750M
Preview Mode 96 96 16 bit

CareView 750Cw Rad Mode 2048 2560 16 bit

CareView 750C Rad Mode 2048 2560 16 bit

CareView 1500S Rad Mode 2816 2304 16 bit

CareView 750S Rad Mode 2048 2560 16 bit

CareView 1800Le Rad Mode 3072 3072 16 bit

CareView 1800Cwe Rad Mode 3072 3072 16 bit

AnView D4343 Rad Mode 2816 2816 16 bit

www.careray.com
47
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.27 CR_query_prog_info()
Signature int CR_query_prog_info (int prog_type, ExpProgress* exp_prog)

Description Query the image acquisition state or image calibration state.

 prog_type

CR_RAD_PROG(0), stands for CR_RAD_PROG. Detector works in image acquisition

procedure;

Params CR_CAL_PROG(1), stands for CR_CAL_PROG. Detector works in image calibration

procedure.

 exp_prog

See structure ExpProgress.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.28 CR_select_cal_type()
Signature int CR_select_cal_type (char* name)

Description Select specified calibration files by user.

 name

Calibration type name, such as “default”, “table”, “wall”, “filter-1”, “filter-2”, et al. When
Params
calling CR_set_user_correction(), API will load these calibration files whose name contains one

of the strings above.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

!
This function should be called before CR_set_user_correction().

www.careray.com
48
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

The following callback function prototype and API interfaces (3.1.29-3.1.33) are used for Software Sync

Mode.

Signature typedef void (__stdcall*eventCallback)( int eventID, Event* eventData)

Description Callback function prototype, implemented by applcation

 eventID

Event ID, sent by API.


Params
 eventData

Data for event, sent by API.

Return None

The Event structure defined as follows:

struct Event

int width;

int height;

int bits;

void* data;

};

This function pointer should be transmitted to API, and API will transmit the specified event of

! detector to user application software. The event needs to be processed in time by user software.

3.1.29 CR_register_callback()
Signature int CR_register_callback (eventCallback)

Description Register callback function, and notify API of the callback function address

 eventCallback
Params
callback function pointer which needs to be registered

Return Zero , means the function call successful;

www.careray.com
49
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Nonzero, means the function call failed.

!
This function is only used for Software Sync Mode so far.

3.1.30 CR_send_exp_request()
Signature int CR_send_exp_request ()

Send exposure signal to detector, which equals pushing down the second gear of hand switch.
Description
User can call this API at any time when detector enters Ready state.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.31 CR_ready_state_request()
Signature int CR_ready_state_request ()

Description API request detector to enter ready state

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function should be executed after the generator is ready. Because the generator in ready

!
state equals pushing down the hand switch’s first gear in External Sync Mode, the detector

should also enter the ready state.

www.careray.com
50
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.32 CR_start_soft_acquisition()
Signature int CR_start_soft_acquisition ()

Description Start the Rad image acquisition flow in Software Sync Mode

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function will query the detector state, and transmit these status to user application software

! as event through callback function.

Detector sends the following three status to user application software in Software Sync Mode:

 READY: User can push down hand switch to start X-ray exposure;

 EXPOSE: Exposure enable status, user application software can control the generator to generate

X-ray;

 IMAGE_ARRIVE: Notify user application software that the image has arrived to console memory.

User can read out the image.

If user application software wants to exit Software Sync Mode, the function

! CR_stop_acq_frame() or CR_stop_acq_frame_cleanup() should be called.

3.1.33 CR_set_active_detector()
Signature int CR_set_active_detector (int detector_index)

Description Switch to the detector whose ID is detector_index.

Params  detector_index

www.careray.com
51
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

The index stands for a certain detector.

0, the first detector;

1, the second detector.

The IP addresses of the two detectors are set as 192.168.68.1 and 192.168.68.2.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

!
If this function returns error, the probably reason is that the network is in abnormal state.

If using dual-panel system, user should set MAC address and IP address differently for these

! two detectors to avoid application conflict.

3.1.34 CR_get_dual_detector_state()
Signature int CR_get_dual_detector_state (DetectorActiveState* das)

Description Get dual-panel state info, which saves in the structure das.

 das
Params
See structure DetectorActiveState

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

!
User should call this function at any time to get the dual-panel state.

www.careray.com
52
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

To support the dual-detector system, except calling this function, user should set MAC and IP

! address for the two detectors to avoid conflict.

Using the POWERS group, user can remotely log in the detector management GUI, set the first detector

IP address to 192.168.68.1, and the second detector IP address as 192.168.68.2, and allocate the two detectors

with different MAC addresses. For details, please ask CareRay's technical support engineers for help.

User should do initialization work such as selecting check mode and sync mode, setting

! correction option and so on after calling this function to switch to designated detector.

CareRay's dual-panel system solution is not restricted to the same type detector. Different

detector types can be used to form a dual-panel system.

3.1.35 CR_get_cal_params()
Signature int CR_get_cal_params (CalParams* cal)

Description Get parameters need for calibration, such as dose number

 Cal

gain_image_dir, directory saving gain images

portable_cal_kv, specified kV value to calibrate portable detectors


Params
normal_cal_kv, specified kV value to calibrate fixed detectors

ofst_cal_num, number of dark images acquired during offset calibration procedure

linear_dose_num, number of dose set for gain calibration procedure

www.careray.com
53
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

linear_num_per_dose, number of Rad images acquired per dose during gain calibration

procedure

time_interval, time interval between two images, unit: ms

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.36 CR_cal_offset()
Signature int CR_cal_offset (int modeID)

Execute offset calibration procedure for multiple integration time points at different sync
Description
modes according to the setting of DetectorConf.xml (located in “conf” folder of SDK package)

 modeID
Params
check mode ID

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function will establish a thread to get a series of offset images to calculate and obtain offset

! calibration files.

3.1.37 CR_execute_linear_cal()
Signature int CR_execute_linear_cal ()

Description Generate calibration files for fixed detectors after receiving all the images needed.

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
54
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

!
This function is only used for fixed detectors.

3.1.38 CR_execute_portable_cal()
Signature int CR_execute_portable_cal ()

Description Generate calibration files for portable detectors after receiving all images needed

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

!
This function is only used for portable detectors.

3.1.39 CR_stop_cal_procedure()
Signature int CR_stop_cal_procedure (int state)

Set a state for image calibration to notify the detector whether to exit the calibration procedure
Description
or not.

 state

Params TRUE: exit image calibration procedure;

FALSE: do not exit image calibration procedure.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

The following functions are out of date.

www.careray.com
55
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.40 CR_set_cal_thread()
Signature int CR_set_cal_thread (int state)

Set a state for image calibration to notify the detector whether to exit the calibration procedure
Description
or not.

 state

Params TRUE: exit image calibration procedure;

FALSE: do not exit image calibration procedure.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function is out of date, please use the function of CR_stop_cal_procedure() instead. but

! user can still use it for compatibility.

3.1.41 CR_switch_detector()
Signature int CR_switch_detector (int detector_index)

Description Switch to the detector whose ID is detector_index.

 detector_index

The index stands for a certain detector.

Params 0, the first detector;

1, the second detector.

The IP addresses of the two detectors are set as 192.168.68.1 and 192.168.68.2.

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
56
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

This function is out of date, please use the function of CR_set_active_detector() instead. But

! user can still use it for compatibility.

3.1.42 CR_get_active_detector_ID()
Signature int CR_get_active_detector_ID ()

Description Get currently active detector ID

Params None

-1, means no active detector;

Return 0, means the first detector, whose IP address is 192.168.68.1;

1, means the second detector, whose IP address is 192.168.68.2.

This function is out of date, please use the function of CR_get_dual_detector_state() instead.

! But user can still use it for compatibility.

3.1.43 CR_linear_calibration()
Signature int CR_linear_calibration ()

Description Generate calibration files for fixed detectors after receiving all images needed

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com

! 57
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

This function is out of date, please use the function of CR_execute_linear_cal() instead. But user can still use it for

compatibility.

3.1.44 CR_portable_calibration()
Signature int CR_portable_calibration ()

Description Generate calibration files for portable detectors after receiving all images needed

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

!
This function is out of date, use CR_execute_portable_cal() instead, but user can still use it.

3.1.45 CR_get_one_key_cal ()
Signature int CR_get_one_key_cal ()

Description Check if use one key calibration function

Params None

Zero, means the one key calibration function was disabled;


Return
Nonzero, means one key calibration function was enabled.

3.1.46 CR_check_img_for_factory_cal ()
Signature int CR_check_img_for_factory_cal (WORD* radImgNoHeader)
check whether the first rad image satisfied the requirements, such as mean value, uniform,
Description
center alignment.
www.careray.com
58
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

 radImgNoHeader
Params
rad image without image header acquired by exposure

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function only used for checking the first rad image meets the requirement when executing

! factory calibration (see API demo).

3.1.47 CR_download_factory_cal_files ()
Signature int CR_download_factory_cal_files ()

Description Download gain and defect files generated in factory calibration

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

This function only used for downloading gain and defect files generated in factory calibration, if

! call failed, user can’t do one key calibration (see API demo).

3.1.48 CR_execute_one_key_cal ()
int CR_execute_one_key_cal (WORD* imgData, WORD* darkImgData,
Signature
SurfaceFitResult* fitResult)

Description Calculate one key calibration files according to input rad and offset images

 imgData

rad image without image header acquired by exposure


Params
 darkImgData

offset image without header

www.careray.com
59
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

 fitResult

fitResult-> R2 return calibration socre

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.49 CR_set_AEC_integ_time ()
Signature int CR_set_AEC_integ_time (int prevIntegTime, int radIntegTime)

Description Set integration time for AEC

 prevIntegTime
integration time for preview image
Params
 radIntegTime
integration time for normal image
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.50 CR_register_AEC_callback ()
Signature int CR_register_AEC_callback (eventCallback)

Description Register callback function for AEC

Params See function prototype

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.51 CR_start_AEC_acquire_process ()
Signature int CR_start_AEC_acquire_process ()

Description Start image acquisition flow

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
60
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.52 CR_set_smart_hand_switch ()
Signature int CR_set_smart_hand_switch (SHSParam* param)

Description Set CareTouch 100 parameters

Params See SHSParam structure

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.53 CR_get_SHS_status ()
Signature int CR_get_SHS_status (SHSStatus* status)

Description Get CareTouch 100 status information

Params See SHSStatus structure

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.54 CR_get_unuploaded_img_info ()

Signature int CR_get_unuploaded_img_info ()

Description Get resume broken image information

Params See UnuploadedImgInfo structure

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.55 CR_start_acq_dark_full_image ()
Signature int CR_start_acq_dark_full_image ()
Start image acquisition workflow,
Description
Ready to acquire a dark image in full resolution
Params None

Return Zero , means the function call successful;

www.careray.com
61
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Nonzero, means the function call failed.


If return 58, means the transfer failed image exists in detector need to be resume transferred.

3.1.56 CR_set_offset_correction ()
Signature int CR_set_offset_correction (BOOL ofstCorr)

Description Specify whether to perform offset correction or not

 ofstCorr
Params TRUE: do offset correction
FALSE: skip offset correction
Zero , means the function call succeeded;

Return Nonzero, means the function call failed.

If return 1089, please refer to chapter 2.5.1

3.1.57 CR_start_acq_dark_prev ()
Signature int CR_start_acq_dark_prev ()

Description Ready to acquire preview resolution dark image


Params None
Zero , means the function call succeeded;
Return
Nonzero, means the function call failed.

3.1.58 CR_get_status_info_Ex()
Signature int CR_get_status_info _Ex(StatusInfo* status_info, int detectorID)

Description Get specified status information of the detector (used for dual panels case).

See structure StatusInfo


Params  detectorID
0: the first detector, 1: the second detector
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

www.careray.com
62
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.59 CR_get_wireless_info()
Signature int CR_get_wireless_ip(char* pWirelessIP)

Description Get wireless IP.

 pWirelessIP
Params
store the detector’s wireless IP
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.60 CR_set_wireless_info ()
Signature int CR_set_wireless_ip(char* pDstWirelessIP)

Description Set specified wireless IP

 pDstWirelessIP
Params
customized wireless IP
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

! Need to restart after calling this function.

3.1.61 CR_get_station_mode_conf()
Signature int CR_get_station_mode_conf(WirelessStationConf* pWsc)

Description Get station mode configurations

 pWsc
Params
store the station mode configuration

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

www.careray.com
63
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

3.1.62 CR_set_station_mode_conf()
Signature int CR_set_station_mode_conf(WirelessStationConf * pDstWsc)

Description Set specified station mode configurations

 pDstWsc
Params
customized station mode configurations
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

! Need to restart after calling this function.

3.1.63 CR_get_temperature_cal_data
Signature int CR_get_temperature_cal_data (TrainHead* pTrainHeader, int* pTempSlotNum)

Description Get temperature slot information

 pTrainHeader

Params Array type, store the temperature slot information, see TrainHead structure
 pTempSlotNum
Store the pTrainHeader’s length
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.64 CR_check_temperature_slot

Signature int CR_check_temperature_slot(int nExpTime, float fTemperature)

Description Check the temperature slot status

 nExpTime
Params Integration time of slot
 fTemperature

www.careray.com
64
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Temperature of slot

Zero , means the slot existed;


Return
1, means the slot absence.

3.1.65 CR_start_acq_NDT_dark_image
Signature int CR_start_acq_NDT_dark_image (int nFrameNum)

Description Start to acquire dark image of NDT_mode

 nFrameNum
Params
accumulated image number in detector
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.66 CR_execute_NDT_CAL
Signature int CR_execute_NDT_CAL (UINT* pRadImg, UINT* pDarkImg, int nPixelNum)

Description Generate calibration files of NDT_mode

 pRadImg
rad image
 pDarkImg
Params
dark image

 nPixelNum

the image’s pixel number

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.67 CR_correct_NDT_image
Signature int CR_correct_NDT_image (UINT* pRadImg, UINT* pDarkImg, int nPixelNum)

Description Correct image acquired in NDT_mode


www.careray.com
65
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

 pRadImg
rad image
 pDarkImg
Params
dark image

 nPixelNum
the image’s pixelnum
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.68 CR_set_NDT_frame_num
Signature int CR_set_NDT_frame_num (int nFrameNum)

Description Set the accumulated images number in detector for NDT_mode

 nFrameNum
Params
accumulated images number in detector
Zero , means the function call successful;
Return
Nonzero, means the function call failed.

3.1.69 CR_finish_NDT_acquisition
Signature int CR_finish_NDT_acquisition ()

Description This API make detector stop accumulating images in NDT_mode + manual sync mode

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

3.1.70 CR_check_NDT_CAL_Files
Signature int CR_check_NDT_CAL_Files ()

www.careray.com
66
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Description Check the calibration if exist in NDT_mode

Params None

Zero , means the function call successful;


Return
Nonzero, means the function call failed.

4 Image acquisition

4.1 Check mode

 Rad Mode: Static radiography mode;

 Preview Mode: Preview radiography mode, pixel value processed by 32×32 binning;

 Binning Mode: Binning radiography mode, pixel value processed by 2×2 binning;

 Fluoro Mode: Fluoro radiography mode.

4.2 Synchronization mode

Synchronization modes are defined as the coordination between the flat panel detector and the generator.

CareRay's series detectors support External, Manual, AED and Software Sync Mode.

4.2.1 External Sync Mdoe


External Sync Mode is a synchronization mode using a synchronization cable to transmit the

synchronization signal from detector to generator to trigger X-ray generation.

The detector state machine is defined as follows.

www.careray.com
67
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

EXP_INIT Fail in selftest EXP_ERR

Preserved

e
bl
na

le
am && ==e

ab
st
us

is
at
st

e
_
HS

Fr
et
G

EXP_ EXP_
t
eOu

READY COMPLETED
Tim
Ext_Rsq

EXP_
EXP_
EXPOSING
AWAITING

Ho CQ or
st
PC tor A erat
n
Pe tec Ge
rm De ray
it X-
EXP_ To
PERMITTED

Figure 2 State machine and exchange flow at external sync mode

Each state meaning:

 EXP_INIT, detector in initial state;

 EXP_ERR, detector cannot pass the self test and is in error state;

 EXP_READY, detector is in ready state, and waiting for external exposure request signal;

 EXP_AWAITING, the external exposure request has come to detector, and it is waiting for the

permission of console softrware;

 EXP_PERMITTED, exposure request has been permitted by console software;

 EXP_EXPOSING, detector in integration time procedure;

 EXP_COMPLETED, the X-ray exposure and detector integration time procedure have finished.
www.careray.com
68
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Detector time flow chart in External Sync Mode is as follows.

Generator Standby Boost / Preheat MA Servo Preheat Standby

Gen Prepare

Gen Ready

Gen Exp Enable

X-ray ON

Det Init

Det Ready

Exp Await

Exp Permit

Exposing

Exp Complete

Image Fetchable

Wait Delay Image


Detector Standby …… Integration Time …… Standby
Time Time Acquisition

~5ms ~500ms ~100ms ~400ms

Figure 3 Detector flow chart in External Sync Mode

For fixed-delay external synchronization (with firmware support), the internal between sending

the exposure request and receiving the enable exposure signal is fixed (the specific time interval

! is solidified in the detector). The interval of polling exposure state must be 50ms (see 4.3) in

software acquisition.

4.2.2 Manual Sync Mode


Manual Sync Mode is a synchronization mode requiring user to follow the inner detector state switch

and the red-yellow-green bar direction on GUI to complete the image acquisition.

The following diagram shows the time series how the detector state goes through (Notice that the marked
www.careray.com
69
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

time bellow is only used as an example).

Figure 4 Timing flow at manual sync mode

If the detector is ready to receive exposure request signal, it will go through

INTEGRATION/DELAY/READOUT phases periodically.

Application software should display the corresponding colors above properly to inform user. By adjusting

the reasonable delay time, user can push down hand switch to trigger an exposure event within any period of

integration time, then an intact Rad image can be acquired.

During the integration time, the exposure flag becomes TRUE which means the exposure

! request allowed. In other phases, the exposure flag is FALSE, then the exposure request is

forbidden.

Detector time flow chart in Manual Sync Mode is as following:

www.careray.com
70
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Generator Standby Boost / Preheat MA Servo Preheat Standby

Gen Prepare

Gen Ready

Gen Exp Enable

X-ray ON

Det Init

Exp Permit

Image Fetchable

Wait Delay Image


Detector Standby …… Integration Time …… Standby
Time Time Acquisition

~5ms ≤5s ~500ms ~400ms

Figure 5 Time flow chart in Manual Sync Mode

4.2.3 Software Sync Mode


Software Sync Mode is a synchronization mode by means of internet transmission to deliver the

synchronization control signal, which requires a reciprocal process.

Currently the fixed DR system uses External Sync Mode (using a sync cable to connect generator and

detector). But it is not convenient for portable and wireless use. The detector state switch according to the red

and green light bars in Manual Sync Mode for wireless detector is also not convenient for bedside DR system

application. The Software Sync Mode has the flexibility which the External Sync Mode and Manual Sync

Mode do not have and also keeps a good efficiency.

Software Sync Mode has good time efficiency which almost equals to the External Sync Mode in

performance. User should control the software response time delay while design the application software.

Software Sync Mode is realized using callback function. The detector time flow chart is as following:

www.careray.com
71
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Generator Standby Boost / Preheat MA Servo Preheat Standby

Gen Prepare

Gen Ready

Gen Exp Enable

X-ray ON

Det Init

Det Ready

Exp Enable

Image Arrive

Wait Delay Image


Detector Standby …… Integration Time …… Standby
Time Time Acquisition

~100ms ~500ms ~100ms ~400ms

Figure 6 Time flow chart in Software Sync Mode

Software work flow in Software Sync Mode is described as following:

www.careray.com
72
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

DROC API Detector

Software open and Power on and


initialize initialize

Call API to establish Establish network socket with Answer communication request
communication detector and feedback

Call API to reset detector Send reset command to detector Answer reset signal

Notify detector to set RAD


Select check mode as RAD Answer command
mode

Select sync mode as software Notify detector to set software Answer this command and
sync mode sync mode confirm control way

Call API to launch software Implement software sync work


sync work thread thread

Call API to request detector to Notify detector to enter to high Answer request to set detector
enter to Ready state consumption to high consumption state

Trigger callback to tell DROC Detector ready, send READY


to send exposure request state to console

Call API to send exposure


Notify detector request coming Answer request
request to detector

Trigger callback to tell DROC


Answer request
to control generator to expose

Control generator to expose

Detector wait to acq finish

Trigger callback to tell DROC


Feedback fetchable to console
to get image

Call API to get image Get image from detector Send image to console

Save image

Software sync work flow


finish

Figure 7 Work flow in Software Sync Mode

www.careray.com
73
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

API running flow is defined as following:

Register callback function CR_register_callback

Launch software sync work flow thread


CR_start_soft_acquisition

Generator enter Ready state

Request detector to enter to ready state


CR_ready_state_request

Software work flow query exposure state

READY == status ?

Ready state Y

Call callback function to notify DROC detector is in


ready state, display expose label (press hand switch)

Send exposure request to detector When detector


enters Ready
CR_send_exp_request state, user
can call this
API at any
Software work flow query exposure state time

EXPOSE == status ?

Expose state
Y

Call callback function to notify DROC detector is in


EXPOSE state, DROC should control exposure

Software work flow query exposure state

TRUE == fetchable ?

Y
Image_ready
state
Call callback function to notify DROC image arrives

CR_get_image

www.careray.com
74
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Figure 8 API flow in Software Sync Mode

4.2.4 AED Sync Mode


In AED Sync Mode, the detector can automatically detect X-ray without sync cable connection or

software sync signal. Essentially AED Sync Mode is also a kind of Auto Sync Mode, which is different from

Manual Sync Mode . User can push down hand switch at any time to get Rad image if the specified image

acquisition flow is running.

If user wants to use AED Sync Mode, it is needed to calibrate the detector at Manual Sync Mode, then

switch to AED Sync Mode to get corrected images. See details in API demo.

AEDSync Mode supports real time offset correction. User can control the detector to get another real

time offset image when acquiring the Rad image, and the offset image is used for offset correction. The details

is implemented in API.

CareRay detector does not support image calibration in AED Sync Mode. Be careful to set

! proper integration time for different types of detectors.

CareRay detector supports real time offset image correction in AED Sync Mode.

Detector time flow chart in AED Sync Mode is as following. Please pay attention to the difference

between Manual Sync Mode and AED Sync Mode.

www.careray.com
75
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Generator Standby Boost / Preheat MA Servo Preheat Standby

Gen Prepare

Gen Ready

Gen Exp Enable

X-ray ON

Det Init

Exp Permit

Image Fetchable

Delay Image
Detector Standby …… Integration Time …… Standby
Time Acquisition

~500ms ~100ms ~400ms

Figure 9 Time flow chart in AED Sync Mode

4.2.5 Sync mode and parameter setting for each type of detector
Following table lists the integration time (example) at different sync modes for each prototype of detector,

when developing the DROC, you should set the integration time, please set this as the API demo’s example.

DROC also can set different time according to the actual need, we recommend that user can modify the

integration time in DROC with flexibility, and the integration time varies from different sync modes.

When you use DROC to execute offset calibration (3.1.36 chapter) or CarerayImageNDT to calibate, the

time was set according to the DetectorConf.xml (located in “conf” folder of SDK package), so the DROC set

time should be the same as this, otherwise the corrected image quality may be not good.

Recommend Value
Detector Valid Work Valid Sync SDK
Integration Delay Wait Calibration
Type Mode ID Mode ID Version
Time Time Time
EXT_SYNC stable 500ms 100ms 5ms √
CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1800R MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 500ms 100ms 5ms ×
CareView MODE_RAD EXT_SYNC N/A N/A N/A N/A N/A
www.careray.com
76
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1800I SOFT_SYNC N/A N/A N/A N/A N/A


MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC stable 3s 100ms 5ms √
EXT_SYNC stable 500ms 100ms 5ms √
CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1800L MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 500ms 100ms 5ms ×
EXT_SYNC N/A N/A N/A N/A N/A
CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1500C MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC stable 500ms 100ms 5ms ×
EXT_SYNC stable 500ms 100ms 5ms √
SOFT_SYNC stable 1000ms 100ms 5ms ×
MODE_RAD
CareView MANUAL_SYNC stable 2500ms 100ms 5ms √
1500P AED_SYNC stable 500ms 100ms 5ms ×
MANUAL_SYNC stable 800ms 100ms 5ms √
MODE_NDT
AED_SYNC stable 800ms 100ms 5ms ×
MANUAL_SYNC stable 2500ms 100ms 5ms √
MODE_RAD
CareView AED_SYNC stable 500ms 100ms 5ms ×
1500PV2 MANUAL_SYNC stable 800ms 100ms 5ms √
MODE_NDT
AED_SYNC stable 800ms 100ms 5ms ×
EXT_SYNC stable 500ms 100ms 5ms √
CareView SOFT_SYNC N/A N/A N/A N/A N/A
MODE_RAD
1500R MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 500ms 100ms 5ms ×
EXT_SYNC stable 500ms 100ms 5ms √
CareView SOFT_SYNC N/A N/A N/A N/A N/A
MODE_RAD
1500Rm MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 500ms 100ms 5ms ×
EXT_SYNC stable 2500ms 100ms 5ms √
MODE_RAD
CareView SOFT_SYNC stable 2500ms 100ms 5ms ×
500M EXT_SYNC stable 500ms 100ms 5ms √
MODE_PREV
SOFT_SYNC stable 500ms 100ms 5ms ×
MODE_RA EXT_SYNC stable 2500ms 100ms 5ms √
CareView D SOFT_SYNC stable 2500ms 100ms 5ms ×
750M MODE_PRE EXT_SYNC stable 500ms 100ms 5ms √
V SOFT_SYNC stable 500ms 100ms 5ms ×
EXT_SYNC Testing 2500ms 100ms 5ms √
CareView MODE_RAD SOFT_SYNC N/A N/A N/A N/A N/A
500P MODE_BIN MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 2500ms 100ms 5ms ×
www.careray.com
77
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

EXT_SYNC stable 500ms 100ms 5ms √


CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1500L MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC testing 500ms 100ms 5ms ×
EXT_SYNC N/A N/A N/A N/A N/A
CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1500Cw MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC stable 500ms 100ms 5ms ×
EXT_SYNC N/A N/A N/A N/A N/A
CareView SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD
1800Cw MANUAL_SYNC stable 2500ms 100ms 5ms √
AED_SYNC stable 500ms 100ms 5ms ×
SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD MANUAL_SYNC stable 2500ms 100ms 5ms √
CareView
AED_SYNC stable 500ms 100ms 5ms ×
750Cw
MANUAL_SYNC stable 800ms 100ms 5ms √
MODE_NDT
AED_SYNC stable 800ms 100ms 5ms ×
EXT_SYNC stable 500ms 100ms 5ms √
CareView
MODE_RAD MANUAL_SYNC stable 2500ms 100ms 5ms √
750C
AED_SYNC stable 500ms 100ms 5ms ×
SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD MANUAL_SYNC stable 2500ms 100ms 5ms √
CareView
AED_SYNC stable 500ms 100ms 5ms ×
1500S
MANUAL_SYNC stable 800ms 100ms 5ms √
MODE_NDT
AED_SYNC stable 800ms 100ms 5ms ×
SOFT_SYNC stable 1000ms 100ms 5ms N/A
MODE_RAD MANUAL_SYNC stable 2500ms 100ms 5ms √
CareView
AED_SYNC stable 500ms 100ms 5ms ×
750S
MANUAL_SYNC stable 800ms 100ms 5ms √
MODE_NDT
AED_SYNC stable 800ms 100ms 5ms ×

4.3 Image acquisition

Steps of Rad image acquisition are:

(1) Call CR_connect_detector() to connect detector;

(2) Call CR_reset_detector(FALSE) to reset detector to default state (Initial state);

(3) Call CR_set_check_mode() to set detector work at Rad mode;

www.careray.com
78
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

(4) Call CR_set_sync_mode() to set sync mode;

(5) Call CR_set_cycle_time() to set cycle time for detector;

(6) Call CR_set_normal_power() to set full-power state;

(7) Cal CR_set_user_correction() to set image correction option;

(8) Call CR_start_acq_full_image() or CR_start_acq_prev_image() to notify detector to get a Rad or

Preview image.

(9) For External Sync Mode, call CR_query_prog_info() continuously to get current detector state in

time. When the detector is in READY state, hand switch can be pushed down to enable X-ray generation and

image acquisition. When detector state switching from READY to WAIT_PERMISSION, it indicates that the

detector has received the exposure request signal and is waiting for user’s exposure permission from PC. For

Automatic Sync Mode and Manual Sync Mode, when expose_flag acquired by calling CR_query_prog_info()

reaches 1, hand switch can be pressed to generate X-ray exposure. When expose_flag reaches 0, it indicates

that hand switch press is not allowed.

(10) For External Sync Mode, call CR_permit_exposure() to permit X-ray exposure.

(11) Call CR_query_prog_info() to monitor detector’s state, if it returns the parameter "fetchable" as

TRUE, user can read out the image from the detector.

(12) Call CR_set_save_power() to set detector to low-power state after image fetchable flag turns TRUE.

(13) Call CR_get_image_attr() to obtain image related attributes, and call CR_get_image() to get the

image. If reading out image failed, call CR_get_image() for another time to read out the previous image.

You can also call CR_stop_acq_frame_cleanup() to stop acquiring image and clean up the image buffer of

detector.

Currently, CareRay detector firmware can set integration time according to the select sync mode

! automatically. User can also call CR_set_cycle_time() to define the time.

www.careray.com
79
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

[Refer for DROC developer]

CR_connect_detector()

CR_reset_detector(FALSE)

CR_set_check_mode(ModeID);

CR_set_sync_mode(SyncID);

CR_set_userCorrection(&corr)

EXT_SYNC MANUAL_SYN AED_SYNC SOFT_SYNC EXT_SYNC AED_SYNC


ExpFlow at C ExpFlow at ExpFlow at ExpFlow at ExpFlow at ExpFlow at
MODE_RAD ODE_RAD MODE_RAD MODE_RAD MODE_PREV MODE_NDT

CR_disconnect_detector()

Figure 10 Image acquisition flow 1

www.careray.com
80
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

ExpFlow At MODE_RAD CR_rad_set_dose(kvValue) The following process will be


executed once “Rad acquisition”
[Refer for DROC developer] CR_set_normal_power()
button is pressed.

CR_start_acq_full_image()
EXT_SYNC
EXT_SYNC

CR_rad_query_prog_info(&expProgress) MANUAL_SYNC AED_SYNC


Sleep(50)
Sleep(50) Sleep(50)
expProgress.expStatus

 
==READY?
False
True
CR_rad_query_prog_info(&expProg) CR_rad_query_prog_info(&expProg)
CR_rad_query_prog_info(&expProgress)

Sleep(50)
Triggle HandSwitch If (expProg.exposable_flag==FALSE) If (expProg.exposable_flag==FALSE)
expProgress.expStatus == CR_set_indicator_color(RED) CR_set_indicator_color(RED)
CR_EXP_WAIT_PERMISSIONSecond Gear Else Else
False CR_set_indicator_color(GREEN) CR_set_indicator_color(GREEN)
True

CR_permit_exp()

expProgress.fetchable==TRUE expProgress.fetchable==TRUE
False False
CR_rad_query_prog_info(&expProgress)
Exposure In Progress True True

Sleep(50)

expProgress.fetchable==TRUE Triggle handswitch Triggle handswitch


False second gear while second gear after
LED is green LED turns green

True
CR_set_save_power()

CR_get_image_attr(struct *FrameAttr);
//alloc space
CR_get_image();
//correct

You could call the API “stop_acq_frame()”


to abort/exit the acquisition process
before handswitch has been pressed.

Figure 11 Image acquisition flow 2

4.4 Image calibration

4.4.1 Conventional calibration


This section elaborates the conventional calibration process when the feature of one-shot calibration is

turned off. One-shot calibration is turned off when the "oneKeyCalibration" property is set to 0 in

cfg.properties. Refer to 4.4.2 if "oneKeyCalibration" is set to 1. To do the image calibration, user should first

www.careray.com
81
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

to run the offset calibration procedure, then the gain calibration procedure.

Offset calibration procedure:

 Acquire a series of dark images (10~32 frames). Then generate the offset calibration files ( This will

be processed in API).

Gain calibration procedure:

 Acquire several Rad images at one dose point (The dose sets from low to high). The default setting

is using 5 dose points, and acquiring 3 Rad images per dose point. Then save the Rad images to

specified directory and call API to generate gain calibration files.

!
Calibrate detector at external or manual sync mode.

!
Do offset calibration before gain calibration.

Pay attention:

1)Do calibration when detector temperature stay in stable state;

! 2) Select proper SID, and adjust collimator’s FOV to maximum state.

3) Do gain calibration at 70kV, user can adjust it according need.

Recommend to calibrate detector after the power on last than 45 minutes to make sure the

temperature is in stable state.

Recommend to do calibration per 3-6 months to enjoy stable image performance.

See details in API demo. The following shows the image calibration flow:

www.careray.com
82
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Offset calibration

InitialDetector

CR_cal_offset

CR_query_prog_info(&prog)
Sleep(100)
No

TRUE == prog.calComplete

Yes

Offset calibration finished

Figure 12 Offset calibration flow

www.careray.com
83
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Gain calibration
InitialDetector

recvNum = 0

n = 0

Set specified dose to get


No target value of image

Rad acquisition process

No

Accept this image ?


No

Yes

n++
recvNum++
totalNum == recvNum ? Yes
linerNumPerDose == n ?

Portable detector ?
Yes CR_execute_portable_cal :
CR_execute_linear_cal

CR_query_prog_info(&prog)
Sleep(100)
No

TRUE == prog.calComplete

Yes

Gain Calibration finished

www.careray.com
84
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Figure 13 Gain calibration flow

4.4.2 One-shot calibration


One-shot calibration is a new feature shipped with SDK 4.5.0 and versions onward. It facilitates users to

walk through the otherwise time-consuming and tedious calibration process by acquiring only one RAD

image. To turn on this feature, set the "oneKeyCalibration" property to 1 in cfg.properties.

The conventional calibration has to be done by either a system integrator or Careray before performing

one-shot calibration. Note that although the conventional calibration mentioned in both 4.4.1 and this section

is composed of offset and gain calibration, there is a slight difference between them when performing gain

calibration. Specifically, in the context of one-shot calibration, the gain calibration works on a fixed dose

while that in 4.4.1 uses several different doses.

Offset calibration (step 1 of the conventional calibration):

 Do not start offset calibrate until the temperature inside the detector becomes stable. It normally takes a

powered-on detector more than 45 minutes to stay in an idle / stand-by state before the temperature

stabilizes. During the course of offset calibration, API acquires a series of dark images (10~32 frames),

and then, generates the offset calibration files. After the offset calibration finishes, user can proceed

with the gain calibration. The workflow of the offset calibration is shown in Figure 12. Refer to API

demo code for detailed information.

Gain calibration procedure (step 2 of the conventional calibration):

 User will be prompted to acquire several Rad images at a proper dose (once selected, it becomes

fixed) so that the mean grayscale value falls into the target range between 15,000 and 25,000 count.

All acquired Rad images will be saved in the specified directory, and API uses them, along with the

offset calibration files, to generate gain calibration and defect files. The workflow of the gain

calibration is shown below. Refer to API demo code for detailed information.

www.careray.com
85
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

In file cfg.properties, set


oneKeyCalibration as 1

Gain Calibration
InitialDetector

recvNum = 0

n = 0

Adjust tube, collimator,


No
sid ,kv,mAs recommended

Yes n == 0 No Rad acquisition process

CR_check_img_for_factory_cal No
(image)

No

n++
recvNum++
Result == CR_NO_ERR Yes
linerNumPerDose == n ?

Yes

Portable detector ?
CR_execute_portable_cal :
CR_execute_linear_cal

CR_query_prog_info(&prog)
Sleep(100)
No

TRUE == prog.calComplete

Yes

Gain Calibration finished

Figure 14 Gain calibration flow

www.careray.com
86
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

!
Calibrate a detector in external sync mode or manual sync mode.

Perform offset calibration before proceeding with gain calibration.

!
Attention:

1)Do not calibrate until the temperature inside the detector becomes stable;

2)Maximize both SID and collimator’s FOV for best calibration effects when performing

! conventional calibration;

3)Recommend 70kV for gain calibration, although it can be tuned to suit the needs of a given

application.

Recommend starting offset calibration after the temperature inside the detector becomes stable.

It normally takes a powered-on detector more than 45 minutes to stay in an idle / stand-by state

before the temperature stabilizes.

Recommend calibrating a detector once every 3-6 months for better imaging performance.

One-shot calibration

 Calibration files have been created after finishing up the conventional calibration process. Since the

spatial distribution of X-ray somehow contributes to the so-obtained gain file, a degraded SNR is

expected if this gain file is directly used in the field. One-shot calibration is developed to address this

issue. The workflow of the one-shot calibration is shown below. Refer to API demo code for detailed

information.

www.careray.com
87
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

In file cfg.properties, set


One-shot
oneKeyCalibration as 1
Calibration

InitialDetector

Result == CR_NO_ERR CR_download_factory_cal_files

No
Yes Offset acquisition process

Adjust tube, collimator,


Perform factory calibration
sid ,kv,mAs recommended

Rad acquisition process

No

CR_check_img_for_factory_cal

Result == CR_NO_ERR

Yes

CR_execute_one_key_cal

CR_query_prog_info(&prog)
Sleep(100)
No

TRUE == prog.calComplete

Yes

One Key
Calibration finished

Figure 15 Gain calibration flow

www.careray.com
88
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

!
Perform one-shot calibration in external sync mode or manual sync mode.

!
One-shot calibration cannot be performed unless the conventional calibration has been

completed beforehand.

Attention:

1)Do not calibrate until the temperature inside the detector becomes stable;

! 2)Use common SID and maximize collimator’s FOV for best calibration effects when

performing one-shot calibration;

3)Recommend 70kV for one-shot calibration, although it can be tuned to suit the needs of a

given application.

4)Use small focal spot.

4.5 Dual-panel application

CareRay dual-panel system solution contains one X-ray generator, tube, workstation with application

software, two detectors with different MAC address and IP address, one Gbps ethernet switchboard or two

ethernet network card instead, one sync box used to distribute control signals.

User can select different types of detectors to merge into a dual-panel DR system. The following figure is

the recommended connection model of dual-panel system.

www.careray.com
89
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Figure 16 Connection recommendation for dual-panel system

Wire connection between control panel and sync box is an optional selection, and wire connection

between workstation and sync box is also an optional selection. In this system, sync box used to send

exposure request signal Exp_Req(GEN_SYNC_P) to XPFD1 and XPFD2, and send exposure enable signal

Exp_En(DET_SYNC_P) from one detector to X-ray generator and control it to generate X-ray. If the

workstation has only one Gbps ethernet card, user needs to add a Gbps switchboard. But it is not

recommended to use switchboard. When using switchboard, user should connect the network cable from the

two detectors to the switchboard, and connect the cable from workstation to the switchboard. We recommend

to use two Gbps ethernet cards, and connect the cables from the two detectors to these two cards, then set the

local IP address for the two cards, such as 192.168.68.100 and 192.168.68.101.

The default IP address of single detector is 192.168.68.1. If using dual-panel system, it needs to change

one detector’s IP address and MAC address. The operations are as following:

Step 1, confirm the IP address of workstation. Connect the detector which needs to change the IP address

and MAC address. Open the network connection page, and set local IP address as 192.168.68.100, and subnet

mask as 255.255.255.0.

Step 2, Login the detector management GUI. Open the IE browser window. Input the entrance address

(http://192.168.68.1/cgi-bin/index.cgi) like red mask as following.


www.careray.com
90
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Figure 17 Detector management page login GUI

Press the Enter key to confirm, then a login dialog will popup. Input user name as "power", password as

"power". click the login button, and enter the remote control home page after verification.

Step 3, Set the Network. Click the "ADVANCED" button, then click "Network" on the left. The

following page will show:

Figure 18 Network Configuration page

Change the last two data "95:01" of MAC address to other data. Modify the last data "1" of IP address to

"2", then click save button, then reboot button to reset detector. The configuration will take effect.

www.careray.com
91
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Pre-work
Modify Config.ini to
Connect dual panels to
Modify one detector’s enable
dual network cards PC
IP/MAC address “ipAddress1”item and set IP from them

DROC API Detector

Software starts Power on and


and initialize initialize

Call API to establish Establish network Answer DROC request and


network connection connection with detetor feedback

Call API to switch to the


first detector

Initialize target detector


Switch to designated
detector

Send reset command to Answer command and reset


Call API to reset detector
detector detector
PROCESS

Notify detector set to


Select check mode Answer this mode
designated check mode

Select sync mode this Notify detector to set


Answer this sync mode
detector need to use designated sync mode

Call API to switch to the


PROCESS
second detector

Call API to switch to one of


these two detectors and
execute acquisition or
calibration progress

Figure 19 software work flow for dual-panel system

www.careray.com
92
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4.6 Detector monitor

4.6.1 Temperature flag


The temperature status indicates the inner temperature of the detector, . Three kinds of temperature range

of detector are defined: Normal work temperature range, warning temperature range, standby temperature

range.

OVER_MAX_TEMP_LIMIT
55
45 IN_WARN_TEMP_LIMIT

IN_NORMAL_TEMP

5 IN_WARN_TEMP_LIMIT

-5
OVER_MIN_TEMP_LIMIT

Figure 20 Temperature controlling


 In Normal working temperature range, DROC use green font to show current temperature value.

 In Warning temperature range, DROC use yellow font to show current temperature value.

 Greater than upper warning temperature, DROC use red to show current temperature value, forbid

exposure at the same time; if users press handle, the detector will not respond

 Less than lower warning temperature, DROC use red to show current temperature value, reminding

users to change environment temperature or wait detector warm-up. In this case, exposure request is

allowed to warn-up detector sooner..

It is recommended to acquire temperature status at 5-10 seconds intervals in DROC software. When

detector’s inner temperature gained by temperature sensors is greater than upper standby temperature,

detector will enter standby mode and will not respond to exposure request until detector inner

temperature fall back to normal temperature range.

Default temperature thresholds are shown as following table. Unit: ℃

Over-Running
Normal Temperature Warning Temperature Invalid Temperature
Temperature

www.careray.com
93
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

OVER_MAX_TEMP_LIMIT/
IN_NORMAL_TEMP IN_WARN_TEMP UNVALID_TEMP
OVER_MIN_TEMP_LIMIT

5~45 -5~5 or 45~55 >55 or <-5 <-120

The system should ensure the detector’s work temperature range to be among 5-45 ℃, and the

! temperature variation is very lowin most cases.

Recommendation: application software should read the detector’s current temperature value in a

certain period, such as reading per 10sec, and set reasonable temperature warning flag

according to detector’s work temperature range to notify user..

4.6.2 Battery Info


See details in structure BatteryInfo. The item "relative_state_of_charge" means the rest quantity of

electricity of battery. The type of "relative_state_of_charge" is float. If this value is 0.63, which means the

quantity of electricity is 63%. The bit6 of the item "battery_status" means discharge or charge state. Zero

means charge, while one means discharge.

It is recommended that if the item of "relative_state_of_charge" in structrure BatteryInfo is

larger than 40%, display the battery state as green; while 40%-20%, display as yellow; and

bellow 20%, display as red; bellow 10%, display as red and draw cross.

4.6.3 Wireless Info


See details in structure Wireless. The item "link_quality" means the WIFI signal quality, percentage"

means 0%-100%, "signal_level" means signal level, unit: dBm.

www.careray.com
94
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4.7 Reconnect and resume transfer

Chapter 2.4 describes the features configuration.

API will try to reconnect when the connection state between detector and PC was disconnected until the

connection established, and revert to the former status, the application needn’t to reconnect.

Detector will save the image which was not been transferred successfully due to the bad network quality.

If certain API returns error code 58, that means the transferred failed image exists in detector, user can decide

to if execute the resume process according to need (call CR_stop_acq_frame_cleanup() to cancel the resume

and the detector would delete the failed image inside), and see the resume process in API demo.

Following cases are related to image data resume transfer feature, and the developers should notice the

relationship when programming.

1. DROC queries the API to get the resume information to inform the user when DROC executes the normal

acquisition failed.

2. Every time open the software, after initializing the detector, if the detector has the resume image, API

notifies the DROC to inform the user to resume the image by callback function.

3. If user doesn’t close the software, and the API reconnects automatically, if the detector has the resume

image, API notifies the DROC to inform the user to resume the image by callback function.

www.careray.com
95
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Initialize

Unfinished image
exist ?

SetNormalPower
Y

StartGrab

QueryExpProgress

Fetchable == TRUE
exist ?

GetImage Y

Continue to get
Success ? N
image ?

Finished N

www.careray.com
96
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4.8 CareTouch 100

The CareTouch 100 is an accessory compatible with 1500Cw series detectors. The glove is equipped with

two LEDs, which, depending on its inner state, emit red, yellow, or green light. As shown in figure below,

LED1 indicates whether the detector is in the AED mode (the detector switches to high energy consumption

mode when activating AED, and stays in low energy consumption mode otherwise), while LED2 suggests

whether the glove is being touched or held by user.

The status of the CareTouch 100 can be monitored by checking the "connectToDetector" element within

the SHSStatus structure. This element takes a value ranging from 0 to 13 to enumerate 14 states as shown in

the table below. Figure 19 shows a set of 14 icons to indicate different states. DROC developers can readily

adopt and use these icons in the UI design, but they are also free to create their own icons.

CareTouch
index connect ? touch ? AED ? DT battery
battery
0 N - - - -
1 Y - - - -
2 Y Y N < 10% >= 10%
3 Y Y N < 10% < 10%
8 Y Y N >= 10% < 10%
10 Y Y N >= 10% >= 10%
11 Y Y Y - < 10%
13 Y Y Y - >= 10%

www.careray.com
97
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Figure 21 Different CareTouch 100 icons to indicate different states (refer to the original PDF file for colored
images).

4.9 FFAEC

FFAEC Full-Field Automatic Exposure Control

4.9.1 Application Scenarios

AEC requires back-to-back exposures within a very narrow time window. The first exposure is conducted in

extremely low dose for preview purposes. The resulting image is obtained after 32-by-32 binning and its SNR has

been compensated for. The exposure settings are determined by the software based on the body tissue of the

current interest and the patient positioning. The second exposure is for normal exposure whose settings are

automatically optimized based on the previously obtained preview image without any user intervention. The dose

should be appropriate and practicable to minimize the exposure of body tissues while the image quality is still

sufficiently maintained.

4.9.2 AEC Implementation and Usage Guide

API implements AEC by providing DROC with an interface that is based on a call-back mechanism. Once the

detector switches to a certain state, the registered callback function will be triggered so that DROC knows it is the

time to perform pre-defined actions as a proper response. Specifically, user needs to define an AEC call-back

function, say fcn, according to its prototype, and register it using CR_register_AEC_callback(fcn). Refer to

API_demo and subsection 4.4.3 for more details about detector and AEC initialization.

The single 750M image size is of 4096 * 3072, 24M, please notice that application should care the memory

www.careray.com
98
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

allocation and management, and API outputs images with 65536 bytes head in AEC flow.

Advice: If calibrate 750M detector failed because of memory allocation, you can use 4gb_patch add-in to

solve it (rebuild the exe file) for X64 Win7 OS, and the solution for 32 bit OS like follows:

1) Start -> Program -> attachment, right click the “Command prompt”, select “Run as administrator”

2) Input “bcdedit /set IncreaseUserVA 3072” (notice the backspace, no quotations), Enter

3) Restart the PC

Input “bcdedit /Deletevalue IncreaseUserVa”, Enter, then restart the PC if you want to recover the PC.

If user enabled the quros real time offset correction feature (Chapter 2.4.1), when initializing the detector

each time to launch the program, API will acquire the real time offset image automatically, and it cost about 30s,

in the time, the user’s acquisition operation will be responded till the real time offset image was acquired, after

that, user needn’t to wait. We recommend DROC can notify the user the condition.

www.careray.com
99
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4.9.3 AEC acquisition flow

www.careray.com
100
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

DROC API
Connect detector
Call 2 APIs to initialize detector
CR_connect_detector(char* work_dir)

Reset detector
CR_reset_detector(false)

Initialize expose time for the dual exposure progress


Call 4 APIs to initialize AEC
CR_set_aec_Integ_ime(prevIntegTime,radIntegTime)

Set Preview Mode


CR_set_check_mode(MODE_PREV)

Set software sync Mode


CR_set_sync_mode(SOFT_SYNC)
Set preview exposure parameters
(如SID KV mA ms mAs)

Set correction options


CR_set_user_correction(&corr)
Register callback function
CR_register_AEC_callback(aecEventCallback )

Launch AEC acquisition flow Enter AEC acquisition flow


CR_start_AEC_acquire_process()

Launch AEC acquisition thread

Check connection state

Notify DROC that detector is in False False


EVT_DISCONNECTED state. Exit AEC flow and Normal ? Jump loop, close thread, free memory, exit program
check the connection

True

Generator ready Send acq command


CR_set_normal_power()

Query detector state


CR_rad_query_prog_info(&expProgress)
Sleep(50)

False
expProgress.expStatus
==READY?

True

Send exposure request Trig callback, notify detector is in


CR_send_exp_request() EVT_AEC_PREV_MODE_READY

Set integ time for preview mode


CR_set_cycle_time(prevIntegTime)

Query detector state


CR_rad_query_prog_info(&expProgress)
Sleep(50)

False
expProgress.expStatus
==CR_EXP_EXPOSE?

True

Trig callback, notify detector is in exposure enable state


Let generator expose
EVT_EXP_EN, DROC should let generator expose

Query detector state


CR_rad_query_prog_info(&expProgress)
Sleep(50)
False
expProgress.fetchable
== TRUE ?

True

Get corrected preview image


CR_get_image()
Enter AEC flow again

Get preview image, calculate the best dose for the Trig callback, preview image arrived
second exposure according to the preview image (EVT_AEC_PREV_IMG_ARRIVE,Data)
End rad mode acquisition flow

Reset detector parameters Set Rad Mode


CR_set_check_mode(MODE_RAD)

Generator ready Set software sync mode


CR_set_sync_mode(SOFT_SYNC)

Set short integ time


CR_set_cycle_time(10)

Send acquisition command


CR_set_normal_power()

Query detector state


CR_rad_query_prog_info(&expProgress)

Sleep(50)

False
expProgress.expStatus
==READY?

True

Send exposure request Trig callback, notify detector is in ready state


CR_send_exp_request() EVT_AEC_RAD_MODE_READY

Set integ time for rad mode


CR_set_cycle_time(radIntegTime)

Query detector state


CR_rad_query_prog_info(&expProgress)
Sleep(50)

False
expProgress.expStatus
==CR_EXP_EXPOSE?

True

Trig callback, notify detector is in exposure enable state


Generator expose
EVT_EXP_EN, DROC should let generator expose

Query detector state


CR_rad_query_prog_info(&expProgress)
Sleep(50)

False

expProgress.fetchable
== TRUE ?

True
Get corrected rad image
CR_get_image()
Enter AEC flow
again
Trig callback, notify that rad image
Get rad image, post-process, display
arrived(EVT_AEC_RAD_IMG_ARRIVE,Data)

Set preview mode to make detector stable


CR_set_check_mode(MODE_PREVIEW)
Exit AEC flow

Set software sync mode


CR_set_sync_mode(SOFT_SYNC)
Enter AEC flow
again
Set integ time
CR_set_cycle_time(500)

www.careray.com API should jump of the loop, close thread, free


memory, exit program if DROC exits the AEC flow at
any time

101
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

4.10 Things you need to know about F2AED

 To prevent the detector from producing false-triggered images, do not hit or press the panel surface

abruptly. (False-triggered images are produced by a detector when it mistakenly detects an event of X-ray

exposure that actually does not happen.)

 When the detector produces a false-triggered image, it will take some time for it to switch back to "ready

for exposure" state for next exposure.

 During the course of image acquisition, the object should stay still. Make sure the detector remains in the

"ready for exposure" state before pressing the hand switch to emit X-ray.

 Minimal dimensions of the exposure window are 12 cm (along scan direction) by 2 cm (along readout

direction).

 Along the scan direction, the central 20 cm of the panel and the exposure window must have a minimal

12 cm overlap. Taking 1500Cw series detector as an example, the following figures show three different

positions of the exposure window of various sizes.

 To ensure the quality of the resulting RAD image, it is recommended to use a small exposure time (i.e.,

ms) - large current (i.e., A) combination for a target dose.

 If the resulting RAD image still presents a visible band, possible causes include, but are not limited to,

the following:

 The triggered line lays among the top 24 rows, or among the bottom 10 rows of the exposure

area;

 The grayscale value of the pixels around the triggered line is at the noise level. These pixels do

not carry information about the object of the current interest, and therefore, the band cannot be

corrected;

 The image does not present enough coherent information the algorithm could use to correct the

band effectively.

 Band too wide, exceeding 15 rows.

For detailed information, refer to the log file, or contact CareRay technical support professionals.

www.careray.com
102
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

(a)

(b)

(c)
www.careray.com
103
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

(a) AED will not work since the overlap is too short (6 cm);

(b) and (c) AED will work.

5 Image correction

5.1 Calibration files management and usage

5.1.1 Load calibration files


After calling CR_set_user_correction() to set correction option, API will load the calibration files from

harddisk to memory and apply the correction processing for the images.

!
Only when the calbration files exist, the iamge correction can be normally executed.

5.1.2 Switch calibration files


Currently, API generates a set of calibration files when calibrating the detector, and saves in

"D:\CareRayCalImgs\CXXXXXX" folder. ("CXXXXXX" please see real detector ID) This calibration file

path defined by the item "base_dir" in "…\CareRay\conf\cfg.properties" file. The "CXXXXXX" folder

includes another three folders, named OffsetImage, GainImage and DefectImage, where the default calibration

files locate in.

After calling CR_set_user_correction(), API will load the default calibration files to do image

! correction.

www.careray.com
104
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Each image calibration procedure will generate new calibration files and covere the old files. If user

wants to save several sets of calibration files, you can do as follows:

 The "…\CareRay\conf\cfg.properties" file lists some calibration parameters. Using Notepad software

to open "cfg.properties" file;

 Enable the item "cal_type". Its default setting is disabled. Please delete # symbol to enable it..

 After above operations, if setting "cal_type" equals to default, table, wall, filter-1, filter-2…, API

will generate such calibration files whose name includes the string “table” or others.

Only the image calibration of setting calibration type has been done, loading specified

! calibration files will succeed.

User can add some lists in appication software. Fill in the items according to cal_type (default, table, wall,

filter-1, filter-2...) and transmit the parameter value using CR_select_cal_type() function.

If selecting one of these items, call CR_select_cal_type(char* name), and then call

CR_set_user_correction(). If cal_type is disabled, or there is no other body position, it is no need to call

CR_select_cal_type(), or call this function by passing in “default” parameter.

5.1.3 Upload and download calibration files


Most of CareRay detectors support upload calibration files to detector and download calibration files

from detector. See details in CarerayImageNDT or CAL software user manual.

5.2 Image correction flow with grid

For CareRay detectors, when user uses low density grid while acquiring a Rad image, it is necessary to

correct the image using the following flow diagram:

www.careray.com
105
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Low Density grid High Density grid


Offset Offset
Correction Correction

Gain Gain
Correction Correction

Bad pixel&lines Bad pixel&lines


Correction Correction

Remove Grid-
Pattern

Bad pixel&lines
Correction

Figure 22 Image correction flow with grid

The bad pixels and bad lines removal algorithm integration flows when grid exists are as follows:

Low Density grid High Density grid

… …
CR_set_user_correction() CR_set_user_correction()

CR_start_acq_full_frame(); CR_start_acq_full_frame();
CR_get_image_attr(); CR_get_image_attr();
CR_get_image(); CR_get_image();

Remove grid pattern by


DROC CR_inpaint_bad_pixels()

CR_inpaint_bad_pixels()

Figure 23 Defection process flow

www.careray.com
106
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

When acquiring an image, user should remove the grid pattern at first, then call the API function to

inpaint bad pixels. Image enhancement and other work can be done by application software after that. Details

see API demo.

API has integrated the module of removing low density grid from API4.0.1 or late version. If user needs

to activate this module, please contact CareRay.

5.3 CareRay grid suppression module

Please see the configuration items about CareRay grid suppression in Chapter 2.4.1.

5.3.1 Grid spec


Density (L/cm):40.

Size:15" * 18" or 18" *18". Grid with the size of 15"*18" can be used on 1500 series only.

5.3.2 Grid detection and suppression


Minimum Tube Voltage (kV): 50

Minimum current x Time (mAs): 0.5

Collimator size:13cm*13cm

SID (m):1.0 ~ 1.6m

The direction of X-ray should be parallel to the direction of Grid. If the image is too dim to detect, please

rotate 90°.

Angle of Grid: ±5°

www.careray.com
107
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

Distance to Detector:< 10cm.

Lean Angle to Detector:< 15°.

5.3.3 Potential risk


After grid suppression, corrugated edges would be generated surrounding the image. We suggest users to

crop the image edges as Chapter 5.4.

If defected pixels and lines aren't removed before suppression, these defect area would be stretched. we

suggest users to perform defect corrections first.

5.4 Image edge process

There are blind and low sensitivity areas in detector borders. Blind areas are invalid for image acquisition,

user application software should discard these areas. The thin scintillator forms low sensitivity areas where its

www.careray.com
108
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

performance is not so good as the middle areas of an image, user application software can do some pixel

cutoff job in these areas.

The following diagram shows these two types of areas of a Rad image. Just for displaying clearly, the

scale of this diagram doesn’t match with the real condition.

Figure 24 Blind and low sensitive area

L1, L2, R1, R2 are the scan directions of flat panel, named the Height direction; U1, U2, D1,

! D2 are the read out directions of flat panel, named the Width direction.

Blind Area (pixels) Low Sensitive Area (pixels)


Detector Type
L1 R1 U1 D1 L2 R2 U2 D2
1800R 6 6 6 6 0 0 0 0
1800RV2 6 6 6 6 0 0 0 0
1800I 6 6 6 6 0 0 0 0
1800L 6 6 6 6 0 0 0 0
1800Cw 6 6 6 6 0 0 0 0
1500C 6 6 6 6 0 0 0 0
1500Cw 6 6 6 6 0 0 0 0
750Cw 6 6 6 6 0 0 0 0
750C 6 6 6 6 0 0 0 0
1500L 6 6 6 6 0 0 0 0
1500P 2 2 2 2 10 10 10 10
1500PV2 6 6 6 6 0 0 0 0
1500R 2 2 2 2 10 10 10 10

www.careray.com
109
Careray Digital Medical Technology Co., Ltd.
5F,Building B3, Biobay, 218 Xinghu Street, Suzhou,Jiangsu, China,215123
o+86 512 86860288 f+86 512 86860388

1500Rm 2 2 2 2 10 10 10 10
500M 0 0 0 0 4 4 0 0
750M 12 12 0 0 0 0 0 0
500P 0 0 0 0 3 3 0 0
1500S 6 6 6 6 0 0 0 0
750S 6 6 6 6 0 0 0 0
1800Le 2 2 2 2 0 0 0 0
1800Cwe 2 2 2 2 0 0 0 0
D4343 6 6 6 6 0 0 0 0

!
The detector’s performance is not influenced by the borders of an image.

Recommend user application software to cut off or add frame to the dummy areas, and cut off,

add frame, translucence, or gradually lower the pixel values for the low sensitivity areas.

Notice that the processing of borders is the last step of image acquisition flow. User shouldn’t

! do filtering or smoothing work after processing the borders.

www.careray.com
110

You might also like