Skip to content

Commit

Permalink
sphere fix (#44)
Browse files Browse the repository at this point in the history
* sphere mistake fixed

* sphere mistake fixed
  • Loading branch information
milesagraham authored Aug 8, 2024
1 parent 554b902 commit e814ccb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ttmask/sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import mrcfile

from ._cli import cli
from .soft_edge import add_soft_edge
from .box_setup import box_setup
from soft_edge import add_soft_edge
from box_setup import box_setup


@cli.command(name='sphere')
Expand All @@ -25,7 +25,7 @@ def sphere(
coordinates_centered, mask = box_setup(sidelength)

#determine distances of each pixel to the center
distance_to_center = np.linalg.norm(coordinates_centered)
distance_to_center = np.linalg.norm(coordinates_centered, axis=-1)

# set up criteria for which pixels are inside the sphere and modify values to 1.
inside_sphere = distance_to_center < (sphere_radius / pixel_size)
Expand Down

0 comments on commit e814ccb

Please sign in to comment.