@brainpilot/skills 0.0.6 → 0.0.8

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 (285) hide show
  1. package/package.json +2 -2
  2. package/skills/01_Meta-Skills/academic-research-hub/SKILL.md +108 -0
  3. package/skills/01_Meta-Skills/academic-research-hub/scripts/requirements.txt +17 -0
  4. package/skills/01_Meta-Skills/academic-research-hub/scripts/research.py +781 -0
  5. package/skills/01_Meta-Skills/beautiful-log/SKILL.md +64 -0
  6. package/skills/01_Meta-Skills/beautiful-log/scripts/beautiful_log.py +274 -0
  7. package/skills/01_Meta-Skills/ethoclaw-daily-paper/SKILL.md +130 -0
  8. package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/config.template.yaml +54 -0
  9. package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/top5_digest_template.md +5 -0
  10. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/build_top5_digest.py +300 -0
  11. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/common.py +137 -0
  12. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/merge_results.py +106 -0
  13. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/run_pipeline.py +177 -0
  14. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_arxiv.py +162 -0
  15. package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_pubmed.py +202 -0
  16. package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/SKILL.md +173 -0
  17. package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/scripts/normalize_data.py +874 -0
  18. package/skills/01_Meta-Skills/ethoclaw-pdf-research/SKILL.md +134 -0
  19. package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/confirmation-prompts.md +31 -0
  20. package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/output-patterns.md +45 -0
  21. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_markdown_deliverables.py +41 -0
  22. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_research_log.py +84 -0
  23. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_summary_md.py +63 -0
  24. package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/extract_pdf_bundle.py +140 -0
  25. package/skills/01_Meta-Skills/experiment-controller/SKILL.md +140 -0
  26. package/skills/01_Meta-Skills/knowledge-graph-builder/SKILL.md +366 -0
  27. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/entity_resolution.py +120 -0
  28. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/extraction_prompt_template.txt +19 -0
  29. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/graph_query.py +106 -0
  30. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/hypothesis_cli_reference.py +42 -0
  31. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/new_data_source_template.py +116 -0
  32. package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/requirements.txt +15 -0
  33. package/skills/01_Meta-Skills/method-design/SKILL.md +61 -0
  34. package/skills/01_Meta-Skills/multi-search-engine/SKILL.md +119 -0
  35. package/skills/01_Meta-Skills/research-idea/SKILL.md +65 -0
  36. package/skills/05_EEG_ERP/eeg-skill/SKILL.md +197 -0
  37. package/skills/05_EEG_ERP/meg-skill/SKILL.md +188 -0
  38. package/skills/05_EEG_ERP/meg-skill/scripts/time_frequency.py +223 -0
  39. package/skills/05_EEG_ERP/mne-eeg-tool/SKILL.md +165 -0
  40. package/skills/05_EEG_ERP/mne-eeg-tool/scripts/eeg_pipeline_reference.py +231 -0
  41. package/skills/05_EEG_ERP/seed-iv-skill/SKILL.md +184 -0
  42. package/skills/05_EEG_ERP/seed-iv-skill/scripts/classify_seed_iv.py +154 -0
  43. package/skills/05_EEG_ERP/seed-iv-skill/scripts/extract_seed_iv_features.py +190 -0
  44. package/skills/05_EEG_ERP/seed-iv-skill/scripts/validate_seed_iv.py +102 -0
  45. package/skills/05_EEG_ERP/seed-vig-skill/SKILL.md +182 -0
  46. package/skills/05_EEG_ERP/seed-vig-skill/scripts/classify_seed_vig.py +165 -0
  47. package/skills/05_EEG_ERP/seed-vig-skill/scripts/extract_seed_vig_features.py +185 -0
  48. package/skills/05_EEG_ERP/seed-vig-skill/scripts/validate_seed_vig.py +88 -0
  49. package/skills/06_fMRI_Neuroimaging/abcd-skill/SKILL.md +308 -0
  50. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/abcd_qc_summary.py +449 -0
  51. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/extract_abcd_phenotype.py +292 -0
  52. package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/reorganize_abcd.py +387 -0
  53. package/skills/06_fMRI_Neuroimaging/abide-skill/SKILL.md +302 -0
  54. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/abide_qc_summary.py +317 -0
  55. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/extract_abide_phenotype.py +267 -0
  56. package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/reorganize_abide.py +387 -0
  57. package/skills/06_fMRI_Neuroimaging/adhd200-skill/SKILL.md +244 -0
  58. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/adhd200_qc_summary.py +98 -0
  59. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/extract_adhd200_phenotype.py +134 -0
  60. package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/reorganize_adhd200.py +206 -0
  61. package/skills/06_fMRI_Neuroimaging/adni-skill/SKILL.md +358 -0
  62. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_adni_task_files.py +1305 -0
  63. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_vqa_from_tasks.py +766 -0
  64. package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/reorganize_adni.py +491 -0
  65. package/skills/06_fMRI_Neuroimaging/aibl-skill/SKILL.md +295 -0
  66. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/aibl_qc_summary.py +260 -0
  67. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/extract_aibl_phenotype.py +365 -0
  68. package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/reorganize_aibl.py +394 -0
  69. package/skills/06_fMRI_Neuroimaging/aomic-skill/SKILL.md +292 -0
  70. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/aomic_qc_summary.py +258 -0
  71. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/extract_aomic_phenotype.py +284 -0
  72. package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/reorganize_aomic.py +322 -0
  73. package/skills/06_fMRI_Neuroimaging/asl-skill/SKILL.md +168 -0
  74. package/skills/06_fMRI_Neuroimaging/asl-skill/scripts/compute_cbf.py +224 -0
  75. package/skills/06_fMRI_Neuroimaging/bids-organizer/SKILL.md +241 -0
  76. package/skills/06_fMRI_Neuroimaging/bold5000-skill/SKILL.md +186 -0
  77. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/bold5000_qc_summary.py +96 -0
  78. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/extract_bold5000_stimulus.py +125 -0
  79. package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/reorganize_bold5000.py +102 -0
  80. package/skills/06_fMRI_Neuroimaging/camcan-skill/SKILL.md +213 -0
  81. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/camcan_qc_summary.py +131 -0
  82. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/extract_camcan_phenotype.py +145 -0
  83. package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/validate_camcan.py +141 -0
  84. package/skills/06_fMRI_Neuroimaging/cobre-skill/SKILL.md +201 -0
  85. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/cobre_qc_summary.py +95 -0
  86. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/extract_cobre_phenotype.py +104 -0
  87. package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/reorganize_cobre.py +140 -0
  88. package/skills/06_fMRI_Neuroimaging/conn-tool/SKILL.md +180 -0
  89. package/skills/06_fMRI_Neuroimaging/dcm2nii/SKILL.md +189 -0
  90. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/SKILL.md +183 -0
  91. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/dmt_har_med_qc_summary.py +96 -0
  92. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/extract_dmt_har_med_phenotype.py +121 -0
  93. package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/reorganize_dmt_har_med.py +125 -0
  94. package/skills/06_fMRI_Neuroimaging/dwi-skill/SKILL.md +359 -0
  95. package/skills/06_fMRI_Neuroimaging/fmri-skill/SKILL.md +371 -0
  96. package/skills/06_fMRI_Neuroimaging/fmriprep-tool/SKILL.md +228 -0
  97. package/skills/06_fMRI_Neuroimaging/freesurfer-tool/SKILL.md +286 -0
  98. package/skills/06_fMRI_Neuroimaging/freesurfer-tool/scripts/freesurfer_processor.py +145 -0
  99. package/skills/06_fMRI_Neuroimaging/fsl-tool/SKILL.md +208 -0
  100. package/skills/06_fMRI_Neuroimaging/hbn-skill/SKILL.md +271 -0
  101. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/extract_hbn_phenotype.py +107 -0
  102. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/hbn_qc_summary.py +96 -0
  103. package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/reorganize_hbn.py +150 -0
  104. package/skills/06_fMRI_Neuroimaging/hcpa-skill/SKILL.md +210 -0
  105. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/extract_hcpa_phenotype.py +146 -0
  106. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/hcpa_qc_summary.py +120 -0
  107. package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/reorganize_hcpa.py +155 -0
  108. package/skills/06_fMRI_Neuroimaging/hcpd-skill/SKILL.md +210 -0
  109. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/extract_hcpd_phenotype.py +148 -0
  110. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/hcpd_qc_summary.py +125 -0
  111. package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/reorganize_hcpd.py +146 -0
  112. package/skills/06_fMRI_Neuroimaging/hcpep-skill/SKILL.md +215 -0
  113. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/extract_hcpep_phenotype.py +157 -0
  114. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/hcpep_qc_summary.py +143 -0
  115. package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/reorganize_hcpep.py +146 -0
  116. package/skills/06_fMRI_Neuroimaging/hcppipeline-tool/SKILL.md +217 -0
  117. package/skills/06_fMRI_Neuroimaging/hcpya-skill/SKILL.md +214 -0
  118. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/extract_hcpya_phenotype.py +190 -0
  119. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/hcpya_qc_summary.py +152 -0
  120. package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/reorganize_hcpya.py +203 -0
  121. package/skills/06_fMRI_Neuroimaging/ixi-skill/SKILL.md +198 -0
  122. package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/ixi_qc_summary.py +137 -0
  123. package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/reorganize_ixi.py +190 -0
  124. package/skills/06_fMRI_Neuroimaging/mnd-skill/SKILL.md +191 -0
  125. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/extract_mnd_phenotype.py +143 -0
  126. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/mnd_qc_summary.py +120 -0
  127. package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/validate_mnd.py +107 -0
  128. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/SKILL.md +203 -0
  129. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/analyze_lesions.py +119 -0
  130. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/longitudinal_lesion.py +148 -0
  131. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/mschallenge_qc_summary.py +132 -0
  132. package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/validate_mschallenge.py +116 -0
  133. package/skills/06_fMRI_Neuroimaging/nibabel-skill/SKILL.md +184 -0
  134. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/atlas_coordinate_reference.py +61 -0
  135. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/freesurfer_io_reference.py +34 -0
  136. package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/nifti_inspection_reference.py +35 -0
  137. package/skills/06_fMRI_Neuroimaging/nifd-skill/SKILL.md +205 -0
  138. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/extract_nifd_phenotype.py +132 -0
  139. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/nifd_qc_summary.py +111 -0
  140. package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/validate_nifd.py +111 -0
  141. package/skills/06_fMRI_Neuroimaging/nii2dcm/SKILL.md +143 -0
  142. package/skills/06_fMRI_Neuroimaging/nilearn-tool/SKILL.md +266 -0
  143. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/connectome_reference.py +65 -0
  144. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/denoise_timeseries_reference.py +58 -0
  145. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/hierarchical_parcellation_reference.py +53 -0
  146. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/kmeans_parcellation_reference.py +53 -0
  147. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/preprocess_bold_reference.py +76 -0
  148. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_dictlearning_reference.py +56 -0
  149. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_ica_reference.py +59 -0
  150. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/second_level_glm_reference.py +58 -0
  151. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/spacenet_classifier_reference.py +59 -0
  152. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/svm_classifier_reference.py +60 -0
  153. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/task_glm_reference.py +63 -0
  154. package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/zalff_summary_reference.py +109 -0
  155. package/skills/06_fMRI_Neuroimaging/nsd-skill/SKILL.md +210 -0
  156. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/extract_nsd_stimulus.py +171 -0
  157. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/nsd_qc_summary.py +142 -0
  158. package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/validate_nsd.py +142 -0
  159. package/skills/06_fMRI_Neuroimaging/oasis-skill/SKILL.md +205 -0
  160. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/extract_oasis_phenotype.py +126 -0
  161. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/oasis_qc_summary.py +115 -0
  162. package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/validate_oasis.py +119 -0
  163. package/skills/06_fMRI_Neuroimaging/pet-skill/SKILL.md +173 -0
  164. package/skills/06_fMRI_Neuroimaging/pet-skill/scripts/compute_suvr.py +202 -0
  165. package/skills/06_fMRI_Neuroimaging/pnc-skill/SKILL.md +206 -0
  166. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/extract_pnc_phenotype.py +136 -0
  167. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/pnc_qc_summary.py +116 -0
  168. package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/validate_pnc.py +120 -0
  169. package/skills/06_fMRI_Neuroimaging/ppmi-skill/SKILL.md +209 -0
  170. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/extract_ppmi_phenotype.py +138 -0
  171. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/ppmi_qc_summary.py +111 -0
  172. package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/validate_ppmi.py +117 -0
  173. package/skills/06_fMRI_Neuroimaging/qsiprep-tool/SKILL.md +320 -0
  174. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/SKILL.md +215 -0
  175. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/extract_rest_mdd_phenotype.py +132 -0
  176. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/harmonize_sites.py +152 -0
  177. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/rest_mdd_qc_summary.py +124 -0
  178. package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/validate_rest_mdd.py +103 -0
  179. package/skills/06_fMRI_Neuroimaging/smri-skill/SKILL.md +302 -0
  180. package/skills/06_fMRI_Neuroimaging/tcp-skill/SKILL.md +204 -0
  181. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/extract_tcp_phenotype.py +139 -0
  182. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/tcp_qc_summary.py +111 -0
  183. package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/validate_tcp.py +99 -0
  184. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/SKILL.md +217 -0
  185. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/extract_ucla_cnp_phenotype.py +145 -0
  186. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/ucla_cnp_qc_summary.py +111 -0
  187. package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/validate_ucla_cnp.py +113 -0
  188. package/skills/06_fMRI_Neuroimaging/ukb-skill/SKILL.md +310 -0
  189. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/build_ukb_survival.py +210 -0
  190. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_cases.py +308 -0
  191. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_phenotype.py +232 -0
  192. package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/ukb_qc_summary.py +158 -0
  193. package/skills/06_fMRI_Neuroimaging/wmh-segmentation/SKILL.md +133 -0
  194. package/skills/07_Computational_Modeling/detrending/SKILL.md +118 -0
  195. package/skills/07_Computational_Modeling/dictlearning/SKILL.md +122 -0
  196. package/skills/07_Computational_Modeling/filtering/SKILL.md +121 -0
  197. package/skills/07_Computational_Modeling/glm/SKILL.md +153 -0
  198. package/skills/07_Computational_Modeling/hierarchical/SKILL.md +121 -0
  199. package/skills/07_Computational_Modeling/ica/SKILL.md +122 -0
  200. package/skills/07_Computational_Modeling/kmeans/SKILL.md +119 -0
  201. package/skills/07_Computational_Modeling/run_models/SKILL.md +427 -0
  202. package/skills/07_Computational_Modeling/spacenet/SKILL.md +122 -0
  203. package/skills/07_Computational_Modeling/svm/SKILL.md +120 -0
  204. package/skills/08_Computational_Neuroscience/brain_gnn/SKILL.md +183 -0
  205. package/skills/08_Computational_Neuroscience/dipy-tool/SKILL.md +239 -0
  206. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/dti_metrics_reference.py +70 -0
  207. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/load_and_mask_reference.py +76 -0
  208. package/skills/08_Computational_Neuroscience/dipy-tool/scripts/roi_stats_reference.py +59 -0
  209. package/skills/08_Computational_Neuroscience/fm_app/SKILL.md +195 -0
  210. package/skills/08_Computational_Neuroscience/neurostorm/SKILL.md +151 -0
  211. package/skills/13_Visualization/brain-visualization/SKILL.md +191 -0
  212. package/skills/13_Visualization/brain-visualization/scripts/connectome_reference.py +108 -0
  213. package/skills/13_Visualization/brain-visualization/scripts/freesurfer_ply_reference.py +54 -0
  214. package/skills/13_Visualization/brain-visualization/scripts/zalff_summary_reference.py +116 -0
  215. package/skills/13_Visualization/ethoclaw-paper-figure-layout/SKILL.md +78 -0
  216. package/skills/13_Visualization/ethoclaw-paper-figure-layout/assets/naturecomm_figures.tex +74 -0
  217. package/skills/13_Visualization/ethoclaw-paper-figure-layout/scripts/layout_results_foldered.py +579 -0
  218. package/skills/14_Writing/overleaf-skill/SKILL.md +184 -0
  219. package/skills/14_Writing/overleaf-skill/scripts/install.sh +30 -0
  220. package/skills/14_Writing/paper-writing/SKILL.md +146 -0
  221. package/skills/14_Writing/paper-writing/scripts/data_statement_templates.py +164 -0
  222. package/skills/14_Writing/paper-writing/scripts/figure_templates.py +315 -0
  223. package/skills/14_Writing/paper-writing/scripts/nature_figure_style.py +214 -0
  224. package/skills/14_Writing/paper-writing/scripts/section_phrasebank.py +246 -0
  225. package/skills/16_Animal_Behavior/deeplabcut/SKILL.md +154 -0
  226. package/skills/16_Animal_Behavior/deeplabcut/references/3d-pose.md +89 -0
  227. package/skills/16_Animal_Behavior/deeplabcut/references/maDLC.md +123 -0
  228. package/skills/16_Animal_Behavior/deeplabcut/references/modelzoo.md +98 -0
  229. package/skills/16_Animal_Behavior/deeplabcut/references/standard-pipeline.md +165 -0
  230. package/skills/16_Animal_Behavior/deeplabcut/references/utilities.md +146 -0
  231. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/SKILL.md +274 -0
  232. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.html +112 -0
  233. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.md +21 -0
  234. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/cluster-section.md +5 -0
  235. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/heatmap-section.md +5 -0
  236. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/integrated-interpretation.md +3 -0
  237. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/overview.md +3 -0
  238. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/project-summary.md +3 -0
  239. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/radar-section.md +5 -0
  240. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/raw-trajectory.md +3 -0
  241. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/sample-check.md +3 -0
  242. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/single-subject-section.md +3 -0
  243. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/stats-section.md +5 -0
  244. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/epm.md +52 -0
  245. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/fst.md +37 -0
  246. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/nor.md +39 -0
  247. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/oft.md +43 -0
  248. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tcst.md +45 -0
  249. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tst.md +36 -0
  250. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/input-types.md +59 -0
  251. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/interpretation-guardrails.md +45 -0
  252. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/metadata-schema.md +57 -0
  253. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/report-sections.md +86 -0
  254. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/section-selection-rules.md +169 -0
  255. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/build_report_manifest.py +27 -0
  256. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/render_report.py +34 -0
  257. package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/report_utils.py +1121 -0
  258. package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/SKILL.md +390 -0
  259. package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/reference_code.py +98 -0
  260. package/skills/16_Animal_Behavior/ethoclaw-animal-pose-estimation/SKILL.md +336 -0
  261. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/README.md +21 -0
  262. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/SKILL.md +41 -0
  263. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/batch_kinematic_generator.py +663 -0
  264. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/config.json +19 -0
  265. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/generate_kinematic_parameter.py +401 -0
  266. package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/kinematic_generator.py +265 -0
  267. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/SKILL.md +72 -0
  268. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/references/config.example.toml +56 -0
  269. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params.py +232 -0
  270. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params_from_config.py +236 -0
  271. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/SKILL.md +68 -0
  272. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/references/notes.md +5 -0
  273. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/scripts/plot_h5_radar.py +513 -0
  274. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/SKILL.md +52 -0
  275. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/config.toml +81 -0
  276. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/references/stats-rule.md +18 -0
  277. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_inspect.py +79 -0
  278. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_batch.py +624 -0
  279. package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_stats.py +438 -0
  280. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/SKILL.md +280 -0
  281. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_trajectory.py +790 -0
  282. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_velocity.py +855 -0
  283. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.csv +101 -0
  284. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.h5 +0 -0
  285. package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_data_readme.md +126 -0
@@ -0,0 +1,371 @@
1
+ ---
2
+ name: fmri-skill
3
+ description: "Use this skill whenever the user wants to perform fMRI preprocessing, first-level analysis, ROI extraction, functional connectivity, effective connectivity, or atlas-based alignment to MNI152 space using either fMRIPrep, HCP-style pipelines, or CONN Toolbox. Triggers include: 'fmri', 'fMRI analysis', 'functional connectivity', 'effective connectivity', 'ROI extraction', 'seed-based correlation', 'PPI', 'DCM', 'atlas alignment', 'MNI152', 'HCP pipeline', 'CONN toolbox', or any request involving BOLD data."
4
+ license: MIT License (NeuroClaw custom skill – freely modifiable within the project)
5
+ layer: subagent
6
+ skill_type: modality
7
+ dependencies:
8
+ - fmriprep-tool
9
+ - hcppipeline-tool
10
+ - conn-tool
11
+ - fsl-tool
12
+ - bids-organizer
13
+ - claw-shell
14
+ complementary_skills:
15
+ - smri-skill
16
+ - dwi-skill
17
+ ---
18
+ # fMRI Skill (Modality Layer)
19
+
20
+ ## Overview
21
+
22
+ `fmri-skill` is the NeuroClaw **modality-layer** interface skill responsible for all fMRI data processing and analysis tasks.
23
+
24
+ It strictly follows the NeuroClaw hierarchical design principles:
25
+ - This skill **only describes WHAT needs to be done** and **which tool skill to delegate to**.
26
+ - It contains **no implementation code or concrete commands**.
27
+ - All concrete execution is delegated to existing base/tool skills: `fmriprep-tool`, `hcppipeline-tool`, `conn-tool`, `fsl-tool`, `bids-organizer`, and `claw-shell`.
28
+
29
+ **Core workflow (never bypassed):**
30
+ 1. Identify input data (BIDS dataset or preprocessed BOLD files).
31
+ 2. Generate a **numbered execution plan** that clearly states WHAT needs to be done and which tool skill will handle each step.
32
+ 3. Present the full plan, estimated runtime, resource requirements, and risks to the user and wait for explicit confirmation (“YES” / “execute” / “proceed”).
33
+ 4. On confirmation, delegate every step to the appropriate skill via `claw-shell`.
34
+ 5. After execution, save all outputs in a clean directory structure (`fmri_output/`).
35
+
36
+ ## Benchmark-Facing Default Mainline
37
+
38
+ For benchmark-style prompts, choose the narrowest task-faithful fMRI route first and do not widen into unrelated branches just because multiple downstream tools are available.
39
+
40
+ - If the prompt is task fMRI or mentions events, contrasts, design matrices, conditions, first-level, second-level, FEAT, cope, or z-stat maps:
41
+ - Default to `BIDS -> fMRIPrep -> first-level GLM -> group-level GLM if requested`.
42
+ - Keep the answer on the GLM/statistical path.
43
+ - Do not introduce resting-state connectivity, CONN, PPI, DCM, or EEG branches unless the prompt explicitly asks for them.
44
+ - If the prompt is resting-state or asks for ROI time series / connectivity:
45
+ - Default to `BIDS -> fMRIPrep -> XCP-D or ROI/connectivity extraction`.
46
+ - Do not introduce task-GLM steps unless the prompt explicitly asks for task analysis.
47
+ - If the prompt is an ADNI-like or other raw-data resting-state benchmark, keep the answer on the narrow mainline `raw data -> minimal BIDS organization -> fMRIPrep -> resting-state ROI/connectivity outputs`.
48
+ - Do not expand the primary solution into EEG branches, CONN, effective connectivity, or broad multimodal orchestration unless the prompt explicitly asks for those branches.
49
+ - If required task-fMRI inputs such as `events.tsv`, contrasts, or condition timing are missing:
50
+ - State `Missing required input` explicitly.
51
+ - Do not silently switch the task into a resting-state pipeline.
52
+ - Do not delegate to unrelated modality skills such as EEG for fMRI-only tasks.
53
+ - In benchmark mode, do not make environment creation, broad project scaffolding, or long installation/setup sections the center of the answer when the task is asking for the executable imaging mainline.
54
+
55
+ When multiple fMRI routes are possible, prefer one explicit mainline plus a short note about blocked optional branches rather than a multi-branch menu inside the primary solution.
56
+
57
+ **Research use only.**
58
+
59
+ ## Quick Reference (Common fMRI Tasks – Updated 2026-03-28)
60
+
61
+ | Task | What needs to be done | Delegate to which tool skill | Expected output |
62
+ |-----------------------------------|------------------------------------------------------------|-------------------------------------------------------|------------------------------------------|
63
+ | BIDS organization | Convert raw DICOM/NIfTI into valid BIDS structure (dataset_description.json + proper naming) | `bids-organizer` | BIDS-compliant dataset with metadata |
64
+ | Standardized preprocessing (fMRIPrep) | Motion correction, slice timing, distortion correction, coregistration to T1w, FreeSurfer integration | `fmriprep-tool` | Preprocessed BOLD in native/T1w space + anatomical derivatives |
65
+ | Post-processing denoising (XCP-D) | Spatial smoothing, band-pass filtering (0.01–0.08 Hz), nuisance regression (36P model), scrubbing (FD > 0.2mm) | `fmriprep-tool` (XCP-D integration) | Clean 4D BOLD + ROI timeseries (.tsv) + functional connectivity matrices |
66
+ | High-quality HCP-style preprocessing | Structural + functional (ICA-FIX) + diffusion + MSMAll surface alignment | `hcppipeline-tool` | HCP-style preprocessed data |
67
+ | Atlas alignment to T1w / MNI152 | Register functional/anatomical data to T1w native or MNI152 template | `fmriprep-tool` or `hcppipeline-tool` | Data in T1w or MNI152 space |
68
+ | ROI time-series extraction | Extract mean/spatial ROI time-series from atlas-defined ROIs (e.g., Schaefer, Glasser, Gordon, Tian) | `fmriprep-tool` (XCP-D) or `nilearn-tool` | ROI timeseries (TSV / CSV / .npy) |
69
+ | Functional connectivity (clean) | Compute Pearson correlation matrices from denoised ROI time-series (after XCP-D) | Post-XCP-D analysis or `conn-tool` | Whole-brain connectivity matrices, networks |
70
+ | Effective connectivity | Psychophysiological Interaction (PPI/gPPI), Granger causality, Dynamic Causal Modeling (DCM) | `fsl-tool` or `conn-tool` | PPI maps, causality matrices, DCM parameters |
71
+ | First-level GLM (task-based) | Task regressors + contrast estimation | `fsl-tool` (FEAT) | Z-stat maps, cope files |
72
+ | Group-level analysis | Second-level statistics across subjects | `fsl-tool` (randomise / FEAT) | Group statistical maps |
73
+ | Full ADNI-style rsfMRI pipeline | BIDS → fMRIPrep → XCP-D → connectivity analysis (resting state optimized) | `bids-organizer` + `fmriprep-tool` + `fmriprep-tool` (XCP-D) | Clean BOLD + timeseries + connectivity matrices + QC |
74
+ | Advanced connectivity (CONN) | ROI-to-ROI, seed-to-voxel, ICA networks, PPI/gPPI, DCM | `conn-tool` | Comprehensive connectivity results |
75
+
76
+ ## Installation (Handled by dependency-planner)
77
+
78
+ No manual installation required at this layer.
79
+ When first used, `fmri-skill` automatically calls `dependency-planner` to ensure `fmriprep-tool`, `hcppipeline-tool`, `conn-tool`, `fsl-tool`, and `bids-organizer` are ready.
80
+
81
+ ## Complete ADNI-Style rsfMRI Processing Workflow
82
+
83
+ ### Recommended 3-Stage Processing Pipeline
84
+ For resting-state fMRI datasets (like ADNI), the most validated workflow combines **fMRIPrep** (preprocessing) + **XCP-D** (denoising/post-processing):
85
+
86
+ #### **Stage 1: BIDS Data Preparation** (via `bids-organizer`)
87
+ Input: Raw NIfTI files from DICOM conversion (e.g., `nifti/130_S_0969/T1/` and `nifti/130_S_0969/fMRI/`)
88
+
89
+ Tasks:
90
+ 1. Create `dataset_description.json` at BIDS root:
91
+ ```json
92
+ {
93
+ "Name": "ADNI rsfMRI T1 subset",
94
+ "BIDSVersion": "1.8.0",
95
+ "DatasetType": "raw"
96
+ }
97
+ ```
98
+ 2. Create BIDS directory structure:
99
+ ```
100
+ bids/sub-130S0969/ses-M00/anat/
101
+ bids/sub-130S0969/ses-M00/func/
102
+ ```
103
+ 3. Copy and rename files following BIDS convention:
104
+ - T1w: `sub-130S0969_ses-M00_T1w.nii.gz` + `sub-130S0969_ses-M00_T1w.json`
105
+ - fMRI (resting): `sub-130S0969_ses-M00_task-rest_bold.nii.gz` + `sub-130S0969_ses-M00_task-rest_bold.json`
106
+
107
+ Output: Valid BIDS-structured `bids/` directory
108
+
109
+ #### **Stage 2: Preprocessing with fMRIPrep** (via `fmriprep-tool`)
110
+ Input: BIDS directory from Stage 1
111
+
112
+ Key Operations:
113
+ - Run FreeSurfer on T1w (structural preprocessing)
114
+ - Slice timing correction on BOLD
115
+ - Motion correction (frame-to-frame realignment)
116
+ - BOLD → T1w registration
117
+ - (Optional) T1w → MNI152 registration
118
+
119
+ Command structure (Docker):
120
+ ```bash
121
+ docker run --rm -it \
122
+ -v <BIDS_PATH>:/data:ro \
123
+ -v <OUTPUT_PATH>:/out \
124
+ -v <WORK_PATH>:/work \
125
+ -v <FREESURFER_LICENSE_PATH>:/fs \
126
+ nipreps/fmriprep:23.2.1 \
127
+ /data /out participant \
128
+ --participant-label <SUBID> \
129
+ --fs-license-file /fs/license.txt \
130
+ --output-spaces T1w \
131
+ --work-dir /work \
132
+ --clean-workdir
133
+ ```
134
+
135
+ Output:
136
+ - Preprocessed BOLD in T1w space: `derivatives/fmriprep/sub-*/func/*_space-T1w_desc-preproc_bold.nii.gz`
137
+ - Confound regressors: `derivatives/fmriprep/sub-*/func/*_desc-confounds_timeseries.tsv` (includes motion, signal, etc.)
138
+ - Anatomical derivatives: `derivatives/fmriprep/sub-*/anat/` (T1w in MNI, brain masks, tissue probability maps)
139
+
140
+ #### **Stage 3: Post-Processing with XCP-D** (Spatial Smoothing, Band-Pass Filtering, Nuisance Regression, Scrubbing)
141
+ Input: fMRIPrep derivatives (`derivatives/fmriprep/`)
142
+
143
+ Key Denoising Operations:
144
+ 1. **Spike detection & removal** (despike): Suppress extreme outliers before regression
145
+ 2. **Nuisance regression (36P model)**:
146
+ - 6 motion parameters (roll, pitch, yaw, x, y, z)
147
+ - Global mean signal (GMS)
148
+ - White matter (WM) signal
149
+ - Cerebrospinal fluid (CSF) signal
150
+ - + temporal derivatives of all 9 parameters (18 total)
151
+ - + squared terms (18 total)
152
+ - = **36 parameters** total (one of the most effective motion artifact suppression models)
153
+ - **Alternative**: 27P (no global signal regression if GSR is not acceptable in your study)
154
+ 3. **Band-pass filtering**: 0.01–0.08 Hz (retains resting-state low-frequency fluctuations; removes cardiac/respiratory noise & scanner drift)
155
+ 4. **Spatial smoothing**: 6 mm FWHM Gaussian kernel (improves signal-to-noise for group-level analysis)
156
+ 5. **Scrubbing (artifact handling)**: Mark frames with Framewise Displacement (FD) > 0.2 mm; remove and interpolate
157
+
158
+ Command structure (Docker):
159
+ ```bash
160
+ docker run -ti --rm \
161
+ -v <FMRIPREP_DERIVATIVES>:/fmriprep:ro \
162
+ -v <XCPD_OUTPUT>:/out \
163
+ -v <FREESURFER_LICENSE>:/opt/freesurfer/license.txt:ro \
164
+ pennlinc/xcp_d:latest \
165
+ /fmriprep /out participant \
166
+ --participant-label <SUBID> \
167
+ --nuisance-regressors 36P \
168
+ --despike \
169
+ --lower-bpf 0.01 --upper-bpf 0.08 \
170
+ --smoothing 6 \
171
+ --fd-thresh 0.2 \
172
+ --nthreads 8 \
173
+ --mem_gb 32
174
+ ```
175
+
176
+ **Core Parameter Guide**:
177
+ | Parameter | Value | Explanation |
178
+ |---|---|---|
179
+ | `--nuisance-regressors` | `36P` | 36-parameter motion + signal regression model (most effective for motion artifact suppression) |
180
+ | `--despike` | (flag) | Suppress time-series spikes before filtering/regression |
181
+ | `--lower-bpf` / `--upper-bpf` | `0.01` / `0.08` | Resting-state frequency band (classic choice) |
182
+ | `--smoothing` | `6` | 6 mm FWHM Gaussian smoothing (standard for group analysis) |
183
+ | `--fd-thresh` | `0.2` | Framewise displacement threshold (0.2 mm = moderate scrubbing) |
184
+ | `--nthreads` | `8` | Number of CPU threads |
185
+ | `--mem_gb` | `32` | Memory allocation (adjust to your system) |
186
+
187
+ Output:
188
+ - Clean 4D BOLD: `derivatives/xcpd/sub-*/func/*_desc-denoised_bold.nii.gz`
189
+ - ROI timeseries (built-in atlases):
190
+ - Schaefer 100/200/400/1000 (cortical parcellations)
191
+ - Glasser 360 (multimodal parcellation)
192
+ - Gordon 333 (cortical + subcortical)
193
+ - Tian 96 or similar (subcortical)
194
+ - Files: `*_desc-schaefer*, *_desc-glasser*, *_desc-gordon*, *_desc-tian*_timeseries.tsv`
195
+ - Functional connectivity matrices: `*_timeseries.tsv` (Pearson correlations pre-computed)
196
+ - Quality control metrics and edge case reports
197
+
198
+ #### **Stage 4: Downstream Analysis** (ROI extraction, connectivity analysis)
199
+ - Extract specific ROI timeseries from XCP-D outputs (.tsv files)
200
+ - Compute network-level statistics, graph theory measures, or seed-based maps
201
+ - Perform group-level statistical analysis (via FSL, SPM, or custom pipelines)
202
+
203
+ ---
204
+
205
+ ## NeuroClaw recommended wrapper script
206
+
207
+ No wrapper script is needed at the modality layer.
208
+ All execution is routed through `bids-organizer`, `fmriprep-tool`, `hcppipeline-tool`, `conn-tool`, `fsl-tool`, and `claw-shell`.
209
+
210
+ ## Important Notes & Limitations
211
+
212
+ ### Processing Architecture & Runtimes
213
+ - **BIDS Preparation** (~5-10 min per subject): File organization, metadata verification
214
+ - **fMRIPrep** (~1.5-2 hours per subject with FreeSurfer): Full structural + functional preprocessing, parallelizable
215
+ - **XCP-D** (~20-30 min per subject): Post-processing denoising, ROI extraction, connectivity computation
216
+ - **Total pipeline**: 2-2.5 hours per subject (sequential), much faster with parallelization across subjects
217
+
218
+ ### Data Requirements & Outputs
219
+ - **Input**: Raw DICOM/NIfTI (T1w + resting-state BOLD or task BOLD)
220
+ - **Intermediate**: fMRIPrep derivatives with confound matrices (TSV files)
221
+ - **Final outputs** (after XCP-D):
222
+ - Clean 4D BOLD images (`.nii.gz`)
223
+ - ROI timeseries in multiple standard atlases (`.tsv`)
224
+ - Pre-computed functional connectivity matrices (Pearson correlations)
225
+ - Quality control metrics (FD ranges, valid frame counts, etc.)
226
+
227
+ ### Resting-State Network Considerations
228
+ - **36P nuisance regression** is proven most effective for motion artifact suppression (Head Motion Index ~85% reduction)
229
+ - **Band-pass filtering (0.01–0.08 Hz)** is standard for resting-state; preserve low-frequency oscillations while removing physiological noise
230
+ - **Scrubbing threshold (FD > 0.2 mm)** removes high-motion frames; conservative threshold (~5–15% of frames typically removed in ADNI)
231
+ - **Smoothing (6 mm FWHM)**: Improves SNR for group-level analysis; trade-off with spatial specificity
232
+
233
+ ### Key Differences from Task-Based fMRI
234
+ - **Resting-state (ADNI model)**:
235
+ - Focuses on intrinsic connectivity networks
236
+ - Heavy denoising emphasis (36P + scrubbing + despike)
237
+ - Lower frequency band (0.01–0.08 Hz)
238
+ - No task regressors; uses confound regression instead
239
+
240
+ - **Task-based fMRI**:
241
+ - Emphasizes task activations
242
+ - Less aggressive denoising (to preserve task signal)
243
+ - Often no band-pass filtering (preserves full range including task-related frequencies)
244
+ - Explicit task design matrix (regressors for task timing)
245
+
246
+ ### Input Data Requirements
247
+ - **T1w MRI**: 1 per subject (used by FreeSurfer for anatomical reference)
248
+ - **BOLD**: 1 or more functional scans per subject
249
+ - Resting-state: typically 5–15 min (300–900 volumes at 2–3 sec TR)
250
+ - ADNI standard: ~6 min at TR=3s = 120 volumes
251
+ - **Metadata (JSON)**: Must include `RepetitionTime`, `FlipAngle`, `EchoTime` (for proper preprocessing)
252
+
253
+ ### System & License Requirements
254
+ - **Docker**: Required for fMRIPrep and XCP-D (recommended approach)
255
+ - **FreeSurfer**: Requires valid license file (free registration at https://surfer.nmr.mgh.harvard.edu/fswiki/License)
256
+ - **CPU**: 8+ threads recommended (typically 4–8 threads per pipeline = up to 16 for parallel subjects)
257
+ - **Memory**: 32 GB RAM minimum (16–32 GB per subject in parallel)
258
+ - **Disk**: 50–100 GB per subject (raw BOLD ~1 GB, derivatives ~5–10 GB)
259
+
260
+ ### Quality Control Flags
261
+ - **FD metric**: Assess head motion frame-by-frame
262
+ - **BOLD signal dropout**: Check for signal losses (common in orbitofrontal areas)
263
+ - **Registration quality**: Verify BOLD-to-T1w alignment (visual inspection of overlays)
264
+ - **Confound correlations**: Verify nuisance regressors are uncorrelated with residual BOLD
265
+ - **Timeseries variance**: Post-XCP-D timeseries should show natural fluctuations (1-3% variation)
266
+
267
+ ### This skill is for research workflows; not for clinical decision-making.
268
+
269
+ ---
270
+
271
+ ## Standard Output Layout (fMRI Derivatives)
272
+
273
+ After completing the full pipeline (BIDS → fMRIPrep → XCP-D), outputs are organized as:
274
+
275
+ ```
276
+ fmri_output/
277
+ ├── bids/ # Original BIDS dataset
278
+ │ ├── dataset_description.json
279
+ │ └── sub-*/ses-*/func/ # Raw BOLD + JSON metadata
280
+ ├── fmriprep/ # fMRIPrep derivatives
281
+ │ ├── dataset_description.json
282
+ │ └── sub-*/
283
+ │ ├── anat/
284
+ │ │ ├── *_T1w.nii.gz # T1w in native space
285
+ │ │ ├── *_T1w_brain_mask.nii.gz # Brain mask
286
+ │ │ ├── *_space-MNI_T1w.nii.gz # T1w in MNI152 (if --output-spaces MNI152NLin2009cAsym)
287
+ │ │ └── *_label-*.nii.gz # Tissue probability maps (GM/WM/CSF)
288
+ │ ├── func/
289
+ │ │ ├── *_space-T1w_desc-preproc_bold.nii.gz # Preprocessed BOLD (in native T1w space)
290
+ │ │ ├── *_desc-confounds_timeseries.tsv # Motion + signal confounds
291
+ │ │ └── *_desc-confounds_regressors.json # Confound descriptions
292
+ │ └── freesurfer/ # FreeSurfer outputs (symlink or copy)
293
+ ├── xcpd/ # XCP-D post-processing derivatives
294
+ │ ├── dataset_description.json
295
+ │ └── sub-*/
296
+ │ ├── anat/
297
+ │ │ └── *_space-T1w_desc-brain_mask.nii.gz
298
+ │ └── func/
299
+ │ ├── *_desc-denoised_bold.nii.gz # Clean 4D BOLD (denoised, smoothed, filtered)
300
+ │ ├── *_desc-schaefer100_timeseries.tsv # Schaefer 100-region timeseries
301
+ │ ├── *_desc-schaefer200_timeseries.tsv # Schaefer 200-region timeseries
302
+ │ ├── *_desc-schaefer400_timeseries.tsv # Schaefer 400-region timeseries
303
+ │ ├── *_desc-glasser360_timeseries.tsv # Glasser 360 multimodal parcellation
304
+ │ ├── *_desc-gordon333_timeseries.tsv # Gordon 333 network atlas
305
+ │ ├── *_desc-tian96_timeseries.tsv # Tian 96 subcortical atlas
306
+ │ ├── *_desc-schaefer100_correlations.tsv # Pre-computed Pearson correlations (Schaefer 100)
307
+ │ ├── *_desc-glasser360_correlations.tsv # Pre-computed Pearson correlations (Glasser 360)
308
+ │ └── *_desc-qc_metrics.json # Quality control: FD ranges, valid frames, etc.
309
+ ├── roi/ # ROI time-series extractions (optional, for custom analysis)
310
+ │ └── *.csv # Custom ROI CSV tables (if further analysis required)
311
+ ├── connectivity/ # Connectivity analysis (if post-hoc analysis was run)
312
+ │ ├── *_connectivity_matrix.npy # Numpy arrays of connectivity matrices
313
+ │ └── *.tsv # Pairwise connectivity stats
314
+ ├── stats/ # Group-level statistics (if group analysis was run)
315
+ │ └── *.nii.gz # Group-level Z-stat maps, T-stat maps
316
+ └── logs/ # Processing logs
317
+ ├── fmriprep_*.log
318
+ ├── xcpd_*.log
319
+ └── qc_report_*.html # QC reports from fMRIPrep / XCP-D
320
+ ```
321
+
322
+ **Key files for downstream analysis**:
323
+ 1. **Clean BOLD**: `xcpd/sub-*/func/*_desc-denoised_bold.nii.gz`
324
+ 2. **ROI timeseries** (ready for connectivity analysis): `xcpd/sub-*/func/*_timeseries.tsv` (pick your atlas)
325
+ 3. **Confound matrix** (for reference): `fmriprep/sub-*/func/*_confounds_timeseries.tsv`
326
+ 4. **Anatomical reference**: `fmriprep/sub-*/anat/*_T1w.nii.gz`
327
+
328
+ ## When to Call This Skill
329
+
330
+ - After `bids-organizer` when raw resting-state or task-based fMRI data needs preprocessing.
331
+ - When the user wants standardized preprocessing via **fMRIPrep** (with optional XCP-D post-processing for resting-state studies).
332
+ - When the user needs high-quality, publication-grade **HCP-style preprocessing** (surface-based, ICA-FIX).
333
+ - When the research requires **resting-state functional connectivity** analysis with validated denoising (ADNI model: fMRIPrep + XCP-D).
334
+ - When the research involves **ROI timeseries extraction** from multiple standard atlases (Schaefer, Glasser, Gordon, Tian).
335
+ - When the user wants **effective connectivity** analysis (PPI/gPPI/DCM) via `conn-tool` or `fsl-tool`.
336
+ - After `research-idea` or `method-design` when the experiment involves fMRI data (resting-state networks, task activation, or dual-regression).
337
+
338
+ ## Complementary / Related Skills
339
+
340
+ - `bids-organizer` → organize raw DICOM/NIfTI data into BIDS structure
341
+ - `dcm2nii` → convert raw DICOM to NIfTI (if not already done)
342
+ - `smri-skill` → prepare T1w structural images (FreeSurfer preprocessing)
343
+ - `fmriprep-tool` → standardized preprocessing (motion correction, distortion correction, FreeSurfer integration, coregistration to T1w)
344
+ - `fmriprep-tool` (XCP-D integration) → post-processing denoising, scrubbing, connectivity extraction (recommended for resting-state)
345
+ - `hcppipeline-tool` → high-quality HCP-style preprocessing (ICA-FIX, MSMAll, advanced diffusion pipeline)
346
+ - `conn-tool` → advanced functional & effective connectivity analysis (ROI-to-ROI, seed-to-voxel, network ICA, PPI/gPPI, DCM)
347
+ - `fsl-tool` → ROI extraction, basic connectivity, PPI design, FEAT GLM (task-based analysis)
348
+ - `nilearn-tool` → custom ROI extraction and post-hoc connectivity analysis from NIfTI files
349
+ - `dependency-planner` → environment & dependency management
350
+
351
+ ## Reference
352
+
353
+ Aligned with NeuroClaw modality-skill pattern (see `smri-skill`, `eeg-skill`, `dwi-skill`).
354
+ **Validated pipeline**: ADNI resting-state fMRI processing workflow (fMRIPrep 23.x + XCP-D).
355
+ Core tools used:
356
+ - `fmriprep-tool` (v23.2.1+): Motion correction, coregistration, FreeSurfer wrapper
357
+ - `xcp-d` (integrated or separate): Spatial smoothing, band-pass filtering (0.01–0.08 Hz), nuisance regression (36P), scrubbing
358
+ - `hcppipeline-tool`: HCP-grade structural + functional processing (alternative)
359
+ - `conn-tool`: Advanced connectivity & effective connectivity (complementary)
360
+ - `fsl-tool`: ROI extraction, GLM, basic connectivity (complementary)
361
+ - `nilearn`: Custom ROI extraction and downstream analysis (complementary)
362
+
363
+ **Key references**:
364
+ - Poldrack et al. (2017): fMRIPrep validation
365
+ - Ciric et al. (2019): XCP-D: Motion artifact suppression via nuisance regression
366
+ - Fair et al. (2021): Correction and interpretation of fMRI-based resting-state connectivity
367
+
368
+ ---
369
+ Created At: 2026-03-25 16:02 HKT
370
+ Last Updated At: 2026-03-28 17:53 HKT
371
+ Author: chengwang96
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: fmriprep-tool
3
+ description: "Use this skill whenever the user wants to perform standardized preprocessing of functional MRI (fMRI) and anatomical MRI data using fMRIPrep. Triggers include: 'fmriprep', 'fMRIPrep', 'fMRI preprocessing', 'BIDS fMRI', 'run fmriprep', 'preprocess bold', 'BOLD preprocessing', 'anatomical preprocessing', or any request involving BIDS-organized fMRI datasets."
4
+ license: MIT License (NeuroClaw custom skill – freely modifiable within the project)
5
+ layer: base
6
+ skill_type: tool
7
+ dependencies:
8
+ - claw-shell
9
+ - bids-organizer
10
+ ---
11
+ # fMRIPrep Tool
12
+
13
+ ## Overview
14
+
15
+ fMRIPrep is a robust, standardized preprocessing pipeline for BIDS-compliant functional and anatomical MRI data. It performs best-practice steps including anatomical segmentation, functional motion correction, susceptibility distortion correction, coregistration, normalization to standard space, and generates comprehensive QC reports.
16
+
17
+ This skill serves as the **NeuroClaw interface-layer wrapper** for fMRIPrep and strictly follows the hierarchical design:
18
+
19
+ 1. Check whether fMRIPrep and its dependencies (Docker or Singularity) are installed.
20
+ 2. If missing → invoke `dependency-planner` to generate a safe installation plan.
21
+ 3. Detect input BIDS dataset structure and confirm output directory.
22
+ 4. Generate a clear, numbered execution plan with exact command, flags, estimated runtime, and risks.
23
+ 5. Present the plan and wait for explicit user confirmation (“YES” / “execute” / “proceed”).
24
+ 6. On confirmation → delegate the entire pipeline execution to `claw-shell`.
25
+ 7. After completion, summarize outputs, highlight QC reports, and suggest next steps (e.g., feeding results into analysis or paper-writing).
26
+
27
+ **Research use only.**
28
+
29
+ ## Quick Reference
30
+
31
+ | Task | Recommended Command / Approach | Typical Runtime (per subject) |
32
+ |-------------------------------|---------------------------------------------------------------------|-------------------------------|
33
+ | Full fMRIPrep pipeline | `fmriprep bids_dir output_dir participant --fs-license-file license.txt` | 2–8 hours |
34
+ | Anatomical only | `--anat-only` | 30–90 min |
35
+ | Functional only (after anat) | `--bold-only` | 1–4 hours |
36
+ | Use FreeSurfer recon-all | `--fs-subjects-dir /path/to/fs` | +2–6 hours |
37
+ | Skip susceptibility distortion| `--ignore fieldmaps` | Reduces time |
38
+ | Low memory mode | `--mem-mb 8000 --nthreads 4` | For limited resources |
39
+ | Generate detailed QC reports | Default behavior (outputs in `sub-*/figures/` and `reports/`) | Included |
40
+
41
+ ## Common Shell Command Examples
42
+
43
+ ```bash
44
+ # Standard full pipeline (most common)
45
+ fmriprep \
46
+ /data/bids \
47
+ /data/fmriprep_output \
48
+ participant \
49
+ --participant-label sub-001 sub-002 \
50
+ --fs-license-file /home/cwang/clawd/license.txt \
51
+ --nthreads 8 \
52
+ --mem-mb 16000 \
53
+ --output-spaces MNI152NLin2009cAsym \
54
+ --clean-workdir
55
+
56
+ # Anatomical preprocessing only
57
+ fmriprep /data/bids /data/fmriprep_output participant --anat-only
58
+
59
+ # Use Singularity instead of Docker (common on clusters)
60
+ singularity run --cleanenv \
61
+ /path/to/fmriprep.simg \
62
+ /data/bids /data/fmriprep_output participant \
63
+ --fs-license-file /license.txt
64
+ ```
65
+
66
+ ## Installation (Handled by dependency-planner)
67
+
68
+ Use `dependency-planner` with one of the following requests:
69
+ - “Install latest fMRIPrep using Docker”
70
+ - “Install latest fMRIPrep using Singularity”
71
+ - “Install fMRIPrep via conda/mamba in neuroclaw-fmriprep environment”
72
+
73
+ After installation, verify with:
74
+ ```bash
75
+ fmriprep --version
76
+ ```
77
+
78
+ **Prerequisites**:
79
+ - Valid FreeSurfer license (`license.txt`)
80
+ - Docker or Singularity
81
+ - Sufficient disk space (~10–30 GB per subject) and RAM (≥16 GB recommended)
82
+
83
+ ## NeuroClaw recommended wrapper script
84
+
85
+ ```python
86
+ # fmriprep_wrapper.py (placed inside the skill folder for reference)
87
+ import subprocess
88
+ import argparse
89
+ from pathlib import Path
90
+
91
+ def run_fmriprep(bids_dir, output_dir, participant_labels=None, nthreads=8, mem_mb=16000):
92
+ cmd = [
93
+ "fmriprep",
94
+ str(bids_dir),
95
+ str(output_dir),
96
+ "participant",
97
+ "--fs-license-file", "/home/cwang/clawd/license.txt",
98
+ "--nthreads", str(nthreads),
99
+ "--mem-mb", str(mem_mb),
100
+ "--output-spaces", "MNI152NLin2009cAsym",
101
+ "--clean-workdir"
102
+ ]
103
+
104
+ if participant_labels:
105
+ cmd.extend(["--participant-label"] + participant_labels)
106
+
107
+ print("Running:", " ".join(cmd))
108
+ subprocess.run(cmd, check=True)
109
+
110
+ if __name__ == "__main__":
111
+ parser = argparse.ArgumentParser()
112
+ parser.add_argument("--bids-dir", required=True)
113
+ parser.add_argument("--output-dir", required=True)
114
+ parser.add_argument("--subjects", nargs="+", default=None)
115
+ args = parser.parse_args()
116
+
117
+ run_fmriprep(args.bids_dir, args.output_dir, args.subjects)
118
+ ```
119
+
120
+ ## Important Notes & Limitations
121
+
122
+ - All actual fMRIPrep execution is routed through `claw-shell` (especially important for long-running pipelines).
123
+ - fMRIPrep is computationally intensive and disk-heavy. Always run with appropriate resource limits.
124
+ - A valid FreeSurfer license file is required if surface reconstruction is enabled.
125
+ - Outputs include preprocessed BOLD, anatomical derivatives, and rich HTML QC reports in `sub-*/figures/`.
126
+ - Work directory can become very large; use `--clean-workdir` when possible.
127
+
128
+ ## When to Call This Skill
129
+
130
+ - User has a BIDS-organized dataset and wants standardized fMRI preprocessing.
131
+ - Before advanced analysis (GLM, connectivity, MVPA, etc.).
132
+ - After `dcm2nii` when converting raw scanner data to BIDS format.
133
+
134
+ ## Post-Execution Verification (Harness Integration)
135
+
136
+ After fMRIPrep completes, this skill **automatically invokes harness-core's VerificationRunner** to validate preprocessing output quality:
137
+
138
+ **Integrated verification checks**:
139
+
140
+ ```python
141
+ from skills.harness_core import VerificationRunner, AuditLogger
142
+ import json
143
+ from pathlib import Path
144
+
145
+ verifier = VerificationRunner(task_type="fmriprep_preprocessing")
146
+
147
+ # 1. Output directory structure
148
+ verifier.add_check("output_structure",
149
+ checker=lambda: verify_fmriprep_output_structure(output_dir),
150
+ severity="error"
151
+ )
152
+
153
+ # 2. Preprocessed BOLD integrity
154
+ verifier.add_check("bold_preprocessing",
155
+ checker=lambda: verify_bold_files_exist(output_dir),
156
+ severity="error"
157
+ )
158
+
159
+ # 3. Anatomical derivatives (T1w, brain mask)
160
+ verifier.add_check("anatomical_derivatives",
161
+ checker=lambda: verify_anatomical_space_files(output_dir),
162
+ severity="error"
163
+ )
164
+
165
+ # 4. Motion parameters / confounds file
166
+ verifier.add_check("confounds_available",
167
+ checker=lambda: verify_confounds_files(output_dir),
168
+ severity="warning"
169
+ )
170
+
171
+ # 5. No NaN/Inf in preprocessed BOLD data
172
+ verifier.add_check("bold_data_integrity",
173
+ checker=lambda: verify_bold_no_nan_inf(output_dir),
174
+ severity="error"
175
+ )
176
+
177
+ # 6. QC reports generated
178
+ verifier.add_check("qc_reports",
179
+ checker=lambda: verify_qc_reports_exist(output_dir),
180
+ severity="warning"
181
+ )
182
+
183
+ # 7. fMRIPrep HTML report accessible
184
+ verifier.add_check("html_report",
185
+ checker=lambda: Path(output_dir).glob("**/report.html"),
186
+ severity="warning"
187
+ )
188
+
189
+ report = verifier.run(output_dir)
190
+
191
+ # Log verification results
192
+ logger = AuditLogger(log_file=f"{output_dir}/fmriprep_verification.jsonl")
193
+ logger.log_validation(
194
+ task_name="fmriprep_preprocessing",
195
+ checks_passed=len([r for r in report.results if r.passed]),
196
+ checks_failed=len([r for r in report.results if not r.passed]),
197
+ warnings=len([r for r in report.results if r.severity == "warning" and not r.passed]),
198
+ report_summary=report.to_dict()
199
+ )
200
+
201
+ if report.failed:
202
+ raise ValueError(f"fMRIPrep verification failed: {report.summary}")
203
+ ```
204
+
205
+ **Output files generated**:
206
+ - `{output_dir}/fmriprep_verification.jsonl` — structured audit log
207
+ - `{output_dir}/.fmriprep_verification_timestamp` — verification completion marker
208
+
209
+ ## Complementary / Related Skills
210
+
211
+ - `dependency-planner` → install fMRIPrep and dependencies
212
+ - `claw-shell` → safe execution of long-running pipeline
213
+ - `harness-core` → automated verification and audit logging
214
+
215
+ ## More Advanced Features
216
+
217
+ For advanced options (custom templates, surface-based processing, ICA-AROMA, etc.), please refer to the official fMRIPrep documentation:
218
+ - Official Documentation: https://fmriprep.org/
219
+ - User Guide: https://fmriprep.org/en/stable/
220
+ - BIDS App specification: https://bids-apps.neuroimaging.io/
221
+
222
+ You may use the `multi-search-engine` or `academic-research-hub` skill to retrieve the latest best practices or example commands.
223
+
224
+ ---
225
+
226
+ Created At: 2026-03-25 17:10 HKT
227
+ Last Updated At: 2026-04-05 02:01 HKT
228
+ Author: chengwang96