*3.3. Synchronizing the Movements*

The rotation speed of the primary motor (Figure 5A), which is the operator of the horizontal movement, was fixed at a speed that depends on the respiratory frequency of the patient, so that a complete turn is made with the same duration as breathing is performed.

**Figure 5.** (**A**) Horizontal stepper motor; and (**B**) vertical stepper motor. See main text for details.

To reconstruct the hysteresis cycle, the second stepper motor (Figure 5B), which controls vertical displacement, continuously modifies the rotation speed throughout the cycle. This cycle is divided into six parts, which corresponds to a 60-degree turn of the motor. The average speed in the set of the six sections is equal to the other engine to achieve a synchronized movement and a complete turn in the same time. Therefore, the different speeds on this engine are time dependent.

The parametric variables that affects the Tip (simulated tumor) trajectory are shown in Figure 5. The simulated tumor trajectory can be adjusted in several ways:


$$h = 2 \cdot \left(\frac{d1 \cdot l}{d2}\right) \tag{1}$$

As a result of changing the distances, the output path is defined by Equations (2) and (3). These equations describes the Tip trajectory during the inhalation and exhalation.

$$\chi\_{\text{inhalc}} = \left( \left( \sqrt{\frac{h}{\left(2 \cdot r\right)^2}} \right) \cdot x \right)^2 \tag{2}$$

$$Y\_{\rm exhalle} = \left(-\left(\mathbf{x} - \left(\mathbf{2} \cdot r\right)\right)^2 + \left(\mathbf{2} \cdot r\right)^2\right) \cdot \sqrt{\frac{h}{\left(\mathbf{2} \cdot r\right)^2}}\tag{3}$$

#### *3.4. Path Verification*

To check the precision of the LTMS prototype, the movement was tracked (Figure 6A,B) by creating a tracking workflow with Bonsai software [27]. Bonsai is a visual programming language that allows a modular, high-performance, open-source visual programming framework for the acquisition and online processing of data streams. It permits real time data acquisition and processing among several interfaces.

**Figure 6.** (**A**) Setup for a wider tumor trajectory is shown. (**B**) Setup for higher tumor trajectory is shown. (**C**) All possible trajectories by modifying the *r* parameter are displayed. (**D**) Possible trajectories by modifying *d1* parameter are displayed.

A real-time data analysis was performed to constantly track the position in X and Y of the Tip, while the prototype is running the breathing cycle. In this Bonsai workflow, the camera input with the overlapped tracking were recorded, as well as the X and Y positions of the Tip plus a time-stamp.

This tracking is performed by transforming the acquired image from the camera to a Hue, Saturation, Value (HSV) image. A white sticker was attached to the Tip (sphere), which is shown in Figure 6A,B, and by means of establishing a HSV threshold it was possible to discriminate the sticker contours against the Tip (simulated tumor). Then, the largest binary region was found, which corresponded to the sticker, and the centroid of it was detected. These centroid coordinates correspond to the X and Y position of the simulated tumor.

The resulting curves of the prototype and program differ slightly from the desired hysteresis loop; even though the lower part matches well, the upper area deviates a maximum of 5 mm from the desired position, as shown in Figure 6A,B. Several tests were made with the system during 20 cycles. It deviates in the two first cycles until the synchronization process is done. After these two cycles the deviations were smaller than 1 mm in the higher setups and 4 mm in the wider setups. However, in future versions the above mentioned errors will be minimized by improving the mechanical design.

There are several combinations that could be set up with the prototype, and depending on which of the transmission components is used it is possible to achieve all of the combinations that are shown in Figure 6C,D.

The 3D Printed Lung Tumor Movement Simulator for radiotherapy quality assurance has been presented (Figure 7) to a group of expert radiation oncologists and medical physicists from the Instituto Valenciano de Oncología, Valencia, Spain.

**Figure 7.** (**A**) Virtual reconstruction of the location where the prototype should be placed to simulate the tumor path is shown; and (**B**) the real Lung Tumor Movement Simulator placed inside a LINAC.

#### **4. Discussion**

In the radiotherapy field, movement of tumors due to the respiratory cycle makes treatment difficult and, for this reason, an area of research has focused on treatment planning [5,6,11]. There are devices that can be used to guarantee the quality and quantity of received radiation doses, which are commonly named phantoms. In this way, in the most complex cases, doctors and radiologists will perform a priori tests that ensure maximum precision before the treatment.

Although there are existing commercial devices such as QUASAR (Modus Medical Devices Inc., London, ON, Canada), Respiratory Gating Platform (Standard Imaging Inc., Middleton, WI, USA) and Dynamic Thorax Phantom (CIRS Inc., Norfolk, VA, USA), these alternatives are closed source and difficult to customize. The creation of this prototype based on 3D printing and Open-Source is intended to serve as a basis for the expansion of these devices for research purposes.

The Respiratory Motion Phantom from QUASAR is a commercial device developed by Modus QA, which, in its latest version, reproduces in two dimensions the respiratory movement of patients for use in radiotherapy [28]. It is useful for testing treatments, the correction of these tests and the commissioning of the implementation of new systems. However, this device is a licensed product that cannot be customized, and it is not accessible for researchers. The aim of this project is to pave the way for researchers to improve the treatment simulations in a cost-effective way. In addition, it facilitates the creation of parametric components, which allow the simulated tumor path to be changed. One of the strongest skills of this prototype is that all of the mechanisms are 3D printed and they can be modified as the researcher desires.

#### **5. Conclusions**

This project began with the idea of creating an Open-Source prototype that would follow the hysteresis loop of the movement of a human lung during a respiration cycle to track the movement of a tumor. We present an Open-Source Lung Tumor movement simulator, which is 3D printed for each patient and for each treatment. This prototype is completely customizable, and it paves the way for researchers, radiologists and nuclear medicine physicians to improve the radiation therapy for quality assurance procedures and outcomes.

This Lung Tumor Movement Simulator is programmable with the amplitude and frequency specific to each treatment and patient. These data are obtained thanks to the images obtained by techniques such as the 4D-CT and are translated through the serial interface that connects the computer and the hardware (drivers, motors, etc.). In the prototype, there is the possibility of introducing a dosimetric film or an ionization chamber to measure the dose of radiation absorbed. Furthermore, the Lung Tumor Movement simulator is cost-effective, because it is almost entirely 3D printed and the electronic components, as well as the motors, are not expensive.

The results of building and testing the new lung movement prototype are very promising. It has been shown that it is possible to create a simple and cost-effective machine to simulate the movement of a tumor in the lungs based on additive manufacturing. The prototype is ready to be tested and there are plans to undertake customized radiotherapy verification and research in a radiotherapy machine. In addition, all the schematics, parts and firmware are available at dmoratal.webs.upv.es/research.

**Author Contributions:** Conceptualization, D.R.Q., V.G.-P. and D.M.; Data curation, D.R.Q. and V.G.-P.; Formal analysis, D.R.Q., D.S.-E., V.G.-P., J.R., E.S.-M. and D.M.; Funding acquisition, J.A.G.-M. and D.M.; Investigation, D.R.Q., V.G.-P., J.A.G.-M. and D.M.; Methodology, D.R.Q., J.R., E.S.-M., R.P.-F. and J.A.G.-M.; Project administration, J.A.G.-M., V.C. and D.M.; Resources, V.G.-P., R.P.-F., J.A.G.-M., V.C. and D.M.; Software, D.R.Q., D.S.-E., J.R., E.S.-M. and R.P.-F.; Supervision, J.A.G.-M., V.C. and D.M.; Validation, D.R.Q., V.G.-P., R.P.-F. and D.M.; Visualization, D.R.Q., D.S.-E. and R.P.-F.; Writing—original draft, D.R.Q. and D.S.-E.; and Writing—review and editing, V.G.-P., R.P.-F., J.A.G.-M., V.C. and D.M.

**Funding:** This work was supported in part by the Spanish Ministerio de Economía y Competitividad (MINECO) and FEDER funds under grants BFU2015-64380-C2-2-R (D.M.). D.R.Q. was supported by grant "Ayudas para la formación de personal investigador (FPI)" from the Vicerrectorado de Investigación, Innovación y Transferencia of the Universitat Politècnica de València.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**


© 2018 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
