# Check that the number of arguments is only one; the directory where the data will be saved.
if [ $# -ne 1 ]; then
echo ""
echo "Exiting..."
echo "Wrong number of arguments."
echo "Expected only one argument specifying where to download the dataset (the folder does not need to exist)."
echo "For example: ./DownloadCoLeTra_Narwhal.sh /home/user/datasets/CoLeTra_Narwhal/"
echo ""
exit
fi
# Create a folder if it doesn't exist.
# If it exists, warn if the folder is not empty
echo ""
if [ ! -d $1 ] ; then
echo "Directory '$1' does not exist. Creating it..."
mkdir $1
else
if [ $(ls $1 | wc -l) -ne 0 ] ; then
echo "Warning: The directory specified '$1' is not empty. Do you wish to continue?"
read -p "Type 'y' for YES: " answer
if [ $answer != "y" ] ; then
echo "Exiting..."
echo ""
exit
fi
fi
fi
# Download training set
echo "Downloading training set..."
mkdir train
for split in "images" "labels"; do
mkdir 'train/'$split
for i in `seq 20 39`; do
url='https://archive.compute.dtu.dk/files/public/projects/CoLeTra_Narwhal/train/'$split'/NarB2_scan07_cropped3Dvolume_'$i'.nii.gz'
#wget url -P 'train/'$split'/'
echo $url
done
done
# Download validation set
echo "Downloading validation set..."
mkdir val
for split in "images" "labels"; do
mkdir 'val/'$split
url='https://archive.compute.dtu.dk/files/public/projects/CoLeTra_Narwhal/val/'$split'/scan_08_crop.nii.gz'
#wget url -P 'train/'$split'/'
echo $url
done
# Download test set
echo "Downloading test set..."
mkdir "test"
for split in "images" "labels"; do
mkdir 'test/'$split
for i in "09" "10" "11"; do
url='https://archive.compute.dtu.dk/files/public/projects/CoLeTra_Narwhal/test/'$split'/scan_'$i'_crop.nii.gz'
#wget url -P 'train/'$split'/'
echo $url
done
done
# |
Change |
User |
Description |
Committed |
|
#1
|
16541 |
hmkj |
Added data to public |
|
|