Created
August 31, 2023 16:14
-
-
Save jrkerns/fe093072fd2a843e98854f94d3f9de05 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import cached_property | |
from pylinac import CatPhan504 | |
from pylinac.ct import CTP528CP504 | |
from pylinac.core.profile import CollapsedCircleProfile | |
class MyCTP528CP504(CTP528CP504): | |
@cached_property | |
def circle_profile(self) -> CollapsedCircleProfile: | |
"""Calculate the median profile of the Line Pair region. | |
Returns | |
------- | |
:class:`pylinac.core.profile.CollapsedCircleProfile` : A 1D profile of the Line Pair region. | |
""" | |
circle_profile = CollapsedCircleProfile( | |
self.phan_center, | |
self.radius2linepairs, | |
image_array=self.image, | |
start_angle=self.start_angle + np.deg2rad(self.catphan_roll), | |
width_ratio=0.04, # change this to what you want | |
sampling_ratio=2, | |
ccw=self.ccw, | |
) | |
circle_profile.filter(0.001, kind="gaussian") | |
circle_profile.ground() | |
return circle_profile | |
class MyCatphan(CatPhan504): | |
modules = { | |
CTP404CP504: {"offset": 0}, | |
CTP486: {"offset": -65}, | |
MyCTP528CP504: {"offset": 30}, # use the custom class here | |
CTP515: {"offset": -30}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment