Skip to content

Commit 4cb6c2e

Browse files
committed
add warning
1 parent 6eb4613 commit 4cb6c2e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/cardiotensor/orientation/orientation_computation_pipeline.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import os
44
import sys
55
import time
6+
import warnings
67
from collections.abc import Sequence
78

89
import numpy as np
@@ -173,7 +174,7 @@ def compute_orientation(
173174
truncate: Gaussian kernel truncation.
174175
axis_points: 3D points defining LV axis for cylindrical coordinates.
175176
vertical_padding: Padding slices for tensor computation.
176-
write_vectors: Whether to save eigenvectors.
177+
write_vectors: Whether to save eigenvectors. Ignored in test mode.
177178
write_angles: Whether to save HA/IA/FA maps.
178179
use_gpu: Use GPU acceleration for tensor computation.
179180
is_test: If True, runs in test mode and outputs plots.
@@ -195,6 +196,16 @@ def compute_orientation(
195196
else:
196197
raise ValueError("ANGLE_MODE must be 'ha_ia' or 'az_el'")
197198

199+
if is_test and write_vectors:
200+
warnings.warn(
201+
"WRITE_VECTORS=True has no effect when is_test=True; "
202+
"vector fields are not written in test mode. "
203+
"Proceeding with write_vectors=False.",
204+
UserWarning,
205+
stacklevel=2,
206+
)
207+
write_vectors = False
208+
198209
print(f"""
199210
Parameters:
200211
- Volume path: {volume_path}

0 commit comments

Comments
 (0)