Skip to content

Commit b606ac1

Browse files
committed
add new spineps
1 parent 520a65a commit b606ac1

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

TPTBox/segmentation/spineps.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def get_outpaths_spineps(
1414
dataset: str | Path | None = None,
1515
derivative_name: str = "derivative",
1616
ignore_bids_filter: bool = True,
17+
_dataset_id_ct_crop=100,
1718
) -> dict[
1819
Literal[
1920
"out_spine",
@@ -27,6 +28,7 @@ def get_outpaths_spineps(
2728
"out_snap2",
2829
"out_debug",
2930
"out_raw",
31+
"out_vibeseg",
3032
],
3133
Path,
3234
]:
@@ -54,6 +56,7 @@ def get_outpaths_spineps(
5456
None,
5557
input_format=file_path.format,
5658
non_strict_mode=ignore_bids_filter,
59+
_dataset_id_ct_crop=_dataset_id_ct_crop,
5760
)
5861
return output_paths
5962

@@ -87,6 +90,7 @@ def run_spineps(
8790
"out_snap2",
8891
"out_debug",
8992
"out_raw",
93+
"out_vibeseg",
9094
],
9195
Path,
9296
]:
@@ -120,9 +124,14 @@ def run_spineps(
120124
Returns:
121125
The output paths dictionary returned by SPINEPS' ``process_img_nii``.
122126
"""
123-
from spineps import get_instance_model, get_semantic_model, process_img_nii
127+
from spineps import get_instance_model, get_semantic_model
124128
from spineps.get_models import get_actual_model
125129

130+
try:
131+
from spineps import process_img_nii as segment_image
132+
except Exception:
133+
from spineps import segment_image
134+
126135
label = {}
127136
try:
128137
from spineps.get_models import get_labeling_model
@@ -145,7 +154,7 @@ def run_spineps(
145154
model_instance = get_actual_model(model_instance, use_cpu=use_cpu)
146155
else:
147156
model_instance = get_instance_model(model_instance, use_cpu=use_cpu)
148-
output_paths, errcode = process_img_nii(
157+
output_paths, errcode = segment_image(
149158
img_ref=file_path,
150159
derivative_name=derivative_name,
151160
model_semantic=model_semantic,

0 commit comments

Comments
 (0)