Rotational exposures from Canon Alphenix cause skin dose map TypeError

Issue #942 resolved
David Platten created an issue

The problem is that the following line has int(frame), and for the system in question this field is None:

    if 'Rotational' in run_type:
        self.my_dose.addDose(skinMap.rotational(x_ray, angle_x, end_angle, int(frames), self.phantom, area, ref_ak,
                                                kvp, filter_cu, d_ref,
                                                self.table_length, self.table_width,
                                                self.table_trans,
                                                self.table_thick + self.matt_thick))

I’m going to get hold of an example RDSR from the system which includes a rotational exposure and see if the number of frames is stored in a non-standard location.

Here’s an example entry from my celery default.log file:

[2022-06-22 15:47:18,013: ERROR/MainProcess] Task remapp.tools.make_skin_map[5632e00d-ee01-4d03-8b57-b30b5b7f0a37] raised unexpected: TypeError("int() argument must be a string or a number, not 'NoneType'",)
Traceback (most recent call last):
File "d:\server_apps\python27\lib\site-packages\celery\app\trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "d:\server_apps\python27\lib\site-packages\celery\app\trace.py", line 438, in protected_call
return self.run(*args, **kwargs)
File "d:\server_apps\python27\lib\site-packages\openrem\remapp\tools\make_skin_map.py", line 213, in make_skin_map
run_type=run_type, frames=frames, end_angle=end_angle, patPos=patPos)
File "d:\server_apps\python27\lib\site-packages\openrem\remapp\tools\openskin\calc_exp_map.py", line 74, in add_view
self.my_dose.addDose(skinMap.rotational(x_ray, angle_x, end_angle, int(frames), self.phantom, area, ref_ak,
TypeError: int() argument must be a string or a number, not 'NoneType'

Comments (12)

  1. David Platten reporter

    Try to calculate number of frames in an exposure by dividing exposure time by pulse width if number of frames is not available. This works for rotational exposures from our Canon Alphenix Sky+ system. Refs issue #942

    → <<cset 660ef005690c>>

  2. David Platten reporter

    Inserting decorator to enable the rotational test to be skipped - not sure if this will work on Bitbucket, but it works locally. Also ran PyCharm's 'optimise imports'. Refs issue #942

    → <<cset d81e1f851d57>>

  3. David Platten reporter

    Replacing skip with a tag of 'slow'. Updated bitbucket-pipelines.yml so the 'test' item excludes any tests tagged with 'slow', and added an item that will just run tests tagged with 'slow'. Refs issue #942

    → <<cset 4b16d27f67c1>>

  4. David Platten reporter

    Merged in issue942AlphenixRotSkinDoseMaps (pull request #533)

    Try to calculate number of frames in an exposure by dividing exposure time by pulse width if number of frames is not available. This works for rotational exposures from our Canon Alphenix Sky+ system. Refs issue #942

    Approved-by: Ed McDonagh

    Fixes issue #942

    → <<cset ca364ff9c2c8>>

  5. David Platten reporter

    Merged in issue942AlphenixRotSkinDoseMaps (pull request #533)

    Try to calculate number of frames in an exposure by dividing exposure time by pulse width if number of frames is not available. This works for rotational exposures from our Canon Alphenix Sky+ system. Refs issue #942

    Approved-by: Ed McDonagh

    Fixes issue #942

    → <<cset ca364ff9c2c8>>

  6. Log in to comment