httomolibgpu 2.7__tar.gz → 3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {httomolibgpu-2.7/httomolibgpu.egg-info → httomolibgpu-3.0}/PKG-INFO +2 -2
  2. {httomolibgpu-2.7 → httomolibgpu-3.0}/README.rst +1 -1
  3. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/corr.py +3 -3
  4. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/rescale.py +26 -42
  5. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/supp_func.py +8 -7
  6. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/recon/algorithm.py +39 -12
  7. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/recon/rotation.py +1 -1
  8. {httomolibgpu-2.7 → httomolibgpu-3.0/httomolibgpu.egg-info}/PKG-INFO +2 -2
  9. {httomolibgpu-2.7 → httomolibgpu-3.0}/LICENSE +0 -0
  10. {httomolibgpu-2.7 → httomolibgpu-3.0}/MANIFEST.in +0 -0
  11. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/__init__.py +0 -0
  12. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/__init__.py +0 -0
  13. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/calc_metrics.cu +0 -0
  14. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/center_360_shifts.cu +0 -0
  15. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/generate_mask.cu +0 -0
  16. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/median_kernel.cu +0 -0
  17. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/paganin_filter_gen.cu +0 -0
  18. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/raven_filter.cu +0 -0
  19. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cuda_kernels/remove_nan_inf.cu +0 -0
  20. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/cupywrapper.py +0 -0
  21. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/__init__.py +0 -0
  22. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/denoise.py +0 -0
  23. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/misc/morph.py +0 -0
  24. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/prep/__init__.py +0 -0
  25. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/prep/alignment.py +0 -0
  26. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/prep/normalize.py +0 -0
  27. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/prep/phase.py +0 -0
  28. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/prep/stripe.py +0 -0
  29. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu/recon/__init__.py +0 -0
  30. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu.egg-info/SOURCES.txt +0 -0
  31. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu.egg-info/dependency_links.txt +0 -0
  32. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu.egg-info/requires.txt +0 -0
  33. {httomolibgpu-2.7 → httomolibgpu-3.0}/httomolibgpu.egg-info/top_level.txt +0 -0
  34. {httomolibgpu-2.7 → httomolibgpu-3.0}/pyproject.toml +0 -0
  35. {httomolibgpu-2.7 → httomolibgpu-3.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httomolibgpu
3
- Version: 2.7
3
+ Version: 3.0
4
4
  Summary: Commonly used tomography data processing methods at DLS.
5
5
  Author-email: Daniil Kazantsev <daniil.kazantsev@diamond.ac.uk>, Yousef Moazzam <yousef.moazzam@diamond.ac.uk>, Naman Gera <naman.gera@diamond.ac.uk>
6
6
  License: BSD-3-Clause
@@ -71,7 +71,7 @@ Conda environment
71
71
 
72
72
  $ conda create --name httomolibgpu # create a fresh conda environment
73
73
  $ conda activate httomolibgpu # activate the environment
74
- $ conda install -c conda-forge cupy==12.3.0 # for linux users
74
+ $ conda install conda-forge::cupy==12.3.0
75
75
  $ pip install httomolibgpu
76
76
 
77
77
  Setup the development environment:
@@ -34,7 +34,7 @@ Conda environment
34
34
 
35
35
  $ conda create --name httomolibgpu # create a fresh conda environment
36
36
  $ conda activate httomolibgpu # activate the environment
37
- $ conda install -c conda-forge cupy==12.3.0 # for linux users
37
+ $ conda install conda-forge::cupy==12.3.0
38
38
  $ pip install httomolibgpu
39
39
 
40
40
  Setup the development environment:
@@ -114,7 +114,7 @@ def median_filter(
114
114
 
115
115
 
116
116
  def remove_outlier(
117
- data: cp.ndarray, kernel_size: int = 3, dif: float = 0.1
117
+ data: cp.ndarray, kernel_size: int = 3, dif: float = 1000
118
118
  ) -> cp.ndarray:
119
119
  """Selectively applies 3D median filter to a 3D CuPy array to remove outliers. Also called a dezinger.
120
120
  For more detailed information, see :ref:`method_outlier_removal`.
@@ -126,8 +126,8 @@ def remove_outlier(
126
126
  kernel_size : int, optional
127
127
  The size of the filter's kernel (a diameter).
128
128
  dif : float, optional
129
- Expected difference value between outlier value and the
130
- median value of the array.
129
+ Expected difference value between the outlier value (central voxel) and the
130
+ median value of the neighbourhood. Lower values lead to median filtering.
131
131
 
132
132
  Returns
133
133
  -------
@@ -24,32 +24,32 @@ import numpy as np
24
24
  from httomolibgpu import cupywrapper
25
25
 
26
26
  cp = cupywrapper.cp
27
- cupy_run = cupywrapper.cupy_run
28
27
 
29
28
  from typing import Literal, Optional, Tuple, Union
30
29
 
31
30
  from httomolibgpu.misc.supp_func import data_checker
32
31
 
32
+
33
33
  __all__ = [
34
34
  "rescale_to_int",
35
35
  ]
36
36
 
37
37
 
38
38
  def rescale_to_int(
39
- data: Union[np.ndarray, cp.ndarray],
39
+ data: cp.ndarray,
40
40
  perc_range_min: float = 0.0,
41
41
  perc_range_max: float = 100.0,
42
42
  bits: Literal[8, 16, 32] = 8,
43
43
  glob_stats: Optional[Tuple[float, float, float, int]] = None,
44
- ) -> Union[np.ndarray, cp.ndarray]:
44
+ ) -> cp.ndarray:
45
45
  """
46
46
  Rescales the data given as float32 type and converts it into the range of an unsigned integer type
47
47
  with the given number of bits. For more detailed information and examples, see :ref:`method_rescale_to_int`.
48
48
 
49
49
  Parameters
50
50
  ----------
51
- data : Union[np.ndarray, cp.ndarray]
52
- Input data as a numpy or cupy array (the function is cpu-gpu agnostic)
51
+ data : cp.ndarray
52
+ Input data as a cupy array
53
53
  perc_range_min: float, optional
54
54
  The lower cutoff point in the input data, in percent of the data range (defaults to 0).
55
55
  The lower bound is computed as min + perc_range_min/100*(max-min)
@@ -69,7 +69,7 @@ def rescale_to_int(
69
69
 
70
70
  Returns
71
71
  -------
72
- Union[np.ndarray, cp.ndarray]
72
+ cp.ndarray
73
73
  The original data, clipped to the range specified with the perc_range_min and
74
74
  perc_range_max, and scaled to the full range of the output integer type
75
75
  """
@@ -82,18 +82,13 @@ def rescale_to_int(
82
82
 
83
83
  data = data_checker(data, verbosity=True, method_name="rescale_to_int")
84
84
 
85
- if cupy_run:
86
- xp = cp.get_array_module(data)
87
- else:
88
- import numpy as xp
89
-
90
85
  # get the min and max integer values of the output type
91
- output_min = xp.iinfo(output_dtype).min
92
- output_max = xp.iinfo(output_dtype).max
86
+ output_min = cp.iinfo(output_dtype).min
87
+ output_max = cp.iinfo(output_dtype).max
93
88
 
94
89
  if not isinstance(glob_stats, tuple):
95
- min_value = float(xp.min(data))
96
- max_value = float(xp.max(data))
90
+ min_value = float(cp.min(data))
91
+ max_value = float(cp.max(data))
97
92
  else:
98
93
  min_value = glob_stats[0]
99
94
  max_value = glob_stats[1]
@@ -102,32 +97,21 @@ def rescale_to_int(
102
97
  input_min = (perc_range_min * (range_intensity) / 100) + min_value
103
98
  input_max = (perc_range_max * (range_intensity) / 100) + min_value
104
99
 
100
+ factor = cp.float32(1.0)
105
101
  if (input_max - input_min) != 0.0:
106
- factor = xp.float32((output_max - output_min) / (input_max - input_min))
107
- else:
108
- factor = 1.0
109
-
110
- res = xp.empty(data.shape, dtype=output_dtype)
111
- if xp.__name__ == "numpy":
112
- if input_max == pow(2, 32):
113
- input_max -= 1
114
- res = np.copy(data.astype(float))
115
- res[data.astype(float) < input_min] = int(input_min)
116
- res[data.astype(float) > input_max] = int(input_max)
117
- res -= input_min
118
- res *= factor
119
- res = output_dtype(res)
120
- else:
121
- rescale_kernel = cp.ElementwiseKernel(
122
- "T x, raw T input_min, raw T input_max, raw T factor",
123
- "O out",
124
- """
125
- T x_clean = isnan(x) || isinf(x) ? T(0) : x;
126
- T x_clipped = x_clean < input_min ? input_min : (x_clean > input_max ? input_max : x_clean);
127
- T x_rebased = x_clipped - input_min;
128
- out = O(x_rebased * factor);
129
- """,
130
- "rescale_to_int",
131
- )
132
- rescale_kernel(data, input_min, input_max, factor, res)
102
+ factor = cp.float32((output_max - output_min) / (input_max - input_min))
103
+
104
+ res = cp.empty(data.shape, dtype=output_dtype)
105
+ rescale_kernel = cp.ElementwiseKernel(
106
+ "T x, raw T input_min, raw T input_max, raw T factor",
107
+ "O out",
108
+ """
109
+ T x_clean = isnan(x) || isinf(x) ? T(0) : x;
110
+ T x_clipped = x_clean < input_min ? input_min : (x_clean > input_max ? input_max : x_clean);
111
+ T x_rebased = x_clipped - input_min;
112
+ out = O(x_rebased * factor);
113
+ """,
114
+ "rescale_to_int",
115
+ )
116
+ rescale_kernel(data, input_min, input_max, factor, res)
133
117
  return res
@@ -162,7 +162,7 @@ def data_checker(
162
162
  ) -> bool:
163
163
  """
164
164
  Function that performs the variety of checks on input data, in some cases also correct the data and prints warnings.
165
- Currently it checks for: the presence of infs and nans in data; the number of zero elements.
165
+ Currently it checks for: the presence of infs and nans in data.
166
166
 
167
167
  Parameters
168
168
  ----------
@@ -181,11 +181,12 @@ def data_checker(
181
181
 
182
182
  data = _naninfs_check(data, verbosity=verbosity, method_name=method_name)
183
183
 
184
- _zeros_check(
185
- data,
186
- verbosity=verbosity,
187
- percentage_threshold=50,
188
- method_name=method_name,
189
- )
184
+ # ! The number of zero elements check is currently switched off as it requires sorting or AtomicAdd, which makes it inefficient on GPUs. !
185
+ # _zeros_check(
186
+ # data,
187
+ # verbosity=verbosity,
188
+ # percentage_threshold=50,
189
+ # method_name=method_name,
190
+ # )
190
191
 
191
192
  return data
@@ -18,7 +18,7 @@
18
18
  # Created By : Tomography Team at DLS <scientificsoftware@diamond.ac.uk>
19
19
  # Changes relative to ToMoBAR 2024.01 version
20
20
  # ---------------------------------------------------------------------------
21
- """Module for tomographic reconstruction"""
21
+ """Module for tomographic reconstruction. For more detailed information see :ref:`image_reconstruction_module`"""
22
22
 
23
23
  import numpy as np
24
24
  from httomolibgpu import cupywrapper
@@ -59,6 +59,7 @@ def FBP2d_astra(
59
59
  data: np.ndarray,
60
60
  angles: np.ndarray,
61
61
  center: Optional[float] = None,
62
+ detector_pad: int = 0,
62
63
  filter_type: str = "ram-lak",
63
64
  filter_parameter: Optional[float] = None,
64
65
  filter_d: Optional[float] = None,
@@ -70,10 +71,9 @@ def FBP2d_astra(
70
71
  """
71
72
  Perform Filtered Backprojection (FBP) reconstruction slice-by-slice (2d) using ASTRA toolbox :cite:`van2016fast` and
72
73
  ToMoBAR :cite:`kazantsev2020tomographic` wrappers.
73
- This is a 2D recon using ASTRA's API for the FBP method, see for more parameters ASTRA's documentation here:
74
- https://astra-toolbox.com/docs/algs/FBP_CUDA.html.
74
+ This is a 2D recon using ASTRA's API for the FBP_CUDA method, see more in :ref:`method_FBP2d_astra`.
75
75
 
76
- Parameters`
76
+ Parameters
77
77
  ----------
78
78
  data : np.ndarray
79
79
  Projection data as a 3d numpy array.
@@ -81,6 +81,8 @@ def FBP2d_astra(
81
81
  An array of angles given in radians.
82
82
  center : float, optional
83
83
  The center of rotation (CoR).
84
+ detector_pad : int
85
+ Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction.
84
86
  filter_type: str
85
87
  Type of projection filter, see ASTRA's API for all available options for filters.
86
88
  filter_parameter: float, optional
@@ -112,7 +114,7 @@ def FBP2d_astra(
112
114
  recon_size = data_shape[2]
113
115
 
114
116
  RecTools = _instantiate_direct_recon2d_class(
115
- data, angles, center, recon_size, gpu_id
117
+ data, angles, center, detector_pad, recon_size, gpu_id
116
118
  )
117
119
 
118
120
  detY_size = data_shape[1]
@@ -140,6 +142,7 @@ def FBP3d_tomobar(
140
142
  data: cp.ndarray,
141
143
  angles: np.ndarray,
142
144
  center: Optional[float] = None,
145
+ detector_pad: int = 0,
143
146
  filter_freq_cutoff: float = 0.35,
144
147
  recon_size: Optional[int] = None,
145
148
  recon_mask_radius: Optional[float] = 0.95,
@@ -149,7 +152,8 @@ def FBP3d_tomobar(
149
152
  """
150
153
  Perform Filtered Backprojection (FBP) reconstruction using ASTRA toolbox :cite:`van2016fast` and
151
154
  ToMoBAR :cite:`kazantsev2020tomographic` wrappers.
152
- This is a 3D recon from the CuPy array directly and using a custom built SINC filter for filtration in Fourier space.
155
+ This is a 3D recon from the CuPy array directly and using a custom built SINC filter for filtration in Fourier space,
156
+ see more in :ref:`method_FBP3d_tomobar`.
153
157
 
154
158
  Parameters
155
159
  ----------
@@ -159,8 +163,10 @@ def FBP3d_tomobar(
159
163
  An array of angles given in radians.
160
164
  center : float, optional
161
165
  The center of rotation (CoR).
166
+ detector_pad : int
167
+ Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction.
162
168
  filter_freq_cutoff : float
163
- Cutoff frequency parameter for the SINC filter, the lower values produce better contrast but noisy reconstruction.
169
+ Cutoff frequency parameter for the SINC filter, the lower values may produce better contrast but noisy reconstruction. The filter change will also affect the dynamic range of the reconstructed image.
164
170
  recon_size : int, optional
165
171
  The [recon_size, recon_size] shape of the reconstructed slice in pixels.
166
172
  By default (None), the reconstructed size will be the dimension of the horizontal detector.
@@ -182,7 +188,7 @@ def FBP3d_tomobar(
182
188
  data = data_checker(data, verbosity=True, method_name="FBP3d_tomobar")
183
189
 
184
190
  RecToolsCP = _instantiate_direct_recon_class(
185
- data, angles, center, recon_size, gpu_id
191
+ data, angles, center, detector_pad, recon_size, gpu_id
186
192
  )
187
193
 
188
194
  reconstruction = RecToolsCP.FBP(
@@ -200,6 +206,7 @@ def LPRec3d_tomobar(
200
206
  data: cp.ndarray,
201
207
  angles: np.ndarray,
202
208
  center: Optional[float] = None,
209
+ detector_pad: int = 0,
203
210
  filter_type: str = "shepp",
204
211
  filter_freq_cutoff: float = 1.0,
205
212
  recon_size: Optional[int] = None,
@@ -209,7 +216,7 @@ def LPRec3d_tomobar(
209
216
  """
210
217
  Fourier direct inversion in 3D on unequally spaced (also called as Log-Polar) grids using
211
218
  CuPy array as an input. This implementation follows V. Nikitin's CUDA-C implementation and TomoCuPy package.
212
- :cite:`andersson2016fast`.
219
+ :cite:`andersson2016fast`, see more in :ref:`method_LPRec3d_tomobar`.
213
220
 
214
221
  Parameters
215
222
  ----------
@@ -219,10 +226,12 @@ def LPRec3d_tomobar(
219
226
  An array of angles given in radians.
220
227
  center : float, optional
221
228
  The center of rotation (CoR).
229
+ detector_pad : int
230
+ Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction.
222
231
  filter_type : str
223
232
  Filter type, the accepted strings are: none, ramp, shepp, cosine, cosine2, hamming, hann, parzen.
224
233
  filter_freq_cutoff : float
225
- Cutoff frequency parameter for a filter. The higher values increase the resolution but also amplify the noise.
234
+ Cutoff frequency parameter for a filter.
226
235
  recon_size : int, optional
227
236
  The [recon_size, recon_size] shape of the reconstructed slice in pixels.
228
237
  By default (None), the reconstructed size will be the dimension of the horizontal detector.
@@ -242,7 +251,9 @@ def LPRec3d_tomobar(
242
251
 
243
252
  data = data_checker(data, verbosity=True, method_name="LPRec3d_tomobar")
244
253
 
245
- RecToolsCP = _instantiate_direct_recon_class(data, angles, center, recon_size, 0)
254
+ RecToolsCP = _instantiate_direct_recon_class(
255
+ data, angles, center, detector_pad, recon_size, 0
256
+ )
246
257
 
247
258
  reconstruction = RecToolsCP.FOURIER_INV(
248
259
  _take_neg_log(data) if neglog else data,
@@ -260,6 +271,7 @@ def SIRT3d_tomobar(
260
271
  data: cp.ndarray,
261
272
  angles: np.ndarray,
262
273
  center: Optional[float] = None,
274
+ detector_pad: int = 0,
263
275
  recon_size: Optional[int] = None,
264
276
  iterations: Optional[int] = 300,
265
277
  nonnegativity: Optional[bool] = True,
@@ -280,6 +292,8 @@ def SIRT3d_tomobar(
280
292
  An array of angles given in radians.
281
293
  center : float, optional
282
294
  The center of rotation (CoR).
295
+ detector_pad : int
296
+ Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction.
283
297
  recon_size : int, optional
284
298
  The [recon_size, recon_size] shape of the reconstructed slice in pixels.
285
299
  By default (None), the reconstructed size will be the dimension of the horizontal detector.
@@ -304,6 +318,7 @@ def SIRT3d_tomobar(
304
318
  data,
305
319
  angles,
306
320
  center,
321
+ detector_pad,
307
322
  recon_size,
308
323
  gpu_id,
309
324
  datafidelity="LS",
@@ -327,6 +342,7 @@ def CGLS3d_tomobar(
327
342
  data: cp.ndarray,
328
343
  angles: np.ndarray,
329
344
  center: Optional[float] = None,
345
+ detector_pad: int = 0,
330
346
  recon_size: Optional[int] = None,
331
347
  iterations: Optional[int] = 20,
332
348
  nonnegativity: Optional[bool] = True,
@@ -347,6 +363,8 @@ def CGLS3d_tomobar(
347
363
  An array of angles given in radians.
348
364
  center : float, optional
349
365
  The center of rotation (CoR).
366
+ detector_pad : int
367
+ Detector width padding with edge values to remove circle/arc type artifacts in the reconstruction.
350
368
  recon_size : int, optional
351
369
  The [recon_size, recon_size] shape of the reconstructed slice in pixels.
352
370
  By default (None), the reconstructed size will be the dimension of the horizontal detector.
@@ -368,7 +386,7 @@ def CGLS3d_tomobar(
368
386
  data = data_checker(data, verbosity=True, method_name="CGLS3d_tomobar")
369
387
 
370
388
  RecToolsCP = _instantiate_iterative_recon_class(
371
- data, angles, center, recon_size, gpu_id, datafidelity="LS"
389
+ data, angles, center, detector_pad, recon_size, gpu_id, datafidelity="LS"
372
390
  )
373
391
 
374
392
  _data_ = {
@@ -386,6 +404,7 @@ def _instantiate_direct_recon_class(
386
404
  data: cp.ndarray,
387
405
  angles: np.ndarray,
388
406
  center: Optional[float] = None,
407
+ detector_pad: int = 0,
389
408
  recon_size: Optional[int] = None,
390
409
  gpu_id: int = 0,
391
410
  ) -> Type:
@@ -395,6 +414,7 @@ def _instantiate_direct_recon_class(
395
414
  data (cp.ndarray): data array
396
415
  angles (np.ndarray): angles
397
416
  center (Optional[float], optional): center of recon. Defaults to None.
417
+ detector_pad (int): Detector width padding. Defaults to 0.
398
418
  recon_size (Optional[int], optional): recon_size. Defaults to None.
399
419
  gpu_id (int, optional): gpu ID. Defaults to 0.
400
420
 
@@ -407,6 +427,7 @@ def _instantiate_direct_recon_class(
407
427
  recon_size = data.shape[2]
408
428
  RecToolsCP = RecToolsDIRCuPy(
409
429
  DetectorsDimH=data.shape[2], # Horizontal detector dimension
430
+ DetectorsDimH_pad=detector_pad, # padding for horizontal detector
410
431
  DetectorsDimV=data.shape[1], # Vertical detector dimension (3D case)
411
432
  CenterRotOffset=data.shape[2] / 2
412
433
  - center
@@ -423,6 +444,7 @@ def _instantiate_direct_recon2d_class(
423
444
  data: np.ndarray,
424
445
  angles: np.ndarray,
425
446
  center: Optional[float] = None,
447
+ detector_pad: int = 0,
426
448
  recon_size: Optional[int] = None,
427
449
  gpu_id: int = 0,
428
450
  ) -> Type:
@@ -432,6 +454,7 @@ def _instantiate_direct_recon2d_class(
432
454
  data (cp.ndarray): data array
433
455
  angles (np.ndarray): angles
434
456
  center (Optional[float], optional): center of recon. Defaults to None.
457
+ detector_pad (int): Detector width padding. Defaults to 0.
435
458
  recon_size (Optional[int], optional): recon_size. Defaults to None.
436
459
  gpu_id (int, optional): gpu ID. Defaults to 0.
437
460
 
@@ -444,6 +467,7 @@ def _instantiate_direct_recon2d_class(
444
467
  recon_size = data.shape[2]
445
468
  RecTools = RecToolsDIR(
446
469
  DetectorsDimH=data.shape[2], # Horizontal detector dimension
470
+ DetectorsDimH_pad=detector_pad, # padding for horizontal detector
447
471
  DetectorsDimV=None, # 2d case
448
472
  CenterRotOffset=data.shape[2] / 2
449
473
  - center
@@ -459,6 +483,7 @@ def _instantiate_iterative_recon_class(
459
483
  data: cp.ndarray,
460
484
  angles: np.ndarray,
461
485
  center: Optional[float] = None,
486
+ detector_pad: int = 0,
462
487
  recon_size: Optional[int] = None,
463
488
  gpu_id: int = 0,
464
489
  datafidelity: str = "LS",
@@ -469,6 +494,7 @@ def _instantiate_iterative_recon_class(
469
494
  data (cp.ndarray): data array
470
495
  angles (np.ndarray): angles
471
496
  center (Optional[float], optional): center of recon. Defaults to None.
497
+ detector_pad (int): Detector width padding. Defaults to 0.
472
498
  recon_size (Optional[int], optional): recon_size. Defaults to None.
473
499
  datafidelity (str, optional): Data fidelity
474
500
  gpu_id (int, optional): gpu ID. Defaults to 0.
@@ -482,6 +508,7 @@ def _instantiate_iterative_recon_class(
482
508
  recon_size = data.shape[2]
483
509
  RecToolsCP = RecToolsIRCuPy(
484
510
  DetectorsDimH=data.shape[2], # Horizontal detector dimension
511
+ DetectorsDimH_pad=detector_pad, # padding for horizontal detector
485
512
  DetectorsDimV=data.shape[1], # Vertical detector dimension (3D case)
486
513
  CenterRotOffset=data.shape[2] / 2
487
514
  - center
@@ -425,7 +425,7 @@ def find_center_360(
425
425
  Find the center-of-rotation (COR) in a 360-degree scan and also an offset
426
426
  to perform data transformation from 360 to 180 degrees scan. See :cite:`vo2021data`.
427
427
 
428
- Parameters Tuple[np.float32, np.float32, Literal["left", "right"], np.float32]:
428
+ Parameters
429
429
  ----------
430
430
  data : cp.ndarray
431
431
  3D tomographic data as a Cupy array.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: httomolibgpu
3
- Version: 2.7
3
+ Version: 3.0
4
4
  Summary: Commonly used tomography data processing methods at DLS.
5
5
  Author-email: Daniil Kazantsev <daniil.kazantsev@diamond.ac.uk>, Yousef Moazzam <yousef.moazzam@diamond.ac.uk>, Naman Gera <naman.gera@diamond.ac.uk>
6
6
  License: BSD-3-Clause
@@ -71,7 +71,7 @@ Conda environment
71
71
 
72
72
  $ conda create --name httomolibgpu # create a fresh conda environment
73
73
  $ conda activate httomolibgpu # activate the environment
74
- $ conda install -c conda-forge cupy==12.3.0 # for linux users
74
+ $ conda install conda-forge::cupy==12.3.0
75
75
  $ pip install httomolibgpu
76
76
 
77
77
  Setup the development environment:
File without changes
File without changes
File without changes
File without changes