Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a problem when convert my Elekta infinity logfiles to csv files #1822

Open
daliDuans opened this issue Feb 2, 2024 · 9 comments
Open

a problem when convert my Elekta infinity logfiles to csv files #1822

daliDuans opened this issue Feb 2, 2024 · 9 comments

Comments

@daliDuans
Copy link
Contributor

Dear SimonBiggs, I have a problem when convert my Elekta infinity logfiles to csv files. Could you help me solve my problem? Thank you very much! The bug reports and the trf file to be converted were attached as following,

bug reports:
Fig1

trf file:
24_01_27 11_41_01 Z AR_AR.zip

@SimonBiggs
Copy link
Member

Could you copy your error message in as text into this issue so that other's can find this via Google search?

@SimonBiggs
Copy link
Member

@mchamberland do you know if you might be in a position to help @daliDuans ?

@daliDuans
Copy link
Contributor Author

daliDuans commented Feb 4, 2024

yes, the error message was as following:

D:\log>pymedphys trf to-csv *.trf
{'34': 'State Code Unknown', '39': 'Move Only', '40': 'Pause', '41': 'Intersegment', '42': 'Radiation On', '43': 'Interupted', '44': 'Interupted Ready', '45': 'Terminated Checking', '46': 'Terminated Ok', '47': 'Terminated Fault'}
(array([2442], dtype=int64),)
[16]
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Scripts\pymedphys.exe\__main__.py", line 7, in <module>
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\cli\__init__.py", line 148, in pymedphys_cli
    args.func(args)
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\trf2csv.py", line 84, in trf2csv_cli
    trf2csv(filepath)
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\trf2csv.py", line 64, in trf2csv
    dataframes["header"], dataframes["table"] = trf2pandas(trf_filepath)
                                                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\trf2pandas.py", line 61, in trf2pandas
    table_dataframe = decode_trf_table(trf_table_contents, header_dataframe)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\table.py", line 37, in decode_trf_table
    table_dataframe = convert_data_table(
                      ^^^^^^^^^^^^^^^^^^^
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\table.py", line 230, in convert_data_table
    dataframe = convert_linac_state_codes(dataframe, linac_state_codes)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\table.py", line 129, in convert_linac_state_codes
    dataframe[key] = convert_numbers_to_string(name, linac_state_codes, dataframe[key])
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Users\44439\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymedphys\_trf\decode\table.py", line 115, in convert_numbers_to_string
    raise ValueError(
ValueError: The conversion lookup list for converting linac state is incomplete. The following data numbers were not converted:
[16]
Please update the trf2csv conversion script to include these in its definitions.

D:\log>

@daliDuans
Copy link
Contributor Author

@SimonBiggs Could you help solve my issue? thank you!

@SimonBiggs
Copy link
Member

To fix this you'll need to find out what Linac state 16 means and then submit a PR to add it to the following file:

"linac_state_codes": {
"34": "State Code Unknown",
"39": "Move Only",
"40": "Pause",
"41": "Intersegment",
"42": "Radiation On",
"43": "Interupted",
"44": "Interupted Ready",
"45": "Terminated Checking",
"46": "Terminated Ok",
"47": "Terminated Fault"
},

@daliDuans
Copy link
Contributor Author

Dear SimonBiggs, i find the linac state 16, as showed in the follow figure. However, i do not know how to submit a PR to the file you mentioned. @SimonBiggs
状态编码1

@SimonBiggs
Copy link
Member

SimonBiggs commented Mar 14, 2024 via email

@daliDuans
Copy link
Contributor Author

Thank you! i have created a PR on GitHub. please review it. @SimonBiggs

@sjswerdloff
Copy link
Collaborator

Thank you! i have created a PR on GitHub. please review it. @SimonBiggs

I'm running the tests against this.
Assuming the tests pass, I'll approve and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants