From ef436f1d3005deeda8596e86b73ca3c3e7b4d2b2 Mon Sep 17 00:00:00 2001 From: Howard Chiu <137316255+chiuhoward@users.noreply.github.com> Date: Wed, 13 Nov 2024 13:45:58 -0800 Subject: [PATCH] Update segmentation.py split temp_tck path to generate relative path instead of absolute path --- AFQ/tasks/segmentation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AFQ/tasks/segmentation.py b/AFQ/tasks/segmentation.py index d49342da..3130a02c 100644 --- a/AFQ/tasks/segmentation.py +++ b/AFQ/tasks/segmentation.py @@ -67,8 +67,8 @@ def segment(data_imap, mapping_imap, tg = trx.to_sft() elif streamlines.endswith(".tck.gz"): # uncompress tck.gz to a temporary tck: - temp_tck = op.join(mkdtemp(), streamlines.replace(".gz", "")) - print(temp_tck) + temp_tck = op.join(mkdtemp(), op.split(streamlines.replace(".gz", ""))[1]) + logger.info(f"Temporary tck file created at: {temp_tck}") with gzip.open(streamlines, 'rb') as f_in: with open(temp_tck, 'wb') as f_out: shutil.copyfileobj(f_in, f_out)