本文整理匯總了Python中pylinac.core.image.Image.dist2edge_min方法的典型用法代碼示例。如果您正苦於以下問題:Python Image.dist2edge_min方法的具體用法?Python Image.dist2edge_min怎麽用?Python Image.dist2edge_min使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pylinac.core.image.Image
的用法示例。
在下文中一共展示了Image.dist2edge_min方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: film
# 需要導入模塊: from pylinac.core.image import Image [as 別名]
# 或者: from pylinac.core.image.Image import dist2edge_min [as 別名]
#.........這裏部分代碼省略.........
self.circle_profile.radius = self._convert_radius_perc2pix(radius)
# extract the circle profile
self.circle_profile.get_median_profile(self.image.array)
# find the radiation lines using the peaks of the profile
self.lines = self.circle_profile.find_rad_lines(min_peak_height, fwhm=fwhm)
self.find_wobble_minimize(SID)
# find the wobble
# self._find_wobble_2step(SID)
if not recursive:
wobble_unreasonable = False
else:
if self.wobble.radius_mm < 5 and self.wobble.center.dist_to(self.start_point) < 50:
wobble_unreasonable = False
else:
if min_peak_height > 0.15:
min_peak_height -= 0.07
elif radius > 0.3:
min_peak_height = orig_peak_height
radius -= 0.05
else:
raise RuntimeError("The algorithm was unable to determine a reasonable wobble. Try setting"
"recursive to False")
def _convert_radius_perc2pix(self, radius):
"""Convert a percent radius to distance in pixels, based on the distance from center point to image
edge.
Parameters
----------
radius : float
The radius ratio (e.g. 0.5).
"""
dist = self.image.dist2edge_min(self.circle_profile.center)
return dist*radius
@property
def image_is_loaded(self):
"""Boolean property specifying if an image has been loaded."""
try:
self.image.size
return True
except AttributeError:
return False
@property
def _start_point_is_set(self):
"""Boolean specifying if a start point has been set."""
if self.circle_profile.center.x == 0:
return False
else:
return True
def _scale_wobble(self, SID):
"""Scale the determined wobble by the SID.
Parameters
----------
SID : int, float
Source to image distance in cm.
"""
# convert wobble to mm if possible
if self.image.dpmm is not None:
self._tolerance_unit = 'mm'
self.wobble.radius_mm = self.wobble.radius / self.image.dpmm
else: