@@ -64,7 +64,6 @@ def FBP2d_astra(
6464 filter_d : Optional [float ] = None ,
6565 recon_size : Optional [int ] = None ,
6666 recon_mask_radius : float = 0.95 ,
67- neglog : bool = False ,
6867 gpu_id : int = 0 ,
6968) -> np .ndarray :
7069 """
@@ -96,9 +95,6 @@ def FBP2d_astra(
9695 The radius of the circular mask that applies to the reconstructed slice in order to crop
9796 out some undesirable artifacts. The values outside the given diameter will be set to zero.
9897 To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
99- neglog: bool
100- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
101- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
10298 gpu_id : int
10399 A GPU device index to perform operation on.
104100
@@ -120,8 +116,6 @@ def FBP2d_astra(
120116 reconstruction = np .empty (
121117 (recon_size , detY_size , recon_size ), dtype = float32 , order = "C"
122118 )
123- _take_neg_log_np (data ) if neglog else data
124-
125119 # loop over detY slices
126120 for slice_index in range (0 , detY_size ):
127121 reconstruction [:, slice_index , :] = np .flipud (
@@ -145,7 +139,6 @@ def FBP3d_tomobar(
145139 filter_freq_cutoff : float = 0.35 ,
146140 recon_size : Optional [int ] = None ,
147141 recon_mask_radius : Optional [float ] = 0.95 ,
148- neglog : bool = False ,
149142 gpu_id : int = 0 ,
150143) -> cp .ndarray :
151144 """
@@ -174,9 +167,6 @@ def FBP3d_tomobar(
174167 The radius of the circular mask that applies to the reconstructed slice in order to crop
175168 out some undesirable artifacts. The values outside the given diameter will be set to zero.
176169 To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
177- neglog: bool
178- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
179- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
180170 gpu_id : int
181171 A GPU device index to perform operation on.
182172
@@ -191,7 +181,7 @@ def FBP3d_tomobar(
191181 )
192182
193183 reconstruction = RecToolsCP .FBP (
194- _take_neg_log ( data ) if neglog else data ,
184+ data ,
195185 cutoff_freq = filter_freq_cutoff ,
196186 recon_mask_radius = recon_mask_radius ,
197187 data_axes_labels_order = input_data_axis_labels ,
@@ -214,7 +204,6 @@ def LPRec3d_tomobar(
214204 power_of_2_cropping : Optional [bool ] = False ,
215205 min_mem_usage_filter : Optional [bool ] = True ,
216206 min_mem_usage_ifft2 : Optional [bool ] = True ,
217- neglog : bool = False ,
218207) -> cp .ndarray :
219208 """
220209 Fourier direct inversion in 3D on unequally spaced (also called as Log-Polar) grids using
@@ -243,9 +232,6 @@ def LPRec3d_tomobar(
243232 The radius of the circular mask that applies to the reconstructed slice in order to crop
244233 out some undesirable artifacts. The values outside the given diameter will be set to zero.
245234 To implement the cropping one can use the range [0.7-1.0] or set to 2.0 when no cropping required.
246- neglog: bool
247- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
248- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
249235
250236 Returns
251237 -------
@@ -258,7 +244,7 @@ def LPRec3d_tomobar(
258244 )
259245
260246 reconstruction = RecToolsCP .FOURIER_INV (
261- _take_neg_log ( data ) if neglog else data ,
247+ data ,
262248 recon_mask_radius = recon_mask_radius ,
263249 data_axes_labels_order = input_data_axis_labels ,
264250 filter_type = filter_type ,
@@ -282,7 +268,6 @@ def SIRT3d_tomobar(
282268 recon_mask_radius : float = 0.95 ,
283269 iterations : int = 300 ,
284270 nonnegativity : bool = True ,
285- neglog : bool = False ,
286271 gpu_id : int = 0 ,
287272) -> cp .ndarray :
288273 """
@@ -312,10 +297,7 @@ def SIRT3d_tomobar(
312297 iterations : int
313298 The number of SIRT iterations.
314299 nonnegativity : bool
315- Impose nonnegativity constraint on reconstructed image.
316- neglog: bool
317- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
318- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
300+ Impose nonnegativity constraint on the reconstructed image.
319301 gpu_id : int
320302 A GPU device index to perform operation on.
321303
@@ -336,7 +318,7 @@ def SIRT3d_tomobar(
336318 )
337319
338320 _data_ = {
339- "projection_norm_data" : _take_neg_log ( data ) if neglog else data ,
321+ "projection_norm_data" : data ,
340322 "data_axes_labels_order" : input_data_axis_labels ,
341323 } # data dictionary
342324 _algorithm_ = {
@@ -359,7 +341,6 @@ def CGLS3d_tomobar(
359341 recon_mask_radius : float = 0.95 ,
360342 iterations : int = 20 ,
361343 nonnegativity : bool = True ,
362- neglog : bool = False ,
363344 gpu_id : int = 0 ,
364345) -> cp .ndarray :
365346 """
@@ -390,9 +371,6 @@ def CGLS3d_tomobar(
390371 The number of CGLS iterations.
391372 nonnegativity : bool
392373 Impose nonnegativity constraint on reconstructed image.
393- neglog: bool
394- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
395- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
396374 gpu_id : int, optional
397375 A GPU device index to perform operation on.
398376
@@ -407,7 +385,7 @@ def CGLS3d_tomobar(
407385 )
408386
409387 _data_ = {
410- "projection_norm_data" : _take_neg_log ( data ) if neglog else data ,
388+ "projection_norm_data" : data ,
411389 "data_axes_labels_order" : input_data_axis_labels ,
412390 } # data dictionary
413391 _algorithm_ = {
@@ -435,7 +413,6 @@ def FISTA3d_tomobar(
435413 regularisation_iterations : int = 50 ,
436414 regularisation_half_precision : bool = True ,
437415 nonnegativity : bool = True ,
438- neglog : bool = False ,
439416 gpu_id : int = 0 ,
440417) -> cp .ndarray :
441418 """
@@ -474,9 +451,6 @@ def FISTA3d_tomobar(
474451 Perform faster regularisation computation in half-precision with a very minimal sacrifice in quality.
475452 nonnegativity : bool
476453 Impose nonnegativity constraint on the reconstructed image.
477- neglog: bool
478- Take negative logarithm on input data to convert to attenuation coefficient or a density of the scanned object. Defaults to False,
479- assuming that the negative log is taken either in normalisation procedure on with Paganin filter application.
480454 gpu_id : int
481455 A GPU device index to perform operation on.
482456
@@ -490,7 +464,7 @@ def FISTA3d_tomobar(
490464 )
491465
492466 _data_ = {
493- "projection_norm_data" : _take_neg_log ( data ) if neglog else data ,
467+ "projection_norm_data" : data ,
494468 "OS_number" : subsets_number ,
495469 "data_axes_labels_order" : input_data_axis_labels ,
496470 }
@@ -649,24 +623,6 @@ def _instantiate_iterative_recon_class(
649623 return RecToolsCP
650624
651625
652- def _take_neg_log (data : cp .ndarray ) -> cp .ndarray :
653- """Taking negative log"""
654- data [data <= 0 ] = 1
655- data = - cp .log (data )
656- data [cp .isnan (data )] = 6.0
657- data [cp .isinf (data )] = 0
658- return data
659-
660-
661- def _take_neg_log_np (data : np .ndarray ) -> np .ndarray :
662- """Taking negative log"""
663- data [data <= 0 ] = 1
664- data = - np .log (data )
665- data [np .isnan (data )] = 6.0
666- data [np .isinf (data )] = 0
667- return data
668-
669-
670626def __estimate_detectorHoriz_padding (detX_size ) -> int :
671627 det_half = detX_size // 2
672628 padded_value_exact = int (np .sqrt (2 * (det_half ** 2 ))) - det_half
0 commit comments