Skip to content

Commit

Permalink
Fixed output filename formatting which assumed the extension was alwa…
Browse files Browse the repository at this point in the history
…ys 3 characters long (#43)
  • Loading branch information
rdrighetto authored Dec 14, 2023
1 parent d76e97e commit 1f9747a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/membrain_seg/segmentation/dataloading/data_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@ def store_segmented_tomograms(
out_folder = out_folder
if store_probabilities:
out_file = os.path.join(
out_folder, os.path.basename(orig_data_path)[:-4] + "_scores.mrc"
out_folder,
os.path.splitext(os.path.basename(orig_data_path))[0] + "_scores.mrc",
)
out_tomo = Tomogram(
data=predictions_np, header=mrc_header, voxel_size=voxel_size
Expand All @@ -186,7 +187,10 @@ def store_segmented_tomograms(
)
out_file_thres = os.path.join(
out_folder,
os.path.basename(orig_data_path)[:-4] + "_" + ckpt_token + "_segmented.mrc",
os.path.splitext(os.path.basename(orig_data_path))[0]
+ "_"
+ ckpt_token
+ "_segmented.mrc",
)
if store_connected_components:
predictions_np_thres = connected_components(
Expand Down

0 comments on commit 1f9747a

Please sign in to comment.