Skip to content
Snippets Groups Projects
To learn more about this project, read the wiki.

Software instructions

This folder has two python scripts for automated mapping using COSI Measure. The first cosi_gui_testbed.py uses the original Beagle Bone Black hardware and software from Han et al. [1]. The other one, server_GUI.py, works under the server computer that prepares and sends the coordinates (e.g. the console with the m4i cards). An ethernet cable is needed between host (COSI Measure) and server (m4i computer).

The cosi_gui_testbed.py script has an individual homing option for each axis and each direction. If wanted, the buttons (x+, x- ,y+ ,y- ,z+ ,z-) can be used seperately. This has the advantage that the order of homing can be chosen, which is sometimes required if an object is within the homing area of COSI Measure to avoid collision with the probe.

The trigger of a measurement event is mitigated to the server and implemented in server_GUI.py.

The ethernet connection parameters are given in the script. A TCP/IP protocol is used for the ethernet communication. COSI Measures ethernet settings can be configured before the connection. For security, a button is placed into the Cosi_GUI application that is started on COSI Measure and labelled as ‘Connect external PC’. When it is clicked, Cosi_GUI is deactivated and awaits for the incoming connection and data. After the connection is established, COSI Measure waits for custom commands for the operation. Three keywords are “MOV”, “OK” and “CLOSECONN”.

The MOV command is for the movement to absolute coordinates. The command structure can be in these two forms: MOVXXXxxYYYyyZZZzz or MOVXXXYYYZZZ. The first one is for submillimeter precision is 2, first 3 digits are the coordinates in mm for xyz. The second one is in millimeter. Please pad with zeros. i.e. 58.23mm is 05823 or 058 for the host part. When the robot finishes its operation (i.e. moving to desired coordinate), it acknowledges the movement and sends back a “MOVOK” command to a host.

“CLOSECONN” terminates the connection. This reactivates the Cosi_GUI application on COSI Measure. If the connection is terminated unexpectedly, it can be killed using another terminal. Otherwise, the application must be restarted, which would require new calibration of the COSI Measure axes. To prevent this, please open another root terminal. Then please type:

netstat -tulnap  

Then, find the PID number of python program that has the IP number “192.168.101.253”. E.g., it is 2571/python :

Instructions1.

Type

gdb -p PORTNUMBER #(e.g., gdb -p 2571)
#This will attach to the process and open GDB server. Type:
call close() 
quit

If you see ($1=0). Then, it should be successfull.

Instructions2

“OK” command can be sent for a connection check. COSI Measure will respond with an “ok” message if the connection is established.

Server_GUI.py implements the mapping. Currently cartesian mapping is supported by the GUI, which follows a snake like path. For each position, it transmits a composite pulse and calculates a worst-case vector [2]. Next, a circularly polarized, orthogonal projection and worst case transmit pulses are sent and the corresponding files are saved into a Measurements1 folder. For each position the files are saved into a folder according to the measurement number. The means of each measurement are also displayed in the GUI. Currently, creating different measurement folders was not implemented. Therefore, please check if there is an empty Measurements1 folder in the directory. An arbitrary path file can also be used with the GUI. For this, a path file using the same structure from Han et al. [1] should be prepared and named as PathFile.txt. And the default coordinate values from the GUI must be kept the same.

Please note that there is no limitation about the numbers that you can enter to the GUI. Therefore, make sure that the coordinates are within the boundaries that COSI measure can approach. A coordinate that is outside of the physical coordinates may damage components. The physical dimensions of the measurement probe and device under test should also be considered. It is highly encouraged to determine the customized spatial boundaries of the mapping area before any operation with COSI Measure.

References

[1] H. Han, R. Moritz, E. Oberacker, H. Waiczies, T. Niendorf, and L. Winter, “Open Source 3D Multipurpose Measurement System with Submillimetre Fidelity and First Application in Magnetic Resonance,” Sci. Rep., vol. 7, no. 1, p. 13452, Dec. 2017, doi: 10.1038/s41598-017-13824-z.

[2] L. Winter et al., “Parallel transmission medical implant safety testbed: Real-time mitigation of RF induced tip heating using time-domain E-field sensors,” Magn. Reson. Med., vol. 84, no. 6, pp. 3468–3484, 2020, doi: https://doi.org/10.1002/mrm.28379.