Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ misc:
memory_gpu:
multiplier: None
method: module
average_projection_frames:
pattern: sinogram
output_dims_change: True
implementation: gpu_cupy
save_result_default: False
padding: False
memory_gpu:
multiplier: 2.1
method: direct
rescale:
rescale_to_int:
pattern: all
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,35 @@
from typing import Tuple
import numpy as np

from httomolibgpu.misc.morph import data_resampler, sino_360_to_180
from httomolibgpu.misc.morph import (
data_resampler,
sino_360_to_180,
average_projection_frames,
)

__all__ = [
"_calc_memory_bytes_data_resampler",
"_calc_output_dim_data_resampler",
"_calc_memory_bytes_sino_360_to_180",
"_calc_output_dim_sino_360_to_180",
"_calc_output_dim_average_projection_frames",
]


def _calc_output_dim_data_resampler(non_slice_dims_shape, **kwargs):
return kwargs["newshape"]


def _calc_output_dim_average_projection_frames(non_slice_dims_shape, **kwargs):
k: float = kwargs["projection_averaging_factor"]

n_proj = non_slice_dims_shape[0]
n_full = n_proj // k
remainder = n_proj % k
n_out = n_full + (remainder > 0)
return n_out, non_slice_dims_shape[1]


def _calc_memory_bytes_data_resampler(
non_slice_dims_shape: Tuple[int, int],
dtype: np.dtype,
Expand Down
20 changes: 20 additions & 0 deletions httomo_backends/pipelines_full/angles_averaging_directive.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- method: standard_tomo
module_path: httomo.data.hdf.loaders
- method: remove_outlier
module_path: httomolibgpu.misc.corr
- method: dark_flat_field_correction
module_path: httomolibgpu.prep.normalize
- method: find_center_vo
module_path: httomolibgpu.recon.rotation
- method: average_projection_frames
module_path: httomolibgpu.misc.morph
- method: minus_log
module_path: httomolibgpu.prep.normalize
- method: LPRec3d_tomobar
module_path: httomolibgpu.recon.algorithm
- method: calculate_stats
module_path: httomo.methods
- method: rescale_to_int
module_path: httomolib.misc.rescale
- method: save_to_images
module_path: httomolib.misc.images
7 changes: 7 additions & 0 deletions httomo_backends/scripts/yaml_pipelines_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ def yaml_pipelines_generator(
key="path_to_stiched_params_file",
comment="Provide an absolute path to the text file with seam index and blending width.",
)
elif "average_projection_frames" in method_name:
pipeline_full.yaml_set_comment_before_after_key(
i,
"--- Apply averaging of projection data in the angular dimension. --- ",
indent=0,
)
pipeline_full += yaml_template_method
elif "data_resampler" in method_name:
pipeline_full.yaml_set_comment_before_after_key(
i,
Expand Down
Loading