Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, axes='ZYX', rays=None, n_channel_in=1, grid=(1,1,1), anisotropy=None, backbone='resnet', **kwargs):
if rays is None:
if 'rays_json' in kwargs:
rays = rays_from_json(kwargs['rays_json'])
elif 'n_rays' in kwargs:
rays = Rays_GoldenSpiral(kwargs['n_rays'])
else:
rays = Rays_GoldenSpiral(96)
elif np.isscalar(rays):
rays = Rays_GoldenSpiral(rays)
super().__init__(axes=axes, n_channel_in=n_channel_in, n_channel_out=1+len(rays))
# directly set by parameters
self.n_rays = len(rays)
self.grid = _normalize_grid(grid,3)
self.anisotropy = anisotropy if anisotropy is None else tuple(anisotropy)
self.backbone = str(backbone).lower()
self.rays_json = rays.to_json()
if 'anisotropy' in self.rays_json['kwargs']:
if self.rays_json['kwargs']['anisotropy'] is None and self.anisotropy is not None:
self.rays_json['kwargs']['anisotropy'] = self.anisotropy
print("Changing 'anisotropy' of rays to %s" % str(anisotropy))
elif self.rays_json['kwargs']['anisotropy'] != self.anisotropy:
warnings.warn("Mismatch of 'anisotropy' of rays and 'anisotropy'.")
def __init__(self, axes='ZYX', rays=None, n_channel_in=1, grid=(1,1,1), anisotropy=None, backbone='resnet', **kwargs):
if rays is None:
if 'rays_json' in kwargs:
rays = rays_from_json(kwargs['rays_json'])
elif 'n_rays' in kwargs:
rays = Rays_GoldenSpiral(kwargs['n_rays'])
else:
rays = Rays_GoldenSpiral(96)
elif np.isscalar(rays):
rays = Rays_GoldenSpiral(rays)
super().__init__(axes=axes, n_channel_in=n_channel_in, n_channel_out=1+len(rays))
# directly set by parameters
self.n_rays = len(rays)
self.grid = _normalize_grid(grid,3)
self.anisotropy = anisotropy if anisotropy is None else tuple(anisotropy)
self.backbone = str(backbone).lower()
self.rays_json = rays.to_json()
if 'anisotropy' in self.rays_json['kwargs']:
if self.rays_json['kwargs']['anisotropy'] is None and self.anisotropy is not None:
def __init__(self, axes='ZYX', rays=None, n_channel_in=1, grid=(1,1,1), anisotropy=None, backbone='resnet', **kwargs):
if rays is None:
if 'rays_json' in kwargs:
rays = rays_from_json(kwargs['rays_json'])
elif 'n_rays' in kwargs:
rays = Rays_GoldenSpiral(kwargs['n_rays'])
else:
rays = Rays_GoldenSpiral(96)
elif np.isscalar(rays):
rays = Rays_GoldenSpiral(rays)
super().__init__(axes=axes, n_channel_in=n_channel_in, n_channel_out=1+len(rays))
# directly set by parameters
self.n_rays = len(rays)
self.grid = _normalize_grid(grid,3)
self.anisotropy = anisotropy if anisotropy is None else tuple(anisotropy)
self.backbone = str(backbone).lower()
self.rays_json = rays.to_json()
if 'anisotropy' in self.rays_json['kwargs']:
if self.rays_json['kwargs']['anisotropy'] is None and self.anisotropy is not None:
self.rays_json['kwargs']['anisotropy'] = self.anisotropy
print("Changing 'anisotropy' of rays to %s" % str(anisotropy))