Skip to content

Commit

Permalink
Fix for exports with nifti files with dots in the filenames
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWilkie committed Oct 30, 2023
1 parent dd9da85 commit dd341d4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions darwin/exporter/formats/nifti.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,7 @@ def unnest_dict_to_list(d: Dict) -> List:
img_ornt, orig_ornt
) # Get transform from RAS to current affine
img = img.as_reoriented(from_canonical)
output_path = (
Path(output_dir)
/ f"{image_id}_{volume.series_instance_uid}_{volume.class_name}.nii.gz"
)
output_path = Path(output_dir) / f"{image_id}_{volume.class_name}.nii.gz"
if not output_path.parent.exists():
output_path.parent.mkdir(parents=True)
nib.save(img=img, filename=output_path)
Expand Down

0 comments on commit dd341d4

Please sign in to comment.