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 @@ -197,6 +197,9 @@ def _calc_memory_bytes_LPRec3d_tomobar(
min_mem_usage_ifft2 = False
if "min_mem_usage_ifft2" in kwargs:
min_mem_usage_ifft2 = kwargs["min_mem_usage_ifft2"]
power_of_2_cropping = False
if "power_of_2_cropping" in kwargs:
power_of_2_cropping = kwargs["power_of_2_cropping"]

angles_tot = non_slice_dims_shape[0]
DetectorsLengthH_prepad = non_slice_dims_shape[1]
Expand All @@ -205,6 +208,10 @@ def _calc_memory_bytes_LPRec3d_tomobar(
_CENTER_SIZE_MIN = 192 # must be divisible by 8

n = DetectorsLengthH
if(power_of_2_cropping):
n_pow2 = 2 ** math.ceil(math.log2(n))
if( 0.9 < n / n_pow2 ):
n = n_pow2

odd_horiz = False
if (n % 2) != 0:
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dev_template = "{tag}"

[project]
name = "httomo-backends"
version = "0.7.1"
version = "0.7.2"
description = "Supplementary files for HTTomo backends."
readme = "README.rst"
license = {text = "BSD-3-Clause"}
Expand Down Expand Up @@ -55,7 +55,6 @@ dependencies = [
"astra-toolbox",
"tomobar",
"scikit-image",
"ccpi-regularisation-cupy",
]

[project.optional-dependencies]
Expand Down
13 changes: 12 additions & 1 deletion tests/test_httomolibgpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,8 @@ def test_recon_FBP3d_tomobar_memoryhook(


@pytest.mark.cupy
@pytest.mark.parametrize("min_mem_usage_filter_ifft2", [(False, False), (True, False), (True, True)])
@pytest.mark.parametrize("min_mem_usage_filter_ifft2", [(False, False)])
@pytest.mark.parametrize("power_of_2_cropping", [False])
@pytest.mark.parametrize("padding_detx", [0, 10, 50, 100])
@pytest.mark.parametrize("projections", [1500, 1801, 2560])
@pytest.mark.parametrize("detX_size", [2560])
Expand All @@ -556,6 +557,7 @@ def test_recon_LPRec3d_tomobar_0_pi_memoryhook(
projection_angle_range,
min_mem_usage_filter_ifft2,
padding_detx,
power_of_2_cropping,
ensure_clean_memory,
):
__test_recon_LPRec3d_tomobar_memoryhook_common(
Expand All @@ -565,13 +567,15 @@ def test_recon_LPRec3d_tomobar_0_pi_memoryhook(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
)


@pytest.mark.full
@pytest.mark.cupy
@pytest.mark.parametrize("min_mem_usage_filter_ifft2", [(False, False), (True, False), (True, True)])
@pytest.mark.parametrize("power_of_2_cropping", [False, True])
@pytest.mark.parametrize("padding_detx", [0, 10, 50, 100, 800])
@pytest.mark.parametrize("projections", [1500, 1801, 2560, 3601])
@pytest.mark.parametrize("detX_size", [2560])
Expand All @@ -584,6 +588,7 @@ def test_recon_LPRec3d_tomobar_0_pi_memoryhook_full(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
):
__test_recon_LPRec3d_tomobar_memoryhook_common(
Expand All @@ -593,13 +598,15 @@ def test_recon_LPRec3d_tomobar_0_pi_memoryhook_full(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
)


@pytest.mark.full
@pytest.mark.cupy
@pytest.mark.parametrize("min_mem_usage_filter_ifft2", [(False, False), (True, False), (True, True)])
@pytest.mark.parametrize("power_of_2_cropping", [False, True])
@pytest.mark.parametrize("padding_detx", [0, 10, 50, 100, 800])
@pytest.mark.parametrize("projections", [1500, 1801, 2560, 3601])
@pytest.mark.parametrize("detX_size", [2560])
Expand All @@ -614,6 +621,7 @@ def test_recon_LPRec3d_tomobar_memoryhook_full(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
):
__test_recon_LPRec3d_tomobar_memoryhook_common(
Expand All @@ -623,6 +631,7 @@ def test_recon_LPRec3d_tomobar_memoryhook_full(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
)

Expand All @@ -634,6 +643,7 @@ def __test_recon_LPRec3d_tomobar_memoryhook_common(
projection_angle_range,
padding_detx,
min_mem_usage_filter_ifft2,
power_of_2_cropping,
ensure_clean_memory,
):
angles_number = projections
Expand All @@ -646,6 +656,7 @@ def __test_recon_LPRec3d_tomobar_memoryhook_common(
kwargs["detector_pad"] = padding_detx
kwargs["min_mem_usage_filter"] = min_mem_usage_filter_ifft2[0]
kwargs["min_mem_usage_ifft2"] = min_mem_usage_filter_ifft2[1]
kwargs["power_of_2_cropping"] = power_of_2_cropping
kwargs["recon_size"] = detX_size
kwargs["recon_mask_radius"] = 0.8

Expand Down