Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sphere fix #44

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading