**2.3 Patient privacy and data integrity**

MedBike system was designed to guarantee patient's privacy and data integrity. This is critical as MedBike runs on public networks. MedBike preserves patient's data

**Figure 6.**

*Clinician's display showing six patients in a session.*

**103**

**Figure 8.**

*MedBike secure networking.*

*MedBike: Virtual Reality for Remote Cardiac Rehabilitation*

privacy in two ways (see **Figure 8**). MedBike data are transmitted to a cloud-based data server, located in a secure location near the hospital, using a HTTPS encryption scheme. Using this scheme, the clinician and patient can exchange a new encryption key every session. The communication between MedBike and the cloud-based data server is hidden to port scanning using a virtual peripheral network (VPN). Once the encrypted connections are established with each patient, the clinician can then monitor them in full confidence. Because the clinician operates the system from within the hospital intranet, it is also possible to access the patient medical records in full security. Access to the patient medical records is critical to the rehabilitation process as it will allow the clinician to define specific exercise programs for each patient based on their physical condition. To validate data integrity, during a session, the clinician can observe the values of the bio-sensors and determine if they are in acceptable ranges. In addition, transmission errors of the data sent from patient to clinician can be detected using the integrity mechanisms built into the AES-GCM cipher used for encryption. As for the data integrity uploaded to the cloud-based server the system rely on the inherent validation process of the HTTPS services.

As part of our initial design, we had to guarantee that MedBike could operate on the average home networking environments (~5 Mbps). In MedBike most of this bandwidth is used by WebRTC at a video resolution of 640 × 480 pixels. Additional bandwidth is required to upload files to the cloud-based server every 2 min. The largest file is for the ECG data with a size of 500 kB per file (with an ECG sampling rate of 100 Hz). If one counts all data transfers, MedBike requires a total bandwidth

In this project, we have used Unity 3D version 5.3 game engine to display to the patient a virtual world composed of trees, terrains, roads, and avatars representing other patients. One can see in **Figure 5** a typical patient's display with the virtual

of 2.5 Mbps up/down which is well in the range of home networking.

**2.5 Virtual reality rendering using MedBike data**

world rendering and session information.

*DOI: http://dx.doi.org/10.5772/intechopen.85651*

**2.4 MedBike bandwidth requirement**

**Figure 7.** *Clinician's display focusing on one patient.*

*MedBike: Virtual Reality for Remote Cardiac Rehabilitation DOI: http://dx.doi.org/10.5772/intechopen.85651*

*Assistive and Rehabilitation Engineering*

grid;

• Full ECG data documentation:

○ Annotated ECG recording;

**2.3 Patient privacy and data integrity**

*Clinician's display showing six patients in a session.*

• Clinician session notes

○ A complete ECG recording of the session, viewable on a mm-calibrated

MedBike system was designed to guarantee patient's privacy and data integrity. This is critical as MedBike runs on public networks. MedBike preserves patient's data

**102**

**Figure 7.**

**Figure 6.**

*Clinician's display focusing on one patient.*

privacy in two ways (see **Figure 8**). MedBike data are transmitted to a cloud-based data server, located in a secure location near the hospital, using a HTTPS encryption scheme. Using this scheme, the clinician and patient can exchange a new encryption key every session. The communication between MedBike and the cloud-based data server is hidden to port scanning using a virtual peripheral network (VPN). Once the encrypted connections are established with each patient, the clinician can then monitor them in full confidence. Because the clinician operates the system from within the hospital intranet, it is also possible to access the patient medical records in full security. Access to the patient medical records is critical to the rehabilitation process as it will allow the clinician to define specific exercise programs for each patient based on their physical condition. To validate data integrity, during a session, the clinician can observe the values of the bio-sensors and determine if they are in acceptable ranges. In addition, transmission errors of the data sent from patient to clinician can be detected using the integrity mechanisms built into the AES-GCM cipher used for encryption. As for the data integrity uploaded to the cloud-based server the system rely on the inherent validation process of the HTTPS services.

### **2.4 MedBike bandwidth requirement**

As part of our initial design, we had to guarantee that MedBike could operate on the average home networking environments (~5 Mbps). In MedBike most of this bandwidth is used by WebRTC at a video resolution of 640 × 480 pixels. Additional bandwidth is required to upload files to the cloud-based server every 2 min. The largest file is for the ECG data with a size of 500 kB per file (with an ECG sampling rate of 100 Hz). If one counts all data transfers, MedBike requires a total bandwidth of 2.5 Mbps up/down which is well in the range of home networking.

#### **2.5 Virtual reality rendering using MedBike data**

In this project, we have used Unity 3D version 5.3 game engine to display to the patient a virtual world composed of trees, terrains, roads, and avatars representing other patients. One can see in **Figure 5** a typical patient's display with the virtual world rendering and session information.

**Figure 8.** *MedBike secure networking.*

To integrate the MedBike data (resistance, cadence, and steering) into the Unity 3D environment, we created new classes of objects that control the virtual camera in accordance to the avatar representing the patient.

Virtual Camera Update: By using bike speed and steering sensor measurements, one can change the new virtual camera position and direction to reflect the motion of the patient. The new position *<sup>p</sup>* → (*u*(*<sup>t</sup>* <sup>+</sup> <sup>∆</sup>*t*), *<sup>v</sup>*(*<sup>t</sup>* <sup>+</sup> <sup>∆</sup>*<sup>t</sup>*)) of the virtual camera is defined by:

 *p* <sup>→</sup>(*u*(*<sup>t</sup> <sup>+</sup>*∆*t*), *<sup>v</sup>*( *<sup>t</sup> <sup>+</sup>*∆*t*))= *<sup>t</sup>* <sup>→</sup>(*u*(*t*)+(*c*(*t*)∆*<sup>t</sup>* <sup>∙</sup> *du*(*t*)), *<sup>v</sup>*(*t*) <sup>+</sup> (*c*(*t*)∆*t* ∙ *dv*(*t*)) + *p* <sup>→</sup> (*u*(*t*), *<sup>v</sup>*(*t*)) (1)

where *<sup>p</sup>* → (*u*(*t*),*v*(*t*)) is the current position of the virtual camera relative to the digital terrain defined by a parametric surface *t* <sup>→</sup>(*u*,*v*) where (*u*, *v*) are the parametric coordinates of the surface. The variables *c*(*t*) is the bike speed as measured by the sensor and (*du*(*t*),*dv*(*t*)) is the change in direction as measured by the rotary encoder. The rotary encoder has a resolution 1440 data points per revolution, which allows for an accuracy of 0.25 degrees. The rotary encoder is connected to a high-speed Phidgets encoder interface board connects directly to the PC via USB. A Phidgets API is used to read data from the encoder. The encoder is coupled to the steering column to detect rotation. One can see in **Figure 9** a close look at the rotary encoder setup.

Computing resistance: To compute the resistance that the KICKR must apply to the bicycle back wheel, a complex haptic rendering algorithm must be used (see **Figure 10**). The algorithm is initialized with a target power specified by the clinician, the minimum allowable resistance, the speed as measured by the KICKR, the current power produced by the patient, and the back wheel circumference. The resistance applied to the bicycle back wheel is continually adjusted to help the rider achieve a target power output. This allows workloads to be specified in Watts instead of arbitrary resistance values.

The resistance applied is calculated as follows. If linear speed is ≤0.025 m/s the resistance is held at the minimum allowed resistance. Otherwise, the target resistance value (*R* target) is updated to the resistance value delayed by 1 second (*R* delayed) plus or minus a small increment depending on the different between the power reported by the trainer and the target power output. The current resistance value applied by the bike trainer is then linearly interpolated toward the target resistance by 5%.

**105**

**Figure 11.**

**Figure 10.**

*MedBike resistance controller algorithm.*

*Remote patient represented as an articulated avatar.*

*MedBike: Virtual Reality for Remote Cardiac Rehabilitation*

In addition to the audio-visual connection (using WebRTC) between the clinician and each patient, each patient can see the avatars of the other patients using the

*DOI: http://dx.doi.org/10.5772/intechopen.85651*

**2.6 Multiplayers capability**

**Figure 9.** *Rotary encoder setup.*
