# Renaming files The filenames of the images in the original datasets are complex or not unique. Thus, the following steps were performed: ## TotalSegmentator The TotalSegmentator images are all named `ct.nii.gz`, and must be renamed. To do so, you can run the following bash script **within in the downloaded directory** (e.g., `Totalsegmentator_dataset_v201`). Remove `echo` only after double checking. ```bash for dir in */; do echo mv -v "${dir}ct.nii.gz" "../tseg-${dir::-1}.nii.gz" done ``` > In this dataset, files derived from CT scans in the [TotalSegmentator](https://github.com/wasserth/TotalSegmentator/) dataset are prefixed with `tseg-` followed by the corresponding TotalSegmentator ID (e.g., `tseg-s1317.nii.gz`). ## VerSe The VerSe images file names include descriptions of the scan, orientation and mask. To make the filenames more simple and uniform, we removed the unnecessary suffixes. To do so too, you can run the following bash commands **within in the directory containing all downloaded NIfTI files**. Remove `echo` only after double checking! ```bash for f in *.nii.gz; do echo mv "$f" "${f/split-/}"; done for f in *.nii.gz; do echo mv "$f" "${f/sub-/}"; done for f in *.nii.gz; do echo mv "$f" "${f/_dir/}"; done for f in *.nii.gz; do echo mv "$f" "${f/_ct/}"; done for f in *.nii.gz; do echo mv "$f" "${f/-ax/}"; done for f in *.nii.gz; do echo mv "$f" "${f/-iso/}"; done for f in *.nii.gz; do echo mv "$f" "${f/-sag/}"; done for file in *.nii.gz ; do echo mv -v "$file" "verse-${file}" done ``` > In this dataset, files derived from CT scans in the [VerSe](https://github.com/anjany/verse) dataset are prefixed with `verse-` followed by the corresponding VerSe ID (e.g., `verse-825.nii.gz`).