diff --git a/src/monai_physio/segment_chest_total_segmentator.py b/src/monai_physio/segment_chest_total_segmentator.py index ab78ec0..e591548 100644 --- a/src/monai_physio/segment_chest_total_segmentator.py +++ b/src/monai_physio/segment_chest_total_segmentator.py @@ -321,8 +321,14 @@ def segmentation_method(self, preprocessed_image: itk.image) -> itk.image: >>> labelmap = segmenter.segmentation_method(preprocessed_ct) """ with tempfile.TemporaryDirectory() as tmp_dir: + from totalsegmentator.config import set_config_key, setup_totalseg from totalsegmentator.python_api import totalsegmentator + # Ensure config folder/file exist, then disable telemetry. + setup_totalseg() + set_config_key("send_usage_stats", False) + set_config_key("statistics_disclaimer_shown", True) + # ITK and Nibabel use different coordinate systems (LPS vs RAS). # The safest conversion is via a temporary file. This approach # still reduces I/O compared to the original implementation.