Skip to content

Commit

Permalink
fix how to load pkl classifier file; fix: run correct subtasks script
Browse files Browse the repository at this point in the history
  • Loading branch information
wasserth committed Jul 23, 2024
1 parent 47e7330 commit 07f85d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_subtasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
pip install .
- name: Run test script
run: ./tests/tests.sh ${{ secrets.TOTALSEGMENTATOR_LICENSE }}
run: ./tests/tests_subtasks.sh ${{ secrets.TOTALSEGMENTATOR_LICENSE }}
shell: bash
4 changes: 3 additions & 1 deletion totalsegmentator/bin/totalseg_get_phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
import pickle
from pprint import pprint
import pkg_resources

import nibabel as nib
import numpy as np
Expand Down Expand Up @@ -85,7 +86,8 @@ def get_ct_contrast_phase(ct_img: nib.Nifti1Image, model_file: Path = None):
features.append(stats_hn[organ]["intensity"])

if model_file is None:
classifier_path = Path(__file__).parents[2] / "resources" / "contrast_phase_classifiers_2024_07_19.pkl"
# classifier_path = Path(__file__).parents[2] / "resources" / "contrast_phase_classifiers_2024_07_19.pkl"
classifier_path = pkg_resources.resource_filename('totalsegmentator', 'resources/contrast_phase_classifiers_2024_07_19.pkl')
else:
# manually set model file
classifier_path = model_file
Expand Down

0 comments on commit 07f85d0

Please sign in to comment.