@brainpilot/skills 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +28 -0
  4. package/dist/index.js.map +1 -0
  5. package/package.json +35 -0
  6. package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
  7. package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
  8. package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
  9. package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
  10. package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
  11. package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
  12. package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
  13. package/skills/01_Meta-Skills/share-usage/README.md +63 -0
  14. package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
  15. package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
  16. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
  17. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
  18. package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
  19. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
  20. package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
  21. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
  22. package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
  23. package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
  24. package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
  25. package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
  26. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
  27. package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
  28. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
  29. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
  30. package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
  31. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
  32. package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
  33. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
  34. package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
  35. package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
  36. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
  37. package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
  38. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
  39. package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
  40. package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
  41. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
  42. package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
  43. package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
  44. package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
  45. package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
  46. package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
  47. package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
  48. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
  49. package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
  50. package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
  51. package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
  52. package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
  53. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
  54. package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
  55. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
  56. package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
  57. package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
  58. package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
  59. package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
  60. package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
  61. package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
  62. package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
  63. package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
  64. package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
  65. package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
  66. package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
  67. package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
  68. package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
  69. package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
  70. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
  71. package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  72. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
  73. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
  74. package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
  75. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
  76. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
  77. package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
  78. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
  79. package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
  80. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
  81. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
  82. package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
  83. package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
  84. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
  85. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
  86. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
  87. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
  88. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
  89. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
  90. package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
  91. package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
  92. package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
  93. package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
  94. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
  95. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
  96. package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
  97. package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
  98. package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
  99. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
  100. package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
  101. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
  102. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
  103. package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
  104. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
  105. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
  106. package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
  107. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
  108. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
  109. package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
  110. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
  111. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
  112. package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
  113. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
  114. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
  115. package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
  116. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
  117. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
  118. package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
  119. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
  120. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
  121. package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
  122. package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
  123. package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
  124. package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
  125. package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
  126. package/skills/13_Visualization/nature-figure/README.md +442 -0
  127. package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
  128. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
  129. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
  130. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
  131. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
  132. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
  133. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
  134. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
  135. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
  136. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
  137. package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
  138. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
  139. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
  140. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
  141. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
  142. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
  143. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
  144. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
  145. package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
  146. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
  147. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
  148. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
  149. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
  150. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
  151. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
  152. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
  153. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
  154. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
  155. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
  156. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
  157. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
  158. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
  159. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
  160. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
  161. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
  162. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
  163. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
  164. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
  165. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
  166. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
  167. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
  168. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
  169. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
  170. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
  171. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
  172. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
  173. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
  174. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
  175. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
  176. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
  177. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
  178. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
  179. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
  180. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
  181. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
  182. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
  183. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
  184. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
  185. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
  186. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
  187. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
  188. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
  189. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
  190. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
  191. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
  192. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
  193. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
  194. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
  195. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
  196. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
  197. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
  198. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
  199. package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
  200. package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
  201. package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
  202. package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
  203. package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
  204. package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
  205. package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
  206. package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
  207. package/skills/13_Visualization/nature-figure/references/api.md +428 -0
  208. package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
  209. package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
  210. package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
  211. package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
  212. package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
  213. package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
  214. package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
  215. package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
  216. package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
  217. package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
  218. package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
  219. package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
  220. package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
  221. package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
  222. package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
  223. package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
  224. package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
  225. package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
  226. package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
  227. package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
  228. package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
  229. package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
@@ -0,0 +1,380 @@
1
+ # Step-by-Step fMRI Preprocessing Pipeline
2
+
3
+ This reference document provides detailed parameter tables, software-specific guidance, and processing order diagrams for each preprocessing step. It supplements the core decision logic in `SKILL.md`.
4
+
5
+ ---
6
+
7
+ ## Step 1: DICOM to NIfTI Conversion and BIDS Organization
8
+
9
+ ### Why BIDS?
10
+
11
+ The Brain Imaging Data Structure (BIDS; Gorgolewski et al., 2016) is essential for reproducible neuroimaging. fMRIPrep, MRIQC, and other automated tools require BIDS-formatted input.
12
+
13
+ ### Expected BIDS Directory Structure
14
+
15
+ ```
16
+ dataset/
17
+ sub-01/
18
+ anat/
19
+ sub-01_T1w.nii.gz
20
+ sub-01_T1w.json
21
+ func/
22
+ sub-01_task-rest_bold.nii.gz
23
+ sub-01_task-rest_bold.json
24
+ sub-01_task-rest_events.tsv
25
+ fmap/
26
+ sub-01_dir-AP_epi.nii.gz
27
+ sub-01_dir-PA_epi.nii.gz
28
+ sub-01_dir-AP_epi.json
29
+ sub-01_dir-PA_epi.json
30
+ ```
31
+
32
+ ### Software-Specific Guidance
33
+
34
+ | Tool | Command Example | Notes |
35
+ |---|---|---|
36
+ | `dcm2niix` | `dcm2niix -b y -z y -o output_dir input_dir` | Recommended; preserves all metadata in JSON sidecar |
37
+ | `heudiconv` | `heudiconv -d {subject}/* -s 01 -c dcm2niix -o bids_dir -f heuristic.py` | Automates BIDS naming with heuristic files |
38
+ | `BIDScoin` | GUI-based mapping | User-friendly for complex protocols |
39
+
40
+ ### What Happens If You Skip This Step
41
+
42
+ Without BIDS organization, automated tools like fMRIPrep cannot run. Manual pipelines will lack standardized metadata, making it difficult to detect acquisition parameters (TR, slice timing, phase-encoding direction) automatically.
43
+
44
+ ---
45
+
46
+ ## Step 2: Non-Steady-State Volume Removal
47
+
48
+ ### Detailed Parameters
49
+
50
+ | Parameter | Value | Source |
51
+ |---|---|---|
52
+ | Volumes to discard | **3-5** (or until signal stabilizes) | Poldrack et al., 2011, Ch. 5 |
53
+ | Time equivalent | ~5-15 seconds depending on TR | Standard practice |
54
+ | Detection method | Signal intensity in first volumes >> subsequent volumes | fMRIPrep automatic detection |
55
+
56
+ ### Software-Specific Guidance
57
+
58
+ | Tool | Implementation |
59
+ |---|---|
60
+ | **fMRIPrep** | Automatic detection and flagging via `non_steady_state_outlier_XX` columns in confounds TSV |
61
+ | **FSL** | Manual: remove volumes with `fslroi input output 5 -1` (skips first 5) |
62
+ | **SPM** | Set "Images to remove" in the batch editor before any preprocessing |
63
+ | **AFNI** | `3dTcat -prefix output input'[5..$]'` (removes first 5 volumes) |
64
+
65
+ ### What Happens If You Skip This Step
66
+
67
+ Non-steady-state volumes have artificially high signal intensity. If retained, they bias the mean image (used as motion correction reference), inflate temporal variance, and can introduce artifacts in motion parameter estimates.
68
+
69
+ ---
70
+
71
+ ## Step 3: Slice Timing Correction — Detailed Parameters
72
+
73
+ ### Parameters by Acquisition Type
74
+
75
+ | Acquisition | Slice Order | STC Reference Slice | Notes |
76
+ |---|---|---|---|
77
+ | Sequential ascending | 1, 2, 3, ... N | Middle slice (N/2) | Simple; less common in modern protocols |
78
+ | Sequential descending | N, N-1, ... 1 | Middle slice (N/2) | Less common |
79
+ | Interleaved (odd first) | 1, 3, 5, ... 2, 4, 6, ... | Middle slice | SPM/FSL default for interleaved |
80
+ | Interleaved (even first) | 2, 4, 6, ... 1, 3, 5, ... | Middle slice | Check scanner documentation |
81
+ | Multiband/SMS | Multiple slices simultaneously | Use slice timings, not slice order | Slice order cannot represent simultaneous slices |
82
+
83
+ ### Software-Specific Guidance
84
+
85
+ | Tool | Implementation | Key Parameter |
86
+ |---|---|---|
87
+ | **fMRIPrep** | Automatic if BIDS metadata includes `SliceTiming` field | Reads from JSON sidecar |
88
+ | **FSL** (`slicetimer`) | `slicetimer -i input -o output -r TR --tcustom=timings.txt` | Custom timing file for multiband |
89
+ | **SPM** | Slice Timing module in batch editor | Specify slice order and reference slice |
90
+ | **AFNI** (`3dTshift`) | `3dTshift -tpattern alt+z -prefix output input` | Pattern: alt+z (interleaved), seq+z (sequential) |
91
+
92
+ ### When to Definitely Skip STC
93
+
94
+ - **TR < 0.5 seconds**: Common STC interpolation methods provide negligible benefit (Sladky et al., 2011). Even newer methods (e.g., filter-shift) show minimal improvement at very short TRs
95
+ - **No accurate slice timing information available**: STC with wrong parameters is worse than no STC
96
+ - **Using only temporal derivatives in GLM**: The temporal derivative of the HRF can absorb timing shifts of approximately +/- 1 second (Henson et al., 2002), partially compensating for slice timing differences
97
+
98
+ ### What Happens If You Skip This Step
99
+
100
+ Without STC, the temporal offset between first and last slices introduces a systematic timing error. For a TR of 2 seconds with interleaved acquisition, the last slice is offset by nearly 2 seconds from the first. This reduces statistical power for event-related designs and can bias estimates of hemodynamic response timing (Sladky et al., 2011).
101
+
102
+ ---
103
+
104
+ ## Step 4: Motion Correction — Detailed Parameters
105
+
106
+ ### MCFLIRT (FSL) Parameters
107
+
108
+ | Parameter | Default | Recommended | Notes |
109
+ |---|---|---|---|
110
+ | Reference volume | Middle volume | Mean image after initial pass | Mean is more representative (Jenkinson et al., 2002) |
111
+ | Cost function | Normalized correlation | Normalized correlation | Robust for intra-modal EPI-to-EPI |
112
+ | Search stages | 8 mm, then 4 mm (x2) | Default | Three-stage coarse-to-fine optimization |
113
+ | Interpolation (estimation) | Trilinear | Trilinear | Fast; adequate for parameter estimation |
114
+ | Interpolation (final reslice) | Trilinear | **Sinc** (--sinc_final) | Reduces blurring in output images |
115
+ | DOF | 6 (rigid body) | 6 (rigid body) | Never use higher DOF for within-subject motion |
116
+
117
+ ### Software Comparison
118
+
119
+ | Tool | Algorithm | Key Feature |
120
+ |---|---|---|
121
+ | **FSL MCFLIRT** | Cost-function optimized rigid body | Three-stage optimization; robust to local minima (Jenkinson et al., 2002) |
122
+ | **SPM Realign** | Least squares rigid body | Iterative resampling to mean image |
123
+ | **AFNI 3dvolreg** | Iterated linearized weighted least-squares | Fast; supports multiple cost functions |
124
+ | **ANTs** | Symmetric normalization (rigid) | Used by fMRIPrep for high-quality registration |
125
+ | **fMRIPrep** | MCFLIRT (default) or ANTs | Automatically selects based on data characteristics |
126
+
127
+ ### Output: Motion Parameters
128
+
129
+ The 6 rigid-body parameters should be saved and used as confound regressors:
130
+
131
+ | Parameter | Unit | Typical Range (good data) | Concern Threshold |
132
+ |---|---|---|---|
133
+ | Translation X (left/right) | mm | < 1 mm total range | > 3 mm (Poldrack et al., 2011) |
134
+ | Translation Y (anterior/posterior) | mm | < 1 mm total range | > 3 mm |
135
+ | Translation Z (superior/inferior) | mm | < 1 mm total range | > 3 mm |
136
+ | Rotation pitch (around X) | radians | < 0.02 rad (~1 degree) | > 0.05 rad |
137
+ | Rotation roll (around Y) | radians | < 0.02 rad | > 0.05 rad |
138
+ | Rotation yaw (around Z) | radians | < 0.02 rad | > 0.05 rad |
139
+
140
+ ### What Happens If You Skip This Step
141
+
142
+ Without motion correction, even small head movements (1-2 mm) produce signal changes that are larger than the BOLD effect (~1-3% signal change). Motion artifacts are the single largest source of false positives in fMRI (Power et al., 2012).
143
+
144
+ ---
145
+
146
+ ## Step 5: Distortion Correction — Detailed Parameters
147
+
148
+ ### Method Comparison
149
+
150
+ | Method | Data Required | Accuracy | Software | When to Use |
151
+ |---|---|---|---|---|
152
+ | **TOPUP** (reverse PE) | Opposite-PE EPI pair (e.g., AP + PA blip-up/blip-down) | **High** | FSL TOPUP | Preferred when opposite-PE data available (Andersson et al., 2003) |
153
+ | **FUGUE** (fieldmap) | Dual-echo gradient-echo magnitude + phase images | **High** | FSL FUGUE | When GRE fieldmap was acquired (Jezzard & Balaban, 1995) |
154
+ | **SyN-SDC** (fieldmapless) | T1-weighted structural only | **Moderate** | ANTs / fMRIPrep | Fallback when no fieldmap data exists |
155
+ | **3dQwarp** | Opposite-PE pair | **High** | AFNI | AFNI pipeline equivalent of TOPUP |
156
+
157
+ ### TOPUP Parameters (FSL)
158
+
159
+ ```
160
+ # Example TOPUP configuration
161
+ topup --imain=AP_PA_blips --datain=acqparams.txt --config=b02b0.cnf --out=topup_results
162
+ applytopup --imain=AP_bold,PA_bold --topup=topup_results --datain=acqparams.txt --method=jac --out=corrected
163
+ ```
164
+
165
+ The `acqparams.txt` file specifies phase-encoding direction and total readout time. These values **must** match the actual acquisition parameters.
166
+
167
+ ### Regions Most Affected by Distortion
168
+
169
+ | Brain Region | Proximity to Air-Tissue Interface | Typical Displacement | Impact |
170
+ |---|---|---|---|
171
+ | Orbitofrontal cortex | Paranasal sinuses | **Several mm** | Signal loss and mislocalization in reward/decision studies |
172
+ | Anterior temporal lobe | Ear canals, mastoid | **Several mm** | Affects memory and language studies |
173
+ | Inferior temporal lobe | Sphenoid sinus | Moderate | Affects face perception and object recognition studies |
174
+ | Brainstem | Surrounding bone | Moderate | Affects autonomic and arousal studies |
175
+
176
+ ### What Happens If You Skip This Step
177
+
178
+ Without distortion correction, functional images are geometrically distorted along the phase-encoding direction. This causes: (1) misregistration with the T1 structural image, (2) mislocalization of functional activations after normalization, and (3) signal pileup and signal void in affected regions. The impact is most severe for studies targeting orbitofrontal, temporal, and brainstem regions (Jezzard & Balaban, 1995).
179
+
180
+ ---
181
+
182
+ ## Step 6: Coregistration — Detailed Parameters
183
+
184
+ ### Boundary-Based Registration (BBR)
185
+
186
+ BBR (Greve & Fischl, 2009) is the recommended method for EPI-to-T1 coregistration:
187
+
188
+ | Parameter | Value | Notes |
189
+ |---|---|---|
190
+ | Cost function | BBR (boundary-based) | Uses WM boundary; more robust than mutual information for EPI-T1 |
191
+ | Input | Distortion-corrected mean EPI | Apply distortion correction before coregistration |
192
+ | Reference | Skull-stripped T1 | Brain extraction must be accurate |
193
+ | DOF | 6 (rigid body) | EPI and T1 are from the same subject/session |
194
+ | Initialization | FLIRT 6-DOF (schedule=bbr.sch) | BBR refines initial FLIRT alignment |
195
+
196
+ ### Software-Specific Guidance
197
+
198
+ | Tool | Method | Command |
199
+ |---|---|---|
200
+ | **fMRIPrep** | BBR (via FreeSurfer + FSL) | Automatic |
201
+ | **FSL** | `flirt -cost bbr -wmseg wm_seg -schedule bbr.sch` | Requires WM segmentation |
202
+ | **SPM** | `Coregister: Estimate` with mutual information | Less robust than BBR for EPI |
203
+ | **FreeSurfer** | `bbregister --bold --mov func.nii --s subject --init-fsl` | Excellent for surface-based analyses |
204
+
205
+ ### What Happens If You Skip This Step
206
+
207
+ Without coregistration, functional and structural images are in different coordinate spaces. Normalization to MNI space via the structural image becomes impossible, and anatomical labeling of functional results is inaccurate.
208
+
209
+ ---
210
+
211
+ ## Step 7: Spatial Normalization — Detailed Parameters
212
+
213
+ ### Normalization Methods
214
+
215
+ | Method | Software | Quality | Speed | Source |
216
+ |---|---|---|---|---|
217
+ | **ANTs SyN** | ANTs / fMRIPrep | **Excellent** | Slow (~1-2 hr/subject) | Avants et al., 2008 |
218
+ | **Unified Segmentation** | SPM | Good | Moderate | Ashburner & Friston, 2005 |
219
+ | **DARTEL** | SPM | **Excellent** | Slow (study-specific template) | Ashburner, 2007 |
220
+ | **FNIRT** | FSL | Good | Moderate | Andersson et al., 2007 |
221
+
222
+ ### Template Spaces
223
+
224
+ | Template | Resolution | When to Use | Source |
225
+ |---|---|---|---|
226
+ | **MNI152NLin2009cAsym** | 1 mm | fMRIPrep default; current standard | Fonov et al., 2011 |
227
+ | **MNI152NLin6Asym** | 1 mm | FSL default (MNI152 6th generation) | FSL convention |
228
+ | **MNI152Lin** | 2 mm | Legacy; older SPM analyses | Older convention |
229
+ | **fsaverage** | Surface | Surface-based group analyses (FreeSurfer) | Fischl et al., 1999 |
230
+ | **fsLR** | Surface | HCP-style surface analyses | Van Essen et al., 2012 |
231
+
232
+ ### Output Resolution
233
+
234
+ | Analysis | Recommended Output Voxel Size | Rationale |
235
+ |---|---|---|
236
+ | Standard group analysis | **2 mm isotropic** | Matches template resolution; balances detail and file size |
237
+ | High-resolution studies | **1-1.5 mm isotropic** | Preserves spatial detail for laminar or columnar analysis |
238
+ | ROI-based analysis | **2 mm isotropic** | Standard; ROIs average over voxels anyway |
239
+ | Connectivity with small ROIs | **2 mm isotropic** | Smaller voxels preserve signal in small subcortical structures |
240
+
241
+ ### What Happens If You Skip This Step
242
+
243
+ Without normalization, each subject's brain is in its own native space. Group-level analyses (second-level GLM, group connectivity maps) are impossible because there is no common coordinate system. Subject-level analyses in native space are valid but results cannot be reported in standard coordinates.
244
+
245
+ ---
246
+
247
+ ## Step 8: Spatial Smoothing — Detailed Parameters
248
+
249
+ ### Kernel Size Recommendations
250
+
251
+ | Voxel Size | Analysis Type | FWHM | Result | Source |
252
+ |---|---|---|---|---|
253
+ | 2 mm | Univariate group | **6 mm** | 3x voxel size; good SNR gain | Mikl et al., 2008 |
254
+ | 3 mm | Univariate group | **6-8 mm** | 2-3x voxel size; standard | Poldrack et al., 2011 |
255
+ | 2 mm | Resting-state connectivity | **4-6 mm** | Moderate smoothing | Ciric et al., 2017 |
256
+ | 2 mm | MVPA | **0 mm (none)** | Preserve spatial patterns | Misaki et al., 2013 |
257
+ | 1.5 mm | High-resolution | **3-4 mm** | 2x voxel size; preserve resolution | Matched filter theorem |
258
+ | Any | Searchlight | **0 mm (none)** | Searchlight provides spatial averaging | Etzel et al., 2013 |
259
+
260
+ ### Software-Specific Guidance
261
+
262
+ | Tool | Command | Notes |
263
+ |---|---|---|
264
+ | **FSL** | `fslmaths input -s 2.548 output` | FSL uses sigma, not FWHM: sigma = FWHM / 2.355 |
265
+ | **SPM** | Smooth module: set FWHM [6 6 6] | Specify FWHM in mm for each axis |
266
+ | **AFNI** | `3dmerge -1blur_fwhm 6 -prefix output input` | Specify FWHM directly |
267
+ | **Nilearn** | `smooth_img(img, fwhm=6)` | Python; can also specify per-axis |
268
+ | **fMRIPrep** | Does NOT smooth | Smoothing is intentionally left to the user |
269
+
270
+ ### Smoothing and Random Field Theory (RFT)
271
+
272
+ For cluster-based inference using RFT (Worsley et al., 1996), the data must be sufficiently smooth. The smoothness estimation assumes a minimum smoothness of approximately 2-3 voxel FWHM. Applying a kernel of at least 2x voxel size ensures this assumption is met. If data are already smooth (e.g., after normalization and resampling), additional smoothing may not be needed for RFT validity, but this should be verified.
273
+
274
+ ### What Happens If You Skip This Step
275
+
276
+ Without smoothing for univariate analyses: (1) SNR is lower, reducing power; (2) inter-subject anatomical variability is not compensated, reducing group-level sensitivity; (3) RFT assumptions may be violated, leading to invalid cluster-based inference. However, skipping smoothing is correct and necessary for MVPA.
277
+
278
+ ---
279
+
280
+ ## Complete Pipeline Processing Order Diagram
281
+
282
+ ### Standard Task fMRI Pipeline
283
+
284
+ ```
285
+ Raw DICOM data
286
+ |
287
+ v
288
+ [1] DICOM to NIfTI (dcm2niix) + BIDS organization
289
+ |
290
+ v
291
+ [2] Remove non-steady-state volumes (first 3-5 TRs)
292
+ |
293
+ v
294
+ [3] Slice timing correction (if TR > 1 s)
295
+ | - Reference: middle slice
296
+ | - Interpolation: sinc or Fourier
297
+ |
298
+ v
299
+ [4] Motion correction (6-DOF rigid body)
300
+ | - Reference: mean image
301
+ | - Save 6 motion parameters
302
+ | - Calculate FD and DVARS
303
+ |
304
+ v
305
+ [5] Distortion correction (TOPUP or FUGUE)
306
+ | - Requires fieldmap or opposite-PE data
307
+ |
308
+ v
309
+ [6] Coregistration (EPI to T1)
310
+ | - Method: BBR (Greve & Fischl, 2009)
311
+ |
312
+ v
313
+ [7] Spatial normalization (to MNI space)
314
+ | - Method: ANTs SyN or SPM unified segmentation
315
+ | - Output: 2 mm isotropic
316
+ |
317
+ v
318
+ [8] Smoothing (FWHM = 2-3x voxel size)
319
+ | - SKIP for MVPA
320
+ |
321
+ v
322
+ Preprocessed BOLD data (ready for GLM)
323
+ + Confound time series (motion, FD, DVARS, CompCor)
324
+ ```
325
+
326
+ ### Resting-State Connectivity Pipeline Additions
327
+
328
+ After the standard pipeline, resting-state analyses typically add:
329
+
330
+ ```
331
+ Preprocessed BOLD data
332
+ |
333
+ v
334
+ [9] Confound regression
335
+ | - 24-parameter motion model (Friston et al., 1996)
336
+ | - aCompCor: 5-6 WM/CSF components (Behzadi et al., 2007)
337
+ | - Optional: global signal regression (Murphy & Fox, 2017)
338
+ | - Spike regressors for FD > 0.2 mm (Power et al., 2014)
339
+ |
340
+ v
341
+ [10] Temporal filtering
342
+ | - Band-pass: 0.01-0.1 Hz (for connectivity)
343
+ | - OR high-pass only: 0.01 Hz (if GSR applied)
344
+ |
345
+ v
346
+ [11] Scrubbing / censoring
347
+ | - Remove volumes with FD > 0.2 mm + 1 volume before + 2 after
348
+ | - Require minimum 5 minutes of clean data (Power et al., 2014)
349
+ |
350
+ v
351
+ Cleaned BOLD data (ready for connectivity analysis)
352
+ ```
353
+
354
+ ---
355
+
356
+ ## Key References for This Document
357
+
358
+ - Andersson, J. L. R., Skare, S., & Ashburner, J. (2003). How to correct susceptibility distortions in spin-echo echo-planar images. *NeuroImage*, 20(2), 870-888.
359
+ - Ashburner, J. (2007). A fast diffeomorphic image registration algorithm. *NeuroImage*, 38(1), 95-113.
360
+ - Ashburner, J., & Friston, K. J. (2005). Unified segmentation. *NeuroImage*, 26(3), 839-851.
361
+ - Avants, B. B., Epstein, C. L., Grossman, M., & Gee, J. C. (2008). Symmetric diffeomorphic image registration with cross-correlation. *Medical Image Analysis*, 12(1), 26-41.
362
+ - Behzadi, Y., Restom, K., Liau, J., & Liu, T. T. (2007). A component based noise correction method (CompCor). *NeuroImage*, 37(1), 90-101.
363
+ - Ciric, R., Wolf, D. H., Power, J. D., et al. (2017). Benchmarking confound regression strategies. *NeuroImage*, 154, 174-187.
364
+ - Etzel, J. A., Zacks, J. M., & Braver, T. S. (2013). Searchlight analysis: promise, pitfalls, and potential. *NeuroImage*, 78, 261-269.
365
+ - Fonov, V. S., Evans, A. C., Botteron, K., et al. (2011). Unbiased average age-appropriate atlases for pediatric studies. *NeuroImage*, 54(1), 313-327.
366
+ - Friston, K. J., Williams, S., Howard, R., et al. (1996). Movement-related effects in fMRI time-series. *Magnetic Resonance in Medicine*, 35(3), 346-355.
367
+ - Gorgolewski, K. J., et al. (2016). The brain imaging data structure. *Scientific Data*, 3, 160044.
368
+ - Greve, D. N., & Fischl, B. (2009). Accurate and robust brain image alignment using boundary-based registration. *NeuroImage*, 48(1), 63-72.
369
+ - Henson, R. N. A., et al. (2002). Detecting latency differences in event-related BOLD responses. *NeuroImage*, 15(1), 83-97.
370
+ - Jenkinson, M., Bannister, P., Brady, J. M., & Smith, S. M. (2002). Improved optimization for the robust and accurate linear registration and motion correction of brain images. *NeuroImage*, 17(2), 825-841.
371
+ - Jezzard, P., & Balaban, R. S. (1995). Correction for geometric distortion in echo planar images from B0 field variations. *Magnetic Resonance in Medicine*, 34(1), 65-73.
372
+ - Mikl, M., et al. (2008). Effects of spatial smoothing on fMRI group inferences. *Magnetic Resonance Imaging*, 26(4), 490-503.
373
+ - Misaki, M., Luh, W. M., & Bandettini, P. A. (2013). The effect of spatial smoothing on fMRI decoding. *NeuroImage*, 78, 13-22.
374
+ - Murphy, K., & Fox, M. D. (2017). Towards a consensus regarding global signal regression. *NeuroImage*, 154, 169-173.
375
+ - Parker, D. B., & Razlighi, Q. R. (2019). The benefit of slice timing correction in common fMRI preprocessing pipelines. *Frontiers in Neuroscience*, 13, 821.
376
+ - Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of Functional MRI Data Analysis*. Cambridge University Press.
377
+ - Power, J. D., et al. (2012). Spurious but systematic correlations in functional connectivity MRI networks arise from subject motion. *NeuroImage*, 59(3), 2142-2154.
378
+ - Power, J. D., et al. (2014). Methods to detect, characterize, and remove motion artifact in resting state fMRI. *NeuroImage*, 84, 320-341.
379
+ - Sladky, R., et al. (2011). Slice-timing effects and their correction in functional MRI. *NeuroImage*, 58(2), 588-594.
380
+ - Worsley, K. J., et al. (1996). A unified statistical approach for determining significant signals in images of cerebral activation. *Human Brain Mapping*, 4(1), 58-73.
@@ -0,0 +1,264 @@
1
+ ---
2
+ name: "fmri-task-design-guide"
3
+ description: "Guides fMRI task design: block vs. event-related vs. mixed; jittering; contrasts; power for BOLD detection"
4
+ domain: "cognitive-neuroscience"
5
+ version: "1.0.0"
6
+ authors:
7
+ - "awesome_cognitive_and_neuroscience_skills contributors"
8
+ papers:
9
+ - "Friston et al., 1999"
10
+ - "Petersen & Dubis, 2012"
11
+ - "Dale, 1999"
12
+ - "Bandettini et al., 1993"
13
+ - "Glover, 1999"
14
+ - "Desmond & Glover, 2002"
15
+ - "Wager & Nichols, 2003"
16
+ dependencies:
17
+ required:
18
+ - research-literacy
19
+ recommended:
20
+ - fmri-glm-analysis-guide
21
+ - fmri-preprocessing-pipeline-guide
22
+ review_status: "ai-generated"
23
+ ---
24
+
25
+ # fMRI Task Design Guide
26
+
27
+ ## Purpose
28
+
29
+ The experimental design is the single most important determinant of an fMRI study's statistical power, interpretability, and scientific value. Choosing between block, event-related, and mixed designs involves trade-offs between detection power and estimation efficiency that depend on the research question. Similarly, the choice of inter-stimulus interval (ISI), jittering strategy, condition ordering, and trial count directly determines whether the BOLD signal of interest can be reliably detected.
30
+
31
+ A competent programmer without neuroimaging training would not know that block designs provide higher detection power but cannot estimate HRF shape, that exponentially distributed jitter is more efficient than uniform jitter, or that the BOLD response takes 12-16 seconds to return to baseline. This skill encodes those domain-specific design decisions.
32
+
33
+ ## When to Use This Skill
34
+
35
+ - Planning a new task-based fMRI experiment
36
+ - Choosing between block, event-related, or mixed designs
37
+ - Optimizing inter-stimulus interval and jittering strategy
38
+ - Calculating design efficiency for contrast detection
39
+ - Determining minimum trial counts per condition
40
+ - Integrating behavioral task constraints with fMRI timing requirements
41
+ - Reviewing or troubleshooting an existing fMRI task design
42
+
43
+ ## Research Planning Protocol
44
+
45
+ Before executing the domain-specific steps below, you MUST:
46
+
47
+ 1. **State the research question** — What specific question is this analysis/paradigm addressing?
48
+ 2. **Justify the method choice** — Why is this approach appropriate? What alternatives were considered?
49
+ 3. **Declare expected outcomes** — What results would support vs. refute the hypothesis?
50
+ 4. **Note assumptions and limitations** — What does this method assume? Where could it mislead?
51
+ 5. **Present the plan to the user and WAIT for confirmation** before proceeding.
52
+
53
+ For detailed methodology guidance, see the `research-literacy` skill.
54
+
55
+
56
+ ## ⚠️ Verification Notice
57
+
58
+ This skill was generated by AI from academic literature. All parameters, thresholds, and citations require independent verification before use in research. If you find errors, please [open an issue](https://github.com/HaoxuanLiTHUAI/awesome_cognitive_and_neuroscience_skills/issues).
59
+
60
+ ## Design Type Selection
61
+
62
+ ### Comparison of Design Types
63
+
64
+ | Design Type | Detection Power | Estimation Efficiency | Trial-Level Analysis | Best For | Source |
65
+ |---|---|---|---|---|---|
66
+ | Block | **High** | Low | No | Detecting whether a region is active | Friston et al., 1999; Petersen & Dubis, 2012 |
67
+ | Event-related (slow) | Moderate | **High** | Yes | Estimating HRF shape | Dale, 1999 |
68
+ | Rapid event-related | Moderate-High | Moderate-High | Yes | Flexible trial-by-trial analysis with good power | Dale, 1999; Friston et al., 1999 |
69
+ | Mixed (hybrid) | High (sustained) + Moderate (transient) | Moderate | Yes (transient component) | Separating sustained and transient effects | Petersen & Dubis, 2012 |
70
+
71
+ ### Decision Tree
72
+
73
+ ```
74
+ What is the primary goal?
75
+ |
76
+ +-- Detect presence/absence of activation (localization)
77
+ | |
78
+ | +-- Is HRF shape estimation needed?
79
+ | |
80
+ | +-- NO --> Block design (maximum detection power)
81
+ | |
82
+ | +-- YES --> Mixed design (blocks + events within blocks)
83
+ |
84
+ +-- Estimate trial-by-trial neural responses
85
+ | |
86
+ | +-- Are there enough trials (>40 per condition)?
87
+ | |
88
+ | +-- YES --> Rapid event-related design (jittered ISI)
89
+ | |
90
+ | +-- NO --> Slow event-related design (ISI > 12 s)
91
+ |
92
+ +-- Separate sustained state vs. transient item effects
93
+ --> Mixed design (Petersen & Dubis, 2012)
94
+ ```
95
+
96
+ ## Block Design Parameters
97
+
98
+ - **Optimal block duration**: **15-20 seconds** for maximum detection power (Maus et al., 2010; Bandettini et al., 1993). Shorter blocks (< 12 s) reduce sensitivity because the BOLD response does not reach steady state. Longer blocks (> 30 s) increase habituation and strategy effects (Poldrack et al., 2011, Ch. 3)
99
+ - **Minimum block duration**: **12 seconds** to allow the BOLD signal to reach near-plateau (Bandettini et al., 1993)
100
+ - **Number of blocks per condition**: At least **4-6 blocks** per condition per run for stable estimates (Poldrack et al., 2011, Ch. 3)
101
+ - **Condition alternation**: Alternate conditions (ABAB or ABCABC) rather than grouping (AAABBB), which confounds condition with time (Poldrack et al., 2011, Ch. 3)
102
+ - **Rest blocks**: Include rest/fixation blocks of at least **12-16 seconds** between active blocks to allow BOLD signal return to baseline (Glover, 1999)
103
+
104
+ ## Event-Related Design Parameters
105
+
106
+ ### Inter-Stimulus Interval (ISI) and Jittering
107
+
108
+ The ISI between events is critical for statistical efficiency and BOLD signal separability.
109
+
110
+ | Parameter | Recommendation | Source |
111
+ |---|---|---|
112
+ | Minimum ISI | **2-4 seconds** (for partial BOLD recovery) | Dale, 1999; Glover, 1999 |
113
+ | Mean ISI for rapid designs | **4-6 seconds** | Dale, 1999 |
114
+ | ISI range for jittered designs | **2-8 seconds** | Dale, 1999; Wager & Nichols, 2003 |
115
+ | Null/fixation trials | **20-33%** of total events | Friston et al., 1999 |
116
+
117
+ **Jittering strategies** (from most to least recommended):
118
+
119
+ 1. **Optimized sequences**: Use design optimization tools (optseq2, NeuroDesign) to maximize efficiency for specific contrasts (Dale, 1999; Durnez et al., 2017)
120
+ 2. **Truncated exponential distribution**: More short ISIs, fewer long ISIs; near-optimal efficiency (Hagberg et al., 2001)
121
+ 3. **Uniform random**: Equal probability across ISI range; acceptable but suboptimal
122
+ 4. **Fixed ISI**: Avoid for rapid event-related designs; severely reduces design efficiency
123
+
124
+ **Domain warning**: Jittered designs can be over **10x more efficient** than fixed-ISI designs with the same mean interval (Dale, 1999). Always jitter for event-related fMRI.
125
+
126
+ ### HRF Timing Constraints
127
+
128
+ The BOLD hemodynamic response imposes hard constraints on fMRI design timing:
129
+
130
+ - **HRF peak**: **4-6 seconds** after neural event onset (Glover, 1999)
131
+ - **Return to baseline**: **12-16 seconds** after a brief event (Glover, 1999)
132
+ - **BOLD nonlinearity**: Responses to stimuli separated by < **2 seconds** sum nonlinearly (reduced amplitude), making them harder to separate (Glover, 1999; Wager & Nichols, 2003)
133
+
134
+ ### Trial Count Requirements
135
+
136
+ | Design Type | Minimum Trials per Condition | Recommended Trials | Source |
137
+ |---|---|---|---|
138
+ | Event-related (detection) | **20** | 30-50 | Desmond & Glover, 2002 |
139
+ | Event-related (HRF estimation) | **30** | 50+ | Murphy & Garavan, 2005 |
140
+ | Rapid event-related | **30** | 40-60 | Desmond & Glover, 2002 |
141
+ | FIR/deconvolution | **40+** | 60+ | Glover, 1999 |
142
+
143
+ **Domain insight**: These are per-condition minimums. If comparing conditions (A vs. B), each condition needs this many trials. More conditions require longer scan sessions or fewer trials per condition, creating a power trade-off.
144
+
145
+ ## Design Efficiency
146
+
147
+ ### Efficiency Calculation
148
+
149
+ Design efficiency quantifies how well a given design matrix allows detection of specific contrasts:
150
+
151
+ ```
152
+ Detection efficiency = 1 / trace(c' * inv(X'X) * c)
153
+ ```
154
+
155
+ where **c** is the contrast vector and **X** is the design matrix (Dale, 1999; Liu et al., 2001).
156
+
157
+ ### Detection vs. Estimation Trade-off
158
+
159
+ - **Detection power**: Ability to detect whether an effect exists. Maximized by block designs and rapid event-related designs with high event density (Liu et al., 2001)
160
+ - **Estimation efficiency**: Ability to accurately characterize the HRF shape. Maximized by jittered designs with sufficient ISI variability (Liu et al., 2001)
161
+ - These are inherently in tension: block designs maximize detection but cannot estimate HRF shape
162
+
163
+ ### Design Optimization Tools
164
+
165
+ - **optseq2** (FreeSurfer): Optimizes event ordering and null events for maximum efficiency (Dale, 1999)
166
+ - **NeuroDesign** (Python): Genetic algorithm-based optimization (Durnez et al., 2017)
167
+ - **fMRIpower**: Power calculations accounting for design and temporal autocorrelation (Mumford & Nichols, 2008)
168
+
169
+ ## Mixed Design Specification
170
+
171
+ Mixed designs combine sustained (block-level) and transient (event-level) components (Petersen & Dubis, 2012):
172
+
173
+ 1. **Sustained regressor**: Models the tonic task state (e.g., "task block on" vs. "rest"), boxcar convolved with HRF
174
+ 2. **Transient regressors**: Model individual trial onsets within each block, convolved with HRF
175
+ 3. These regressors are separable because they operate at different temporal frequencies
176
+
177
+ **Key parameters**:
178
+ - Block duration: **20-40 seconds** to provide enough events within each block (Petersen & Dubis, 2012)
179
+ - Events per block: At least **4-6** for stable transient estimates
180
+ - Inter-block rest: **16-20 seconds** minimum for BOLD signal recovery (Glover, 1999)
181
+
182
+ ## Scanner-Related Timing Constraints
183
+
184
+ | Constraint | Guideline | Rationale |
185
+ |---|---|---|
186
+ | TR synchronization | Stimulus onsets need not align with TR boundaries for event-related designs | Jittered onsets relative to TR improve temporal sampling of HRF |
187
+ | Trigger pulses | Start experiment on scanner trigger pulse (TTL signal) | Ensures precise alignment between stimulus and acquisition timing |
188
+ | Total scan duration | **5-15 minutes per run** | Longer runs increase motion and fatigue; shorter runs waste setup time (Poldrack et al., 2011, Ch. 3) |
189
+ | Number of runs | **2-4 runs** typical; split conditions across runs if needed | Allows rest between runs; run-level effects can be modeled |
190
+ | Dummy scans | First **3-5 TRs** (5-10 s) are T1 equilibration artifacts | Discard or model as confounds (Poldrack et al., 2011, Ch. 5) |
191
+
192
+ ## Rest/Fixation Baseline
193
+
194
+ - Allocate **25-30%** of total scan time to rest/fixation baseline (Friston et al., 1999)
195
+ - Rest periods serve dual purpose: allow BOLD signal recovery and provide baseline estimate
196
+ - For block designs, rest blocks of **12-16 seconds** between active blocks (Glover, 1999)
197
+ - For event-related designs, null trials (fixation) distributed throughout the sequence (Friston et al., 1999)
198
+
199
+ ## Condition Ordering
200
+
201
+ - **m-sequences**: Pseudo-random sequences with optimal counterbalancing properties (Buracas & Boynton, 2002)
202
+ - **Optimized pseudo-random**: Generated by optimization algorithms (optseq2, NeuroDesign) to maximize design efficiency while controlling trial-order effects (Dale, 1999)
203
+ - **Avoid**: Simple alternation (ABABAB) which confounds condition with time, or purely random sequences which may produce long runs of the same condition
204
+
205
+ ## Behavioral Task Constraints
206
+
207
+ | Constraint | Guideline | Source |
208
+ |---|---|---|
209
+ | Response mapping | Counterbalance button assignments across subjects | Prevents lateralized motor confound |
210
+ | Practice effects | Include out-of-scanner practice until performance plateaus | Reduces learning-related activation changes during scanning |
211
+ | Task difficulty | Aim for **70-85% accuracy** | Floor/ceiling effects eliminate behavioral variance (Poldrack et al., 2011, Ch. 3) |
212
+ | Response window | Allow **1.5-3 seconds** for speeded responses | Accommodate scanner environment slowing (~200 ms; Haatveit et al., 2010) |
213
+ | Stimulus duration | **0.5-4 seconds** typical for visual stimuli | Long enough for perceptual processing, short enough for event separation |
214
+
215
+ ## Common Pitfalls
216
+
217
+ 1. **Fixed ISI in event-related designs**: Dramatically reduces design efficiency compared to jittered designs. Always jitter ISI for event-related fMRI (Dale, 1999)
218
+ 2. **Too few trials per condition**: Fewer than 20 events per condition yields unreliable single-subject estimates (Desmond & Glover, 2002). Plan for at least 30 per condition
219
+ 3. **Ignoring HRF recovery time**: Events separated by < 2 seconds produce nonlinear BOLD summation, making responses difficult to separate (Glover, 1999)
220
+ 4. **No baseline/rest periods**: Without rest periods, the model cannot estimate absolute activation levels and efficiency drops substantially (Friston et al., 1999)
221
+ 5. **Confounding condition with time**: Presenting all trials of one condition before another confounds the effect with scanner drift and fatigue
222
+ 6. **Not counterbalancing response mappings**: Lateralized motor responses (left vs. right hand) produce motor cortex activation that confounds task effects
223
+ 7. **Ceiling/floor performance**: If accuracy is near 100% or chance, there is no behavioral variance to correlate with brain activity
224
+ 8. **Not optimizing the design matrix**: Using arbitrary event timing instead of optimized sequences wastes statistical power that could be gained at no additional cost
225
+
226
+ ## Minimum Reporting Checklist
227
+
228
+ Based on COBIDAS guidelines (Nichols et al., 2017) and Poldrack et al. (2008):
229
+
230
+ - [ ] Design type (block, event-related, mixed, rapid event-related)
231
+ - [ ] Block duration (for block designs) or ISI distribution parameters (for event-related)
232
+ - [ ] Number of conditions and number of trials per condition
233
+ - [ ] Stimulus duration and response window
234
+ - [ ] Jittering strategy and ISI range (min, max, mean, distribution)
235
+ - [ ] Null trial proportion and distribution
236
+ - [ ] Condition ordering method (optimized, m-sequence, pseudo-random)
237
+ - [ ] Total scan duration per run and number of runs
238
+ - [ ] Design optimization tool used (if any) and efficiency metric
239
+ - [ ] Response mapping and counterbalancing scheme
240
+ - [ ] Practice procedure (in-scanner or out-of-scanner, duration)
241
+ - [ ] TR and its relationship to stimulus timing
242
+
243
+ ## References
244
+
245
+ - Bandettini, P. A., Jesmanowicz, A., Wong, E. C., & Hyde, J. S. (1993). Processing strategies for time-course data sets in functional MRI of the human brain. *Magnetic Resonance in Medicine*, 30(2), 161-173.
246
+ - Buracas, G. T., & Boynton, G. M. (2002). Efficient design of event-related fMRI experiments using m-sequences. *NeuroImage*, 16(3), 801-813.
247
+ - Dale, A. M. (1999). Optimal experimental design for event-related fMRI. *Human Brain Mapping*, 8(2-3), 109-114.
248
+ - Desmond, J. E., & Glover, G. H. (2002). Estimating sample size in functional MRI (fMRI) neuroimaging studies: Statistical power analyses. *Journal of Neuroscience Methods*, 118(2), 115-128.
249
+ - Durnez, J., Blair, R., & Poldrack, R. A. (2017). NeuroDesign: Optimal experimental designs for task fMRI. *bioRxiv*, 119594.
250
+ - Friston, K. J., Zarahn, E., Josephs, O., Henson, R. N. A., & Dale, A. M. (1999). Stochastic designs in event-related fMRI. *NeuroImage*, 10(5), 607-619.
251
+ - Glover, G. H. (1999). Deconvolution of impulse response in event-related BOLD fMRI. *NeuroImage*, 9(4), 416-429.
252
+ - Haatveit, B. C., Sundet, K., Hugdahl, K., et al. (2010). The validity of d prime as a working memory index. *Neuropsychology*, 24(5), 629-640.
253
+ - Hagberg, G. E., Zito, G., Patria, F., & Sanes, J. N. (2001). Improved detection of event-related functional MRI signals using probability functions. *NeuroImage*, 14(5), 1193-1205.
254
+ - Liu, T. T., Frank, L. R., Wong, E. C., & Buxton, R. B. (2001). Detection power, estimation efficiency, and predictability in event-related fMRI. *NeuroImage*, 13(4), 759-773.
255
+ - Maus, B., van Breukelen, G. J. P., Goebel, R., & Berger, M. P. F. (2010). Optimal design of multi-subject blocked fMRI experiments. *NeuroImage*, 51(3), 1338-1348.
256
+ - Mumford, J. A., & Nichols, T. E. (2008). Power calculation for group fMRI studies accounting for arbitrary design and temporal autocorrelation. *NeuroImage*, 39(1), 261-268.
257
+ - Murphy, K., & Garavan, H. (2005). Deriving the optimal number of events for an event-related fMRI study based on the spatial extent of activation. *NeuroImage*, 27(4), 771-777.
258
+ - Nichols, T. E., Das, S., Eickhoff, S. B., et al. (2017). Best practices in data analysis and sharing in neuroimaging using MRI (COBIDAS). *Nature Neuroscience*, 20(3), 299-303.
259
+ - Petersen, S. E., & Dubis, J. W. (2012). The mixed block/event-related design. *NeuroImage*, 62(2), 1177-1184.
260
+ - Poldrack, R. A., Fletcher, P. C., Henson, R. N., et al. (2008). Guidelines for reporting an fMRI study. *NeuroImage*, 40(2), 409-414.
261
+ - Poldrack, R. A., Mumford, J. A., & Nichols, T. E. (2011). *Handbook of Functional MRI Data Analysis*. Cambridge University Press.
262
+ - Wager, T. D., & Nichols, T. E. (2003). Optimization of experimental design in fMRI: A general framework using a genetic algorithm. *NeuroImage*, 18(2), 293-309.
263
+
264
+ See `references/` for detailed design optimization examples and parameter lookup tables.