highspeed-mriqc-group-level.sh 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/usr/bin/bash
  2. # ==============================================================================
  3. # SCRIPT INFORMATION:
  4. # ==============================================================================
  5. # SCRIPT: CREATE GROUP-LEVEL MRIQC REPORTS FOR A BIDS-STRUCTURED DATASET
  6. # ONLY RUN AFTER ALL PARTICIPANT-LEVEL REPORTS ARE FINISHED!
  7. # PROJECT: HIGHSPEED
  8. # WRITTEN BY LENNART WITTKUHN, 2018 - 2020
  9. # CONTACT: WITTKUHN AT MPIB HYPHEN BERLIN DOT MPG DOT DE
  10. # MAX PLANCK RESEARCH GROUP NEUROCODE
  11. # MAX PLANCK INSTITUTE FOR HUMAN DEVELOPMENT (MPIB)
  12. # MAX PLANCK UCL CENTRE FOR COMPUTATIONAL PSYCHIATRY AND AGEING RESEARCH
  13. # LENTZEALLEE 94, 14195 BERLIN, GERMANY
  14. # ACKNOWLEDGEMENT: THANKS TO ALEXANDER SKOWRON AND NIR MONETA @ MPIB FOR HELP
  15. # ==============================================================================
  16. # DEFINE ALL PATHS:
  17. # ==============================================================================
  18. # path to the base directory:
  19. PATH_BASE="${HOME}"
  20. # path to the project root directory
  21. PATH_ROOT="${PATH_BASE}/highspeed"
  22. # define the name of the project:
  23. PROJECT_NAME="highspeed-mriqc"
  24. # define the path to the project folder:
  25. PATH_PROJECT="${PATH_ROOT}/${PROJECT_NAME}"
  26. # define the name of the current task:
  27. TASK_NAME="mriqc"
  28. # define the path to the script main directory:
  29. PATH_CODE="${PATH_PROJECT}/code"
  30. # cd into the directory of the current task:
  31. cd "${PATH_CODE}"
  32. # define the path to the singularity container:
  33. PATH_CONTAINER="${PATH_PROJECT}/tools/${TASK_NAME}/${TASK_NAME}_0.15.2rc1.sif"
  34. # define the path for the templateflow cache
  35. PATH_TEMPLATEFLOW="${PATH_BASE}/.cache/templateflow"
  36. # path to the data directory (in bids format):
  37. PATH_INPUT="${PATH_PROJECT}/bids"
  38. # path to the output directory:
  39. PATH_OUTPUT=${PATH_PROJECT}/${TASK_NAME}
  40. # path to the working directory:
  41. PATH_WORK=${PATH_PROJECT}/work
  42. # path to the log directory:
  43. PATH_LOG=${PATH_PROJECT}/logs
  44. # ==============================================================================
  45. # CREATE RELEVANT DIRECTORIES:
  46. # ==============================================================================
  47. # create working directory:
  48. if [ ! -d ${PATH_WORK} ]
  49. then
  50. mkdir -p ${PATH_WORK}
  51. fi
  52. # create directory for log files:
  53. if [ ! -d ${PATH_LOG} ]
  54. then
  55. mkdir -p ${PATH_LOG}
  56. fi
  57. # ==============================================================================
  58. # RUN MRIQC TO CREATE THE GROUP REPORTS:
  59. # ==============================================================================
  60. # create group reports for the functional data:
  61. singularity run -B ${PATH_INPUT}:/input:ro \
  62. -B ${PATH_OUTPUT}:/output:rw -B ${PATH_WORK}:/work:rw \
  63. -B ${PATH_TEMPLATEFLOW}:/templateflow:rw \
  64. ${PATH_CONTAINER} /input/ /output/ group --no-sub