|
26 | 26 |
|
27 | 27 | log = logging.getLogger(__name__) |
28 | 28 |
|
29 | | -try: |
30 | | - from _Atb import _Atb_ext as Atb |
31 | | - from _Ax import _Ax_ext as Ax |
32 | | - |
33 | | -except ModuleNotFoundError: |
34 | | - raise ModuleNotFoundError( |
35 | | - "This plugin requires the additional package TIGRE\n" + |
36 | | - "Please install it via conda as tigre from the ccpi channel") |
37 | | - |
38 | 29 | try: |
39 | 30 | from tigre.utilities.gpu import GpuIds |
40 | 31 | has_gpu_sel = True |
@@ -176,6 +167,13 @@ def __init__(self, |
176 | 167 | self.gpuids = GpuIds() |
177 | 168 |
|
178 | 169 | def __call_Ax(self, data): |
| 170 | + try: |
| 171 | + from _Ax import _Ax_ext as Ax |
| 172 | + except ModuleNotFoundError: |
| 173 | + raise ModuleNotFoundError( |
| 174 | + "This plugin requires the additional package TIGRE\n" |
| 175 | + "Please install it via conda as tigre from the ccpi channel") |
| 176 | + |
179 | 177 | if has_gpu_sel: |
180 | 178 | return Ax(data, self.tigre_geom, self.tigre_geom.angles, |
181 | 179 | self.method['direct'], self.tigre_geom.mode, self.gpuids) |
@@ -207,6 +205,13 @@ def direct(self, x, out=None): |
207 | 205 | return out |
208 | 206 |
|
209 | 207 | def __call_Atb(self, data): |
| 208 | + try: |
| 209 | + from _Atb import _Atb_ext as Atb |
| 210 | + except ModuleNotFoundError: |
| 211 | + raise ModuleNotFoundError( |
| 212 | + "This plugin requires the additional package TIGRE\n" |
| 213 | + "Please install it via conda as tigre from the ccpi channel") |
| 214 | + |
210 | 215 | if has_gpu_sel: |
211 | 216 | return Atb(data, self.tigre_geom, self.tigre_geom.angles, |
212 | 217 | self.method['adjoint'], self.tigre_geom.mode, |
|
0 commit comments