Describe the bug
When running analysis on CTP404, the 'clear_borders' setting is ignored. This results in the script failing to localise the phantom, which causes subsequent errors.
To Reproduce
Steps to reproduce the behavior:
Have a CatPhan image set that isn't well segmented by the get_regions algorithm
ctp = CatPhan404(folder)
ctp.clear_borders=False
ctp.analyze()
See error
Cell In[81], line 1
ctp504_5.analyze()
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:1994 in analyze
self.ctp404 = ctp404(
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:594 in __init__
super().__init__(catphan, tolerance=hu_tolerance, offset=offset)
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:367 in __init__
self._setup_rois()
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:610 in _setup_rois
super()._setup_rois()
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:416 in _setup_rois
self.background_rois[name] = HUDiskROI(
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\ct.py:183 in __init__
super().__init__(array, angle, roi_radius, dist_from_center, phantom_center)
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\core\roi.py:67 in __init__
center = self._get_shifted_center(angle, dist_from_center, phantom_center)
File ~\Anaconda3\envs\gp\lib\site-packages\pylinac\core\roi.py:80 in _get_shifted_center
return Point(phantom_center.x + x_shift, phantom_center.y + y_shift)
AttributeError: 'NoneType' object has no attribute 'x'
Proposed solution
Add a new line at line 607, in CTP404CP504.preprocess:
clear_borders = self.clear_borders,
Describe the bug When running analysis on CTP404, the 'clear_borders' setting is ignored. This results in the script failing to localise the phantom, which causes subsequent errors.
To Reproduce Steps to reproduce the behavior:
Proposed solution Add a new line at line 607, in CTP404CP504.preprocess:
clear_borders = self.clear_borders,
I'll try to make a pull request for this.