def iabel_basex_transform(Q0): # basex requires a whole image IM = put_image_quadrants((Q0, Q0, Q0, Q0), odd_size=True) print ("basex uses whole image reconstructed from Q0 shape ",IM.shape) rows, cols = IM.shape center = (rows//2+rows%2, cols//2+cols%2) AIM = BASEX (IM, center, n=rows, verbose=True) return get_image_quadrants(AIM)[0] # only return Q0
def iabel_basex_transform(Q0): # basex requires a whole image IM = put_image_quadrants((Q0, Q0, Q0, Q0), odd_size=True) print("basex uses whole image reconstructed from Q0 shape ", IM.shape) rows, cols = IM.shape center = (rows // 2 + rows % 2, cols // 2 + cols % 2) AIM = BASEX(IM, center, n=rows, verbose=True) return get_image_quadrants(AIM)[0] # only return Q0
ntrans = np.size(transforms.keys()) # number of transforms # Image: O2- VMI 1024x1024 pixel ------------------ IM = np.loadtxt('data/O2-ANU1024.txt.bz2') # this is even size, all methods except 'onion' require an odd-size # recenter the image to an odd size IModd, offset = find_image_center_by_slice (IM, radial_range=(300,400)) np.savetxt("O2-ANU1023.txt", IModd) h, w = IModd.shape print ("centered image 'data/O2-ANU2048.txt' shape = {:d}x{:d}".format(h,w)) Q0, Q1, Q2, Q3 = get_image_quadrants (IModd, reorient=True) Q0fresh = Q0.copy() # keep clean copy print ("quadrant shape {}".format(Q0.shape)) # Intensity mask used for intensity normalization # quadrant image region of bright pixels mask = np.zeros(Q0.shape,dtype=bool) mask[500:512, 358:365] = True # process Q0 quadrant using each method -------------------- iabelQ = [] # keep inverse Abel transformed image
transforms = collections.OrderedDict(sorted(transforms.items())) ntrans = np.size(transforms.keys()) # number of transforms # Image: O2- VMI 1024x1024 pixel ------------------ IM = np.loadtxt('data/O2-ANU1024.txt.bz2') # this is even size, all methods except 'onion' require an odd-size # recenter the image to an odd size IModd, offset = find_image_center_by_slice(IM, radial_range=(300, 400)) np.savetxt("O2-ANU1023.txt", IModd) h, w = IModd.shape print("centered image 'data/O2-ANU2048.txt' shape = {:d}x{:d}".format(h, w)) Q0, Q1, Q2, Q3 = get_image_quadrants(IModd, reorient=True) Q0fresh = Q0.copy() # keep clean copy print("quadrant shape {}".format(Q0.shape)) # Intensity mask used for intensity normalization # quadrant image region of bright pixels mask = np.zeros(Q0.shape, dtype=bool) mask[500:512, 358:365] = True # process Q0 quadrant using each method -------------------- iabelQ = [] # keep inverse Abel transformed image for q, method in enumerate(transforms.keys()):