Skip to content

Commit

Permalink
Update segmentation.py
Browse files Browse the repository at this point in the history
split temp_tck path to generate relative path instead of absolute path
  • Loading branch information
chiuhoward committed Nov 13, 2024
1 parent 39c9396 commit ef436f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AFQ/tasks/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ef436f1

Please sign in to comment.