Downloads the specified MedMNIST dataset and saves the training, validation, and test datasets into the specified output directory. Images are saved as .png for 2D data and multi-page .tiff for 3D data, organized into folders named after their labels.
Returns: None, saves images in the specified output directory if save_images is True.
Type
Default
Details
dataset
str
The name of the MedMNIST dataset (e.g., ‘pathmnist’, ‘bloodmnist’, etc.).
output_dir
str
.
The path to the directory where the datasets will be saved.
download_only
bool
False
If True, only download the dataset into the output directory without processing.
save_images
bool
True
If True, save the images into the output directory as .png (2D datasets) or multipage .tiff (3D datasets) files.
Download a dataset using Pooch and save it to the specified output directory, reading file names and checksums from a CSV file.
Type
Default
Details
csv_file
Path to the CSV file containing file names and checksums.
base_url
The base URL from which the files will be downloaded.
output_dir
The directory where the downloaded files will be saved.
processor
NoneType
None
A function to process the downloaded data.
rows
NoneType
None
Specific row indices to download. If None, download all rows.
prepend_mdf5
bool
True
If True, prepend ‘md5:’ to the checksums.
# Specify the directory where you want to save the downloaded filesoutput_directory ="./_test_folder"# Define the base URL for the MSD datasetbase_url ='https://s3.ap-northeast-1.wasabisys.com/gigadb-datasets/live/pub/10.5524/100001_101000/100888/'download_dataset_from_csv('./data_examples/FMD_dataset_info.csv', base_url, output_directory, rows=[6])
The dataset has been successfully downloaded and saved to: ./_test_folder