Skip to content

Commit dd6cc4f

Browse files
committed
add print
1 parent 54e3127 commit dd6cc4f

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/cardiotensor/visualization/fury_plotting_streamlines.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,15 @@ def show_streamlines(
185185
if not streamlines_xyz:
186186
raise ValueError("❌ No streamlines intersect the crop box.")
187187

188+
print("Cropping applied")
188189

189190
# --- Downsample and filter
191+
print(f"Downsampling points by factor {downsample_factor}")
190192
downsampled_streamlines = []
191193
downsampled_colors = []
192-
for sl in streamlines_xyz:
194+
for sl, cl in zip(streamlines_xyz, color_values):
193195
ds_sl = downsample_streamline(sl, downsample_factor)
194-
ds_cl = downsample_streamline(color_slice, downsample_factor)
195-
196+
ds_cl = downsample_streamline(cl, downsample_factor)
196197
if filter_min_len is None or len(ds_sl) >= filter_min_len:
197198
downsampled_streamlines.append(ds_sl)
198199
downsampled_colors.append(ds_cl)
@@ -205,6 +206,7 @@ def show_streamlines(
205206

206207
# --- Subsample
207208
if subsample_factor > 1:
209+
print(f"Subsample number of streamlines by factor {downsample_factor}")
208210
total = len(streamlines_xyz)
209211
selected_idx = sorted(random.sample(range(total), total // subsample_factor))
210212
streamlines_xyz = [streamlines_xyz[i] for i in selected_idx]

src/cardiotensor/visualization/streamlines.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,21 @@ def visualize_streamlines(
7676
if not streamlines_file.exists():
7777
raise FileNotFoundError(f"❌ Streamlines file not found: {streamlines_file}")
7878

79+
print(f"Loading streamlines: {streamlines_file}")
7980
data = np.load(streamlines_file, allow_pickle=True)
8081
raw_streamlines = data.get("streamlines")
8182
if raw_streamlines is None:
8283
raise ValueError("'streamlines' array missing in .npz.")
8384

8485
# Convert (z, y, x) to (x, y, z)
86+
print("Convert (z, y, x) to (x, y, z)")
8587
streamlines_xyz = [
8688
np.array([(pt[2], pt[1], pt[0]) for pt in sl], dtype=np.float32)
8789
for sl in raw_streamlines.tolist()
8890
]
8991

9092
# Compute coloring
93+
print("Compute coloring")
9194
if color_by == "elevation":
9295
color_values = compute_elevation_angles(streamlines_xyz)
9396
else: # color_by == "ha"
@@ -101,6 +104,7 @@ def visualize_streamlines(
101104
# Default to helix_angle_cmap if no colormap is provided
102105
if colormap is None:
103106
colormap = helix_angle_cmap
107+
104108

105109
# Render streamlines
106110
show_streamlines(

0 commit comments

Comments
 (0)