Hi, I analyzed my WL test with pylinac 2.3.2 and get these error results. I am using the same WL test pattern and setup and the same Varian EPID a1200 settings as before. The results were successfully analyzed with version 2.2.6.
Attached with a sample of exposed image at 4x4 cm field size using BrainLab WL pointer.
The weighted-pixel value location of the BB. “”" # get initial starting conditions hmin, hmax = np.percentile(self.array, [5, 99.9]) spread = hmax - hmin max_thresh = hmax lower_thresh = hmax - spread / 1.5 # search for the BB by iteratively lowering the low-pass threshold value until the BB is found. found = False while not found: try: binary_arr = np.logical_and((max_thresh > self), (self >= lower_thresh)) labeled_arr, num_roi = ndimage.measurements.label(binary_arr) roi_sizes, bin_edges = np.histogram(labeled_arr, bins=num_roi + 1) bw_bb_img = np.where(labeled_arr == np.argsort(roi_sizes)[-3], 1, 0) # we pick the 3rd largest one because the largest is the background, 2nd is rad field, 3rd is the BB bw_bb_img = ndimage.binary_fill_holes(bw_bb_img).astype(int) # fill holes for low energy beams like 2.5MV bb_regionprops = measure.regionprops(bw_bb_img)[0]
if not is_round(bb_regionprops): raise ValueError if not is_modest_size(bw_bb_img, self.rad_field_bounding_box): raise ValueError if not is_symmetric(bw_bb_img): raise ValueError except (IndexError, ValueError): max_thresh -= 0.05 * spread if max_thresh < hmin: raise ValueError(“Unable to locate the BB. Make sure the field edges do not obscure the BB and that there is no artifacts in the images.”) else: found = True
# determine the center of mass of the BB inv_img = image.load(self.array) # we invert so BB intensity increases w/ attenuation inv_img.check_inversion_by_histogram(percentiles=(99.99, 50, 0.01)) bb_rprops = measure.regionprops(bw_bb_img, intensity_image=inv_img)[0] return Point(bb_rprops.weighted_centroid[1], bb_rprops.weighted_centroid[0])
you could check if all pylinac dependencies are still correct. When I run pipdeptree (install with pip install pipdeptree) I get the following dependency tree. Maybe you reverted to an older lib version trough conda or something else.