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

small fixes for template generation and preparation #114

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
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: 4 additions & 2 deletions src/pytom_tm/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def generate_template_from_map(
input_map = np.pad(
input_map,
tuple([(d // 2, d // 2 + d % 2) for d in diff]),
mode='edge'
mode='constant',
constant_values=0,
)

if filter_to_resolution is None:
Expand All @@ -79,7 +80,8 @@ def generate_template_from_map(
input_map = np.pad(
input_map,
(pad // 2, pad // 2 + pad % 2),
mode='edge'
mode='constant',
constant_values=0
)
elif output_box_size < (input_map.shape[0] * input_spacing) // output_spacing:
logging.warning('Could not set specified box size as the map would need to be cut and this might '
Expand Down
2 changes: 2 additions & 0 deletions src/pytom_tm/tmjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,8 @@ def start_job(
read_mrc(self.template),
read_mrc(self.mask)
)
# apply mask directly to prevent any wedge convolution with weird edges
template *= mask

# init tomogram and template weighting
tomo_filter, template_wedge = 1, 1
Expand Down