Skip to content

Commit 1e34cd8

Browse files
authored
Merge pull request #73 from BrainLesion/71-enhancement-fails-on-cpu-only-machines-when-not-explicitly-setting-to-cpu
71 enhancement fails on cpu only machines when not explicitly setting to cpu
2 parents 5ad167b + d4e19d9 commit 1e34cd8

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

brainles_preprocessing/brain_extraction/brain_extractor.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# TODO add typing and docs
22
from abc import abstractmethod
3+
from pathlib import Path
34
from shutil import copyfile
45

56
from auxiliary.nifti.io import read_nifti, write_nifti
@@ -82,13 +83,10 @@ def extract(
8283
)
8384

8485
hdbet_mask_path = (
85-
masked_image_path.parent
86-
+ "/"
87-
+ name_extractor(masked_image_path)
88-
+ "_mask.nii.gz"
86+
Path(masked_image_path).parent
87+
/ f"{name_extractor(masked_image_path)}_mask.nii.gz"
8988
)
90-
91-
if hdbet_mask_path != brain_mask_path:
89+
if hdbet_mask_path.resolve() != Path(brain_mask_path).resolve():
9290
copyfile(
9391
src=hdbet_mask_path,
9492
dst=brain_mask_path,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ nibabel = "^3.2.1"
5050
numpy = "^1.23.0"
5151

5252
# hd-bet reqs
53-
BrainLes-HD-BET = ">=0.0.5"
53+
brainles_hd_bet = "*" #= ">=0.0.5"
5454

5555
# utils
5656
tqdm = "^4.64.1"

0 commit comments

Comments
 (0)