We have noticed that some of the TRF has missing Field ID and Field Name inside the file. They can be easily identified as “Z .trf”. This happens randomly to all TRF generated. PyMedPhys stops when it encounters this problem.
May I suggest an easy workaround that PyMedPhys takes the information from the file name (user can append Field ID and Field Name to TRF filename) instead of editing the binary codes which may cause the file to corrupt.