Skip to content

Commit 69d95a7

Browse files
authored
Merge pull request #145 from DiamondLightSource/avoid-copy-recontools
Move import of RecToolsDIRCuPy and RecToolsIRCuPy to module scope
2 parents 6ceae18 + 649a558 commit 69d95a7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

httomolibgpu/recon/algorithm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
from numpy import float32, complex64
3030
from typing import Optional, Type
3131

32+
from tomobar.methodsDIR_CuPy import RecToolsDIRCuPy
33+
from tomobar.methodsIR_CuPy import RecToolsIRCuPy
34+
3235
__all__ = [
3336
"FBP",
3437
"LPRec",
@@ -360,8 +363,6 @@ def _instantiate_direct_recon_class(
360363
Returns:
361364
Type[RecToolsDIRCuPy]: an instance of the direct recon class
362365
"""
363-
from tomobar.methodsDIR_CuPy import RecToolsDIRCuPy
364-
365366
if center is None:
366367
center = data.shape[2] // 2 # making a crude guess
367368
if recon_size is None:
@@ -400,8 +401,6 @@ def _instantiate_iterative_recon_class(
400401
Returns:
401402
Type[RecToolsIRCuPy]: an instance of the iterative class
402403
"""
403-
from tomobar.methodsIR_CuPy import RecToolsIRCuPy
404-
405404
if center is None:
406405
center = data.shape[2] // 2 # making a crude guess
407406
if recon_size is None:

0 commit comments

Comments
 (0)