Skip to content

Commit 23af0ac

Browse files
committed
ants
1 parent 6b6e9f0 commit 23af0ac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

TPTBox/core/nii_wrapper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,10 @@ def n4_bias_field_correction(
954954
assert self.seg is False, "n4 bias field correction on a segmentation does not make any sense"
955955
# install antspyx not ants!
956956
import ants
957-
import ants.utils.bias_correction as bc # install antspyx not ants!
957+
try:
958+
import ants.ops.bias_correction as bc # install antspyx not ants!
959+
except ModuleNotFoundError:
960+
import ants.utils.bias_correction as bc # install antspyx not ants!
958961
from ants.utils.convert_nibabel import from_nibabel
959962
from scipy.ndimage import binary_dilation, generate_binary_structure
960963
dtype = self.dtype

0 commit comments

Comments
 (0)