From dd341d4a8c5a442b8d7452069bd02eb34ab9e925 Mon Sep 17 00:00:00 2001 From: John Wilkie Date: Mon, 30 Oct 2023 15:37:17 +0000 Subject: [PATCH] Fix for exports with nifti files with dots in the filenames --- darwin/exporter/formats/nifti.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/darwin/exporter/formats/nifti.py b/darwin/exporter/formats/nifti.py index 354c2216a..0a122527c 100644 --- a/darwin/exporter/formats/nifti.py +++ b/darwin/exporter/formats/nifti.py @@ -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)