Skip to content

Commit

Permalink
changes to imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc committed Apr 30, 2024
1 parent 3c249b1 commit 4b95b3a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions httomolibgpu/recon/rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
cupy_run = False
try:
import cupy as xp
import cupyx
from cupyx.scipy.ndimage import gaussian_filter, shift

# from cupyx.scipy.ndimage import gaussian_filter, shift

try:
xp.cuda.Device(0).compute_capability
Expand All @@ -39,13 +39,6 @@
except ImportError:
import numpy as np

try:
from cucim.skimage.registration import phase_cross_correlation
except ImportError:
print(
"Cucim library of Rapidsai is a required dependency for find_center_pc method, please install"
)

import nvtx
import math
from typing import List, Literal, Optional, Tuple
Expand Down Expand Up @@ -750,6 +743,12 @@ def find_center_pc(proj1, proj2, tol=0.5, rotc_guess=None):
float
Rotation axis location.
"""
if cupy_run:
from cupyx.scipy.ndimage import shift
from cucim.skimage.registration import phase_cross_correlation
else:
from scipy.ndimage import shift
from skimage.registration import phase_cross_correlation

imgshift = 0.0 if rotc_guess is None else rotc_guess - (proj1.shape[1] - 1.0) / 2.0

Expand Down

0 comments on commit 4b95b3a

Please sign in to comment.