/How-to-download-IMPAC-dataset-for-autism-detection

This Python script automates the download and verification of fMRI dataset files from the IMPAC dataset, organized by various brain atlases. It ensures data integrity by calculating checksums and extracting files, making dataset acquisition efficient and user-friendly.

Primary LanguageJupyter NotebookMIT LicenseMIT

How-to-download-IMPAC-dataset-for-autism-detection

This Python script facilitates the download and verification of fMRI (functional magnetic resonance imaging) dataset files from the IMPAC (Imaging Modalities, Phenotypes, And Connectomes) dataset. The script is designed to simplify the process of obtaining the IMPAC fMRI dataset by automating the download, integrity check, and extraction of relevant files. The dataset is organized based on various brain atlases, such as 'basc064', 'basc122', 'basc197', 'craddock_scorr_mean', 'harvard_oxford_cort_prob_2mm', 'msdl', and 'power_2011', which represent different parcellations or divisions of the brain.

The script employs a series of functions to achieve its goal:

  1. It calculates the SHA-256 hash of a file to verify its integrity.
  2. It checks if the downloaded file matches the expected checksum and, if valid, extracts the contents of a ZIP archive.
  3. The '_download_fmri_data' function retrieves the dataset ZIP file associated with a chosen atlas.
  4. The '_check_integrity_atlas' function verifies if the downloaded dataset files match the expected files. If not, it triggers a re-download.
  5. The main function, 'fetch_fmri_time_series', takes user input for the desired atlas. It then checks the integrity of the dataset associated with the chosen atlas and initiates the download process if required.

To use the script:

  1. Ensure you have Python installed.
  2. Save the script as a '.py' file (e.g., 'download_impac_fmri.py') in a folder and then copy the data folder and paste it into this folder where you saved the python file.
  3. Open a terminal or command prompt and navigate to the script's directory.
  4. Run the script using: python 'download_impac_fmri.py'.
  5. Choose an atlas by typing its name (e.g., 'basc064', 'all', etc.).
  6. The script will display progress messages, perform the necessary downloads, integrity checks, and extraction.
  7. Once complete, the script will indicate that the download process is finished.