Skip to content

Commit 79c4e1d

Browse files
committed
remocing data_checker from the functions and moving the module
1 parent af3d4c3 commit 79c4e1d

File tree

13 files changed

+146
-259
lines changed

13 files changed

+146
-259
lines changed

httomolibgpu/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from httomolibgpu.misc.utils import data_checker
2+
13
from httomolibgpu.misc.corr import median_filter, remove_outlier
24
from httomolibgpu.misc.denoise import total_variation_ROF, total_variation_PD
35
from httomolibgpu.misc.morph import sino_360_to_180, data_resampler

httomolibgpu/misc/corr.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,11 @@
3636
else:
3737
load_cuda_module = Mock()
3838

39-
from httomolibgpu.misc.supp_func import data_checker
40-
4139
__all__ = [
4240
"median_filter",
4341
"remove_outlier",
4442
]
4543

46-
4744
def median_filter(
4845
data: cp.ndarray,
4946
kernel_size: int = 3,
@@ -82,10 +79,6 @@ def median_filter(
8279
else:
8380
raise ValueError("The input array must be a 3D array")
8481

85-
data = data_checker(
86-
data, verbosity=True, method_name="median_filter_or_remove_outlier"
87-
)
88-
8982
if kernel_size not in [3, 5, 7, 9, 11, 13]:
9083
raise ValueError("Please select a correct kernel size: 3, 5, 7, 9, 11, 13")
9184

httomolibgpu/misc/denoise.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
from unittest.mock import Mock
3131

32-
from httomolibgpu.misc.supp_func import data_checker
33-
3432
if cupy_run:
3533
from tomobar.regularisersCuPy import ROF_TV_cupy, PD_TV_cupy
3634
else:
@@ -84,8 +82,6 @@ def total_variation_ROF(
8482
If the input array is not float32 data type.
8583
"""
8684

87-
data = data_checker(data, verbosity=True, method_name="total_variation_ROF")
88-
8985
return ROF_TV_cupy(
9086
data,
9187
regularisation_parameter,
@@ -139,8 +135,6 @@ def total_variation_PD(
139135
If the input array is not float32 data type.
140136
"""
141137

142-
data_checker(data, verbosity=True, method_name="total_variation_PD")
143-
144138
methodTV = 0
145139
if not isotropic:
146140
methodTV = 1

httomolibgpu/misc/morph.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,11 @@
3535

3636
from typing import Literal
3737

38-
from httomolibgpu.misc.supp_func import data_checker
39-
4038
__all__ = [
4139
"sino_360_to_180",
4240
"data_resampler",
4341
]
4442

45-
4643
def sino_360_to_180(
4744
data: cp.ndarray, overlap: float = 0, side: Literal["left", "right"] = "left"
4845
) -> cp.ndarray:
@@ -68,8 +65,6 @@ def sino_360_to_180(
6865
if data.ndim != 3:
6966
raise ValueError("only 3D data is supported")
7067

71-
data = data_checker(data, verbosity=True, method_name="sino_360_to_180")
72-
7368
dx, dy, dz = data.shape
7469

7570
overlap = int(np.round(overlap))
@@ -142,8 +137,6 @@ def data_resampler(
142137
data = cp.expand_dims(data, 1)
143138
axis = 1
144139

145-
data = data_checker(data, verbosity=True, method_name="data_resampler")
146-
147140
N, M, Z = cp.shape(data)
148141

149142
if axis == 0:

httomolibgpu/misc/rescale.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
from typing import Literal, Optional, Tuple, Union
2929

30-
from httomolibgpu.misc.supp_func import data_checker
31-
3230

3331
__all__ = [
3432
"rescale_to_int",
@@ -80,8 +78,6 @@ def rescale_to_int(
8078
else:
8179
output_dtype = np.uint32
8280

83-
data = data_checker(data, verbosity=True, method_name="rescale_to_int")
84-
8581
# get the min and max integer values of the output type
8682
output_min = cp.iinfo(output_dtype).min
8783
output_max = cp.iinfo(output_dtype).max

httomolibgpu/misc/supp_func.py

Lines changed: 0 additions & 192 deletions
This file was deleted.

0 commit comments

Comments
 (0)