@brainpilot/skills 0.0.6 → 0.0.7
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.
- package/package.json +2 -2
- package/skills/01_Meta-Skills/academic-research-hub/SKILL.md +108 -0
- package/skills/01_Meta-Skills/academic-research-hub/scripts/requirements.txt +17 -0
- package/skills/01_Meta-Skills/academic-research-hub/scripts/research.py +781 -0
- package/skills/01_Meta-Skills/beautiful-log/SKILL.md +64 -0
- package/skills/01_Meta-Skills/beautiful-log/scripts/beautiful_log.py +274 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/SKILL.md +130 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/config.template.yaml +54 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/assets/top5_digest_template.md +5 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/build_top5_digest.py +300 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/common.py +137 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/merge_results.py +106 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/run_pipeline.py +177 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_arxiv.py +162 -0
- package/skills/01_Meta-Skills/ethoclaw-daily-paper/scripts/search_pubmed.py +202 -0
- package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/SKILL.md +173 -0
- package/skills/01_Meta-Skills/ethoclaw-normalize-tabular/scripts/normalize_data.py +874 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/SKILL.md +134 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/confirmation-prompts.md +31 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/references/output-patterns.md +45 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_markdown_deliverables.py +41 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_research_log.py +84 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/build_summary_md.py +63 -0
- package/skills/01_Meta-Skills/ethoclaw-pdf-research/scripts/extract_pdf_bundle.py +140 -0
- package/skills/01_Meta-Skills/experiment-controller/SKILL.md +140 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/SKILL.md +366 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/entity_resolution.py +120 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/extraction_prompt_template.txt +19 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/graph_query.py +106 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/hypothesis_cli_reference.py +42 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/new_data_source_template.py +116 -0
- package/skills/01_Meta-Skills/knowledge-graph-builder/scripts/requirements.txt +15 -0
- package/skills/01_Meta-Skills/method-design/SKILL.md +61 -0
- package/skills/01_Meta-Skills/multi-search-engine/SKILL.md +119 -0
- package/skills/01_Meta-Skills/research-idea/SKILL.md +65 -0
- package/skills/05_EEG_ERP/eeg-skill/SKILL.md +197 -0
- package/skills/05_EEG_ERP/meg-skill/SKILL.md +188 -0
- package/skills/05_EEG_ERP/meg-skill/scripts/time_frequency.py +223 -0
- package/skills/05_EEG_ERP/mne-eeg-tool/SKILL.md +165 -0
- package/skills/05_EEG_ERP/mne-eeg-tool/scripts/eeg_pipeline_reference.py +231 -0
- package/skills/05_EEG_ERP/seed-iv-skill/SKILL.md +184 -0
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/classify_seed_iv.py +154 -0
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/extract_seed_iv_features.py +190 -0
- package/skills/05_EEG_ERP/seed-iv-skill/scripts/validate_seed_iv.py +102 -0
- package/skills/05_EEG_ERP/seed-vig-skill/SKILL.md +182 -0
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/classify_seed_vig.py +165 -0
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/extract_seed_vig_features.py +185 -0
- package/skills/05_EEG_ERP/seed-vig-skill/scripts/validate_seed_vig.py +88 -0
- package/skills/06_fMRI_Neuroimaging/abcd-skill/SKILL.md +308 -0
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/abcd_qc_summary.py +449 -0
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/extract_abcd_phenotype.py +292 -0
- package/skills/06_fMRI_Neuroimaging/abcd-skill/scripts/reorganize_abcd.py +387 -0
- package/skills/06_fMRI_Neuroimaging/abide-skill/SKILL.md +302 -0
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/abide_qc_summary.py +317 -0
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/extract_abide_phenotype.py +267 -0
- package/skills/06_fMRI_Neuroimaging/abide-skill/scripts/reorganize_abide.py +387 -0
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/SKILL.md +244 -0
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/adhd200_qc_summary.py +98 -0
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/extract_adhd200_phenotype.py +134 -0
- package/skills/06_fMRI_Neuroimaging/adhd200-skill/scripts/reorganize_adhd200.py +206 -0
- package/skills/06_fMRI_Neuroimaging/adni-skill/SKILL.md +358 -0
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_adni_task_files.py +1305 -0
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/generate_vqa_from_tasks.py +766 -0
- package/skills/06_fMRI_Neuroimaging/adni-skill/scripts/reorganize_adni.py +491 -0
- package/skills/06_fMRI_Neuroimaging/aibl-skill/SKILL.md +295 -0
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/aibl_qc_summary.py +260 -0
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/extract_aibl_phenotype.py +365 -0
- package/skills/06_fMRI_Neuroimaging/aibl-skill/scripts/reorganize_aibl.py +394 -0
- package/skills/06_fMRI_Neuroimaging/aomic-skill/SKILL.md +292 -0
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/aomic_qc_summary.py +258 -0
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/extract_aomic_phenotype.py +284 -0
- package/skills/06_fMRI_Neuroimaging/aomic-skill/scripts/reorganize_aomic.py +322 -0
- package/skills/06_fMRI_Neuroimaging/asl-skill/SKILL.md +168 -0
- package/skills/06_fMRI_Neuroimaging/asl-skill/scripts/compute_cbf.py +224 -0
- package/skills/06_fMRI_Neuroimaging/bids-organizer/SKILL.md +241 -0
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/SKILL.md +186 -0
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/bold5000_qc_summary.py +96 -0
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/extract_bold5000_stimulus.py +125 -0
- package/skills/06_fMRI_Neuroimaging/bold5000-skill/scripts/reorganize_bold5000.py +102 -0
- package/skills/06_fMRI_Neuroimaging/camcan-skill/SKILL.md +213 -0
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/camcan_qc_summary.py +131 -0
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/extract_camcan_phenotype.py +145 -0
- package/skills/06_fMRI_Neuroimaging/camcan-skill/scripts/validate_camcan.py +141 -0
- package/skills/06_fMRI_Neuroimaging/cobre-skill/SKILL.md +201 -0
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/cobre_qc_summary.py +95 -0
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/extract_cobre_phenotype.py +104 -0
- package/skills/06_fMRI_Neuroimaging/cobre-skill/scripts/reorganize_cobre.py +140 -0
- package/skills/06_fMRI_Neuroimaging/conn-tool/SKILL.md +180 -0
- package/skills/06_fMRI_Neuroimaging/dcm2nii/SKILL.md +189 -0
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/SKILL.md +183 -0
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/dmt_har_med_qc_summary.py +96 -0
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/extract_dmt_har_med_phenotype.py +121 -0
- package/skills/06_fMRI_Neuroimaging/dmt-har-med-skill/scripts/reorganize_dmt_har_med.py +125 -0
- package/skills/06_fMRI_Neuroimaging/dwi-skill/SKILL.md +359 -0
- package/skills/06_fMRI_Neuroimaging/fmri-skill/SKILL.md +371 -0
- package/skills/06_fMRI_Neuroimaging/fmriprep-tool/SKILL.md +228 -0
- package/skills/06_fMRI_Neuroimaging/freesurfer-tool/SKILL.md +286 -0
- package/skills/06_fMRI_Neuroimaging/freesurfer-tool/scripts/freesurfer_processor.py +145 -0
- package/skills/06_fMRI_Neuroimaging/fsl-tool/SKILL.md +208 -0
- package/skills/06_fMRI_Neuroimaging/hbn-skill/SKILL.md +271 -0
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/extract_hbn_phenotype.py +107 -0
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/hbn_qc_summary.py +96 -0
- package/skills/06_fMRI_Neuroimaging/hbn-skill/scripts/reorganize_hbn.py +150 -0
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/SKILL.md +210 -0
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/extract_hcpa_phenotype.py +146 -0
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/hcpa_qc_summary.py +120 -0
- package/skills/06_fMRI_Neuroimaging/hcpa-skill/scripts/reorganize_hcpa.py +155 -0
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/SKILL.md +210 -0
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/extract_hcpd_phenotype.py +148 -0
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/hcpd_qc_summary.py +125 -0
- package/skills/06_fMRI_Neuroimaging/hcpd-skill/scripts/reorganize_hcpd.py +146 -0
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/SKILL.md +215 -0
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/extract_hcpep_phenotype.py +157 -0
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/hcpep_qc_summary.py +143 -0
- package/skills/06_fMRI_Neuroimaging/hcpep-skill/scripts/reorganize_hcpep.py +146 -0
- package/skills/06_fMRI_Neuroimaging/hcppipeline-tool/SKILL.md +217 -0
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/SKILL.md +214 -0
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/extract_hcpya_phenotype.py +190 -0
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/hcpya_qc_summary.py +152 -0
- package/skills/06_fMRI_Neuroimaging/hcpya-skill/scripts/reorganize_hcpya.py +203 -0
- package/skills/06_fMRI_Neuroimaging/ixi-skill/SKILL.md +198 -0
- package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/ixi_qc_summary.py +137 -0
- package/skills/06_fMRI_Neuroimaging/ixi-skill/scripts/reorganize_ixi.py +190 -0
- package/skills/06_fMRI_Neuroimaging/mnd-skill/SKILL.md +191 -0
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/extract_mnd_phenotype.py +143 -0
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/mnd_qc_summary.py +120 -0
- package/skills/06_fMRI_Neuroimaging/mnd-skill/scripts/validate_mnd.py +107 -0
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/SKILL.md +203 -0
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/analyze_lesions.py +119 -0
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/longitudinal_lesion.py +148 -0
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/mschallenge_qc_summary.py +132 -0
- package/skills/06_fMRI_Neuroimaging/mschallenge-skill/scripts/validate_mschallenge.py +116 -0
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/SKILL.md +184 -0
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/atlas_coordinate_reference.py +61 -0
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/freesurfer_io_reference.py +34 -0
- package/skills/06_fMRI_Neuroimaging/nibabel-skill/scripts/nifti_inspection_reference.py +35 -0
- package/skills/06_fMRI_Neuroimaging/nifd-skill/SKILL.md +205 -0
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/extract_nifd_phenotype.py +132 -0
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/nifd_qc_summary.py +111 -0
- package/skills/06_fMRI_Neuroimaging/nifd-skill/scripts/validate_nifd.py +111 -0
- package/skills/06_fMRI_Neuroimaging/nii2dcm/SKILL.md +143 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/SKILL.md +266 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/connectome_reference.py +65 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/denoise_timeseries_reference.py +58 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/hierarchical_parcellation_reference.py +53 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/kmeans_parcellation_reference.py +53 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/preprocess_bold_reference.py +76 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_dictlearning_reference.py +56 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/rest_ica_reference.py +59 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/second_level_glm_reference.py +58 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/spacenet_classifier_reference.py +59 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/svm_classifier_reference.py +60 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/task_glm_reference.py +63 -0
- package/skills/06_fMRI_Neuroimaging/nilearn-tool/scripts/zalff_summary_reference.py +109 -0
- package/skills/06_fMRI_Neuroimaging/nsd-skill/SKILL.md +210 -0
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/extract_nsd_stimulus.py +171 -0
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/nsd_qc_summary.py +142 -0
- package/skills/06_fMRI_Neuroimaging/nsd-skill/scripts/validate_nsd.py +142 -0
- package/skills/06_fMRI_Neuroimaging/oasis-skill/SKILL.md +205 -0
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/extract_oasis_phenotype.py +126 -0
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/oasis_qc_summary.py +115 -0
- package/skills/06_fMRI_Neuroimaging/oasis-skill/scripts/validate_oasis.py +119 -0
- package/skills/06_fMRI_Neuroimaging/pet-skill/SKILL.md +173 -0
- package/skills/06_fMRI_Neuroimaging/pet-skill/scripts/compute_suvr.py +202 -0
- package/skills/06_fMRI_Neuroimaging/pnc-skill/SKILL.md +206 -0
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/extract_pnc_phenotype.py +136 -0
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/pnc_qc_summary.py +116 -0
- package/skills/06_fMRI_Neuroimaging/pnc-skill/scripts/validate_pnc.py +120 -0
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/SKILL.md +209 -0
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/extract_ppmi_phenotype.py +138 -0
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/ppmi_qc_summary.py +111 -0
- package/skills/06_fMRI_Neuroimaging/ppmi-skill/scripts/validate_ppmi.py +117 -0
- package/skills/06_fMRI_Neuroimaging/qsiprep-tool/SKILL.md +320 -0
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/SKILL.md +215 -0
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/extract_rest_mdd_phenotype.py +132 -0
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/harmonize_sites.py +152 -0
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/rest_mdd_qc_summary.py +124 -0
- package/skills/06_fMRI_Neuroimaging/rest-mneta-mdd-skill/scripts/validate_rest_mdd.py +103 -0
- package/skills/06_fMRI_Neuroimaging/smri-skill/SKILL.md +302 -0
- package/skills/06_fMRI_Neuroimaging/tcp-skill/SKILL.md +204 -0
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/extract_tcp_phenotype.py +139 -0
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/tcp_qc_summary.py +111 -0
- package/skills/06_fMRI_Neuroimaging/tcp-skill/scripts/validate_tcp.py +99 -0
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/SKILL.md +217 -0
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/extract_ucla_cnp_phenotype.py +145 -0
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/ucla_cnp_qc_summary.py +111 -0
- package/skills/06_fMRI_Neuroimaging/ucla-cnp-skill/scripts/validate_ucla_cnp.py +113 -0
- package/skills/06_fMRI_Neuroimaging/ukb-skill/SKILL.md +310 -0
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/build_ukb_survival.py +210 -0
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_cases.py +308 -0
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/extract_ukb_phenotype.py +232 -0
- package/skills/06_fMRI_Neuroimaging/ukb-skill/scripts/ukb_qc_summary.py +158 -0
- package/skills/06_fMRI_Neuroimaging/wmh-segmentation/SKILL.md +133 -0
- package/skills/07_Computational_Modeling/detrending/SKILL.md +118 -0
- package/skills/07_Computational_Modeling/dictlearning/SKILL.md +122 -0
- package/skills/07_Computational_Modeling/filtering/SKILL.md +121 -0
- package/skills/07_Computational_Modeling/glm/SKILL.md +153 -0
- package/skills/07_Computational_Modeling/hierarchical/SKILL.md +121 -0
- package/skills/07_Computational_Modeling/ica/SKILL.md +122 -0
- package/skills/07_Computational_Modeling/kmeans/SKILL.md +119 -0
- package/skills/07_Computational_Modeling/run_models/SKILL.md +427 -0
- package/skills/07_Computational_Modeling/spacenet/SKILL.md +122 -0
- package/skills/07_Computational_Modeling/svm/SKILL.md +120 -0
- package/skills/08_Computational_Neuroscience/brain_gnn/SKILL.md +183 -0
- package/skills/08_Computational_Neuroscience/dipy-tool/SKILL.md +239 -0
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/dti_metrics_reference.py +70 -0
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/load_and_mask_reference.py +76 -0
- package/skills/08_Computational_Neuroscience/dipy-tool/scripts/roi_stats_reference.py +59 -0
- package/skills/08_Computational_Neuroscience/fm_app/SKILL.md +195 -0
- package/skills/08_Computational_Neuroscience/neurostorm/SKILL.md +151 -0
- package/skills/13_Visualization/brain-visualization/SKILL.md +191 -0
- package/skills/13_Visualization/brain-visualization/scripts/connectome_reference.py +108 -0
- package/skills/13_Visualization/brain-visualization/scripts/freesurfer_ply_reference.py +54 -0
- package/skills/13_Visualization/brain-visualization/scripts/zalff_summary_reference.py +116 -0
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/SKILL.md +78 -0
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/assets/naturecomm_figures.tex +74 -0
- package/skills/13_Visualization/ethoclaw-paper-figure-layout/scripts/layout_results_foldered.py +579 -0
- package/skills/14_Writing/overleaf-skill/SKILL.md +184 -0
- package/skills/14_Writing/overleaf-skill/scripts/install.sh +30 -0
- package/skills/14_Writing/paper-writing/SKILL.md +146 -0
- package/skills/14_Writing/paper-writing/scripts/data_statement_templates.py +164 -0
- package/skills/14_Writing/paper-writing/scripts/figure_templates.py +315 -0
- package/skills/14_Writing/paper-writing/scripts/nature_figure_style.py +214 -0
- package/skills/14_Writing/paper-writing/scripts/section_phrasebank.py +246 -0
- package/skills/16_Animal_Behavior/deeplabcut/SKILL.md +154 -0
- package/skills/16_Animal_Behavior/deeplabcut/references/3d-pose.md +89 -0
- package/skills/16_Animal_Behavior/deeplabcut/references/maDLC.md +123 -0
- package/skills/16_Animal_Behavior/deeplabcut/references/modelzoo.md +98 -0
- package/skills/16_Animal_Behavior/deeplabcut/references/standard-pipeline.md +165 -0
- package/skills/16_Animal_Behavior/deeplabcut/references/utilities.md +146 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/SKILL.md +274 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.html +112 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/report_template_en.md +21 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/cluster-section.md +5 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/heatmap-section.md +5 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/integrated-interpretation.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/overview.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/project-summary.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/radar-section.md +5 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/raw-trajectory.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/sample-check.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/single-subject-section.md +3 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/assets/section_templates/stats-section.md +5 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/epm.md +52 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/fst.md +37 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/nor.md +39 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/oft.md +43 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tcst.md +45 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/experiment-types/tst.md +36 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/input-types.md +59 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/interpretation-guardrails.md +45 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/metadata-schema.md +57 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/report-sections.md +86 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/references/section-selection-rules.md +169 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/build_report_manifest.py +27 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/render_report.py +34 -0
- package/skills/16_Animal_Behavior/ethoclaw-analysis-report/scripts/report_utils.py +1121 -0
- package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/SKILL.md +390 -0
- package/skills/16_Animal_Behavior/ethoclaw-animal-grounding/reference_code.py +98 -0
- package/skills/16_Animal_Behavior/ethoclaw-animal-pose-estimation/SKILL.md +336 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/README.md +21 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/SKILL.md +41 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/batch_kinematic_generator.py +663 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/config.json +19 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/generate_kinematic_parameter.py +401 -0
- package/skills/16_Animal_Behavior/ethoclaw-kinematic-parameter-generator/kinematic_generator.py +265 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/SKILL.md +72 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/references/config.example.toml +56 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params.py +232 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-clustermap-generate/scripts/cluster_all_params_from_config.py +236 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/SKILL.md +68 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/references/notes.md +5 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-radar-generate/scripts/plot_h5_radar.py +513 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/SKILL.md +52 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/config.toml +81 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/references/stats-rule.md +18 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_inspect.py +79 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_batch.py +624 -0
- package/skills/16_Animal_Behavior/ethoclaw-multiparameter-violin-stats-generate/scripts/h5_violin_stats.py +438 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/SKILL.md +280 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_trajectory.py +790 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/core_scripts/heatmap_velocity.py +855 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.csv +101 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_2d.h5 +0 -0
- package/skills/16_Animal_Behavior/ethoclaw-trajectory-velocity-heatmap-generate/reference_data/reference_data_readme.md +126 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import nibabel as nib
|
|
7
|
+
import numpy as np
|
|
8
|
+
import pandas as pd
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def roi_stats(metric_path: Path, roi_path: Path, label_path: Path | None, out_csv: Path, min_voxels: int) -> None:
|
|
12
|
+
metric = nib.load(str(metric_path)).get_fdata()
|
|
13
|
+
roi = nib.load(str(roi_path)).get_fdata().astype(int)
|
|
14
|
+
|
|
15
|
+
labels = None
|
|
16
|
+
if label_path is not None:
|
|
17
|
+
labels = [line.strip() for line in label_path.read_text(encoding="utf-8", errors="ignore").splitlines() if line.strip()]
|
|
18
|
+
|
|
19
|
+
rows = []
|
|
20
|
+
for label_id in np.unique(roi):
|
|
21
|
+
if label_id == 0:
|
|
22
|
+
continue
|
|
23
|
+
values = metric[roi == label_id]
|
|
24
|
+
values = values[np.isfinite(values)]
|
|
25
|
+
if values.size < min_voxels:
|
|
26
|
+
continue
|
|
27
|
+
|
|
28
|
+
rows.append(
|
|
29
|
+
{
|
|
30
|
+
"label": int(label_id),
|
|
31
|
+
"label_name": labels[int(label_id) - 1] if labels is not None and int(label_id) - 1 < len(labels) else "",
|
|
32
|
+
"n_vox": int(values.size),
|
|
33
|
+
"mean": float(values.mean()),
|
|
34
|
+
"median": float(np.median(values)),
|
|
35
|
+
"std": float(values.std(ddof=1)) if values.size > 1 else 0.0,
|
|
36
|
+
"p05": float(np.percentile(values, 5)),
|
|
37
|
+
"p95": float(np.percentile(values, 95)),
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
pd.DataFrame(rows).sort_values("label").to_csv(out_csv, index=False)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def main() -> None:
|
|
45
|
+
parser = argparse.ArgumentParser(description="Reference DIPY snippet for atlas-based ROI statistics on tensor metrics.")
|
|
46
|
+
parser.add_argument("--metric", type=Path, required=True, help="Input metric NIfTI such as FA.nii.gz.")
|
|
47
|
+
parser.add_argument("--roi", type=Path, required=True, help="Atlas or ROI label NIfTI in the same space as the metric.")
|
|
48
|
+
parser.add_argument("--output", type=Path, required=True, help="Output CSV path.")
|
|
49
|
+
parser.add_argument("--labels", type=Path, default=None, help="Optional atlas label text file.")
|
|
50
|
+
parser.add_argument("--min-voxels", type=int, default=10, help="Minimum voxel count for a region to be reported.")
|
|
51
|
+
args = parser.parse_args()
|
|
52
|
+
|
|
53
|
+
args.output.parent.mkdir(parents=True, exist_ok=True)
|
|
54
|
+
roi_stats(args.metric, args.roi, args.labels, args.output, args.min_voxels)
|
|
55
|
+
print(f"Saved ROI statistics to: {args.output}")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
if __name__ == "__main__":
|
|
59
|
+
main()
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fm_app
|
|
3
|
+
description: "Use this model doc whenever the user wants to run FM-APP for phenotype prediction using fMRI ROI features and optional sMRI features. This document provides model-level usage and delegates preprocessing to fmri-skill and smri-skill."
|
|
4
|
+
license: MIT License (NeuroClaw custom skill - freely modifiable within the project)
|
|
5
|
+
layer: base
|
|
6
|
+
skill_type: model
|
|
7
|
+
dependencies:
|
|
8
|
+
- fmri-skill
|
|
9
|
+
- smri-skill
|
|
10
|
+
- run_models
|
|
11
|
+
---
|
|
12
|
+
# FM-APP Model Doc
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
FM-APP is a multi-stage framework for phenotype prediction via fMRI to sMRI knowledge transfer.
|
|
16
|
+
|
|
17
|
+
- Paper: He Z, Li W, Liu Y, et al. FM-APP, IEEE TMI, 2024, 44(10): 4010-4022
|
|
18
|
+
- Official code: https://github.com/ZhibinHe/FM-APP
|
|
19
|
+
- Primary input: fMRI ROI connectivity features
|
|
20
|
+
- Additional input: sMRI ROI structural features (required in Stage 2)
|
|
21
|
+
- Primary output: multi-phenotype prediction and zero-shot phenotype reconstruction
|
|
22
|
+
|
|
23
|
+
In NeuroClaw, this is model-level guidance. Upstream preparation should be delegated to:
|
|
24
|
+
- `fmri-skill` for fMRI preprocessing and ROI extraction
|
|
25
|
+
- `smri-skill` for structural ROI feature extraction
|
|
26
|
+
- `hcpya-skill` if HCP Young Adult download/orchestration is needed
|
|
27
|
+
|
|
28
|
+
**Research use only.**
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Quick Start (From git clone)
|
|
33
|
+
|
|
34
|
+
### 1) Clone repository
|
|
35
|
+
```bash
|
|
36
|
+
git clone https://github.com/ZhibinHe/FM-APP.git
|
|
37
|
+
cd FM-APP
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2) Create environment and install dependencies
|
|
41
|
+
```bash
|
|
42
|
+
python -m venv .venv
|
|
43
|
+
source .venv/bin/activate
|
|
44
|
+
pip install -r requirements.txt
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If using GPU, install CUDA-compatible PyTorch and graph-related packages first.
|
|
48
|
+
|
|
49
|
+
### 3) Prepare required data
|
|
50
|
+
Before training, ensure these are ready:
|
|
51
|
+
- fMRI ROI/connectivity features from `fmri-skill`
|
|
52
|
+
- sMRI ROI structural features from `smri-skill` (for Stage 2)
|
|
53
|
+
- phenotype CSV files and text feature tensors in `data/`
|
|
54
|
+
|
|
55
|
+
### 4) Run staged pipeline
|
|
56
|
+
```bash
|
|
57
|
+
# Stage 0: data preparation (example scripts)
|
|
58
|
+
python 00-create-folder_hcp_4fmri.py
|
|
59
|
+
python 01-fetch_data_hcp_4fmri.py
|
|
60
|
+
python 02-process_data_hcp_4fmri.py
|
|
61
|
+
|
|
62
|
+
# Stage 1: fMRI model training
|
|
63
|
+
python 101-main_stage1_fmri_HCP.py
|
|
64
|
+
|
|
65
|
+
# Stage 2: fMRI-T1w alignment
|
|
66
|
+
python 102-main_stage2_fmri_t1w_HCP.py
|
|
67
|
+
|
|
68
|
+
# Stage 3: decoder and zero-shot inference
|
|
69
|
+
python 103-main_stage3_t1w_HCP.py
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## Pipeline Definition
|
|
75
|
+
|
|
76
|
+
| Stage | Script pattern | Purpose | Core output |
|
|
77
|
+
|---|---|---|---|
|
|
78
|
+
| Stage 0 | `00-*`, `01-*`, `02-*` | Data folder setup, ROI connectivity extraction, HDF5 packaging | `raw/*.h5`, processed inputs |
|
|
79
|
+
| Stage 1 | `101-main_stage1_fmri_HCP.py` | fMRI feature extraction and phenotype regression | `model/stage1_*.pth`, `model/stage1_dataset_*.pt` |
|
|
80
|
+
| Stage 2 | `102-main_stage2_fmri_t1w_HCP.py` | fMRI-T1w feature alignment (Sinkhorn-RPM) | `model/stage2_*.pth` |
|
|
81
|
+
| Stage 3 | `103-main_stage3_t1w_HCP.py` | masked decoder training and zero-shot phenotype inference | stage-3 checkpoints and inference outputs |
|
|
82
|
+
|
|
83
|
+
Run order must be: Stage 0 -> Stage 1 -> Stage 2 -> Stage 3.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Stage Inputs and Outputs
|
|
88
|
+
|
|
89
|
+
### Stage 0 (Data Preparation)
|
|
90
|
+
Required inputs:
|
|
91
|
+
- subject lists and dataset files (HCP/HCPA)
|
|
92
|
+
- phenotype CSV files under `data/`
|
|
93
|
+
- pre-encoded text feature tensors (`*.pt`)
|
|
94
|
+
|
|
95
|
+
Main outputs:
|
|
96
|
+
- per-subject connectivity features (corr/pcorr)
|
|
97
|
+
- HDF5 packaged samples for model training
|
|
98
|
+
|
|
99
|
+
### Stage 1 (fMRI Training)
|
|
100
|
+
Required inputs:
|
|
101
|
+
- Stage 0 packaged features
|
|
102
|
+
- phenotype text features
|
|
103
|
+
|
|
104
|
+
Main outputs:
|
|
105
|
+
- best checkpoint: `model/stage1_fmri_best_*.pth`
|
|
106
|
+
- stage1 feature package: `model/stage1_dataset_*.pt`
|
|
107
|
+
|
|
108
|
+
### Stage 2 (fMRI-sMRI Alignment)
|
|
109
|
+
Required inputs:
|
|
110
|
+
- frozen Stage 1 model/features
|
|
111
|
+
- sMRI ROI features (e.g., 333x9 per subject)
|
|
112
|
+
|
|
113
|
+
Main outputs:
|
|
114
|
+
- best checkpoint: `model/stage2_fmri_to_t1w_best_*.pth`
|
|
115
|
+
|
|
116
|
+
### Stage 3 (Decoder and Zero-shot)
|
|
117
|
+
Required inputs:
|
|
118
|
+
- Stage 1 fused features and regression weights
|
|
119
|
+
- masks / phenotype supervision setup
|
|
120
|
+
|
|
121
|
+
Main outputs:
|
|
122
|
+
- decoder checkpoints
|
|
123
|
+
- reconstructed masked phenotype representations
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Typical Configuration Notes
|
|
128
|
+
|
|
129
|
+
- Atlas: Gordon333 (333 ROIs)
|
|
130
|
+
- Stage 1 typical settings: Adam, lr=0.0005, batch size=8, long-epoch training
|
|
131
|
+
- Stage 2 includes Sinkhorn matching; runtime is usually higher than Stage 1
|
|
132
|
+
- Stage 3 supports zero-shot phenotype inference using masked reconstruction
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Recommended Directory Layout
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
FM-APP/
|
|
140
|
+
data/
|
|
141
|
+
HCP_train_phenotype.csv
|
|
142
|
+
HCP_test_phenotype.csv
|
|
143
|
+
HCP_all_phenotype.csv
|
|
144
|
+
HCPA_train_phenotype.csv
|
|
145
|
+
HCPA_test_phenotype.csv
|
|
146
|
+
phenotype_text_feature_tr.pt
|
|
147
|
+
phenotype_text_feature_te.pt
|
|
148
|
+
HCPA_phenotype_text_feature_tr.pt
|
|
149
|
+
HCPA_phenotype_text_feature_te.pt
|
|
150
|
+
raw/
|
|
151
|
+
*.h5
|
|
152
|
+
model/
|
|
153
|
+
stage1_*.pth
|
|
154
|
+
stage2_*.pth
|
|
155
|
+
stage1_dataset_*.pt
|
|
156
|
+
net/
|
|
157
|
+
imports/
|
|
158
|
+
loss_function/
|
|
159
|
+
util/
|
|
160
|
+
requirements.txt
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## NeuroClaw Delegation Rules
|
|
166
|
+
|
|
167
|
+
- fMRI preprocessing and ROI extraction: `fmri-skill`
|
|
168
|
+
- sMRI feature extraction: `smri-skill`
|
|
169
|
+
- HCP data orchestration: `hcpya-skill` (or `hcpa-skill` / `hcpd-skill` / `hcpep-skill` for other HCP variants)
|
|
170
|
+
- dependency management: `dependency-planner` + `conda-env-manager`
|
|
171
|
+
- command execution: `claw-shell`
|
|
172
|
+
|
|
173
|
+
No execution before explicit plan confirmation.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Limitations and Notes
|
|
178
|
+
|
|
179
|
+
- CUDA-capable GPU is strongly recommended for training.
|
|
180
|
+
- Stage 2 depends on valid Stage 1 artifacts and sMRI features.
|
|
181
|
+
- Stage 3 depends on `stage1_dataset_*.pt` and proper masking setup.
|
|
182
|
+
- Keep train/val/test split strict to avoid leakage.
|
|
183
|
+
- Verify phenotype column counts and subject ID alignment before Stage 1.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Reference
|
|
188
|
+
|
|
189
|
+
- He Z, Li W, Liu Y, et al. FM-APP: Foundation model for any phenotype prediction via fMRI to sMRI knowledge transfer. IEEE Transactions on Medical Imaging, 2024, 44(10): 4010-4022.
|
|
190
|
+
- Official repository: https://github.com/ZhibinHe/FM-APP
|
|
191
|
+
- NeuroSTORM HCP download scripts: https://github.com/CUHK-AIM-Group/NeuroSTORM/tree/main/scripts/dataset_download
|
|
192
|
+
|
|
193
|
+
Created At: 2026-03-28 20:03 HKT
|
|
194
|
+
Last Updated At: 2026-03-28 20:03 HKT
|
|
195
|
+
Author: chengwang96
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: neurostorm
|
|
3
|
+
description: "Use this skill whenever the user wants to preprocess fMRI data, pretrain or fine-tune NeuroSTORM, run inference, or benchmark on fMRI tasks (age/gender prediction, phenotype prediction, disease diagnosis, fMRI retrieval, task fMRI state classification). Triggers include: 'fMRI', 'NeuroSTORM', 'fMRI preprocessing', 'fMRI foundation model', 'brain imaging', 'HCP', 'ABCD', 'UKB', 'ADHD200', 'COBRE', 'UCLA', 'NSD', 'BOLD5000', 'disease diagnosis from fMRI', 'pretrain fMRI model', 'fine-tune fMRI', or any request involving .nii/.nii.gz fMRI volume files."
|
|
4
|
+
license: MIT
|
|
5
|
+
layer: base
|
|
6
|
+
skill_type: model
|
|
7
|
+
dependencies:
|
|
8
|
+
- fmri-skill
|
|
9
|
+
- smri-skill
|
|
10
|
+
- run_models
|
|
11
|
+
---
|
|
12
|
+
# NeuroSTORM Skill
|
|
13
|
+
## Overview
|
|
14
|
+
`neurostorm-skill` covers all workflows for the **NeuroSTORM fMRI foundation model**: data downloading, preprocessing, pre-training, fine-tuning, and inference.
|
|
15
|
+
**Supported tasks:**
|
|
16
|
+
| ID | Task |
|
|
17
|
+
|----|------|
|
|
18
|
+
| 1 | Age & Gender Prediction |
|
|
19
|
+
| 2 | Phenotype Prediction |
|
|
20
|
+
| 3 | Disease Diagnosis |
|
|
21
|
+
| 4 | fMRI Retrieval |
|
|
22
|
+
| 5 | Task fMRI State Classification |
|
|
23
|
+
**Supported datasets:** HCP1200, ABCD, UKB, Cobre, ADHD200, HCPA, HCPD, UCLA, HCPEP, HCPTASK, GOD, NSD, BOLD5000
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Create conda environment
|
|
29
|
+
conda create -n neurostorm python=3.11
|
|
30
|
+
conda activate neurostorm
|
|
31
|
+
# 2. Install PyTorch (CUDA 12.8 example)
|
|
32
|
+
pip install torch==2.7.1 torchvision==0.22.1 torchaudio==2.7.1 \
|
|
33
|
+
--index-url https://download.pytorch.org/whl/cu128
|
|
34
|
+
# 3. Install remaining dependencies
|
|
35
|
+
pip install tensorboard tensorboardX tqdm ipdb nvitop monai \
|
|
36
|
+
pytorch-lightning==1.9.4 neptune nibabel nilearn numpy
|
|
37
|
+
# 4. (Optional) Install Mamba SSM for NeuroSTORM backbone
|
|
38
|
+
git clone https://github.com/Dao-AILab/causal-conv1d.git && cd causal-conv1d
|
|
39
|
+
TORCH_CUDA_ARCH_LIST="12.0" pip install --no-build-isolation -e .
|
|
40
|
+
git clone https://github.com/state-spaces/mamba.git && cd mamba
|
|
41
|
+
TORCH_CUDA_ARCH_LIST="12.0" pip install --no-build-isolation -e .
|
|
42
|
+
```
|
|
43
|
+
Alternatively, use the provided Docker image:
|
|
44
|
+
```bash
|
|
45
|
+
docker build -t neurostorm:latest .
|
|
46
|
+
docker run --gpus all -it --rm \
|
|
47
|
+
-v $(pwd):/workspace \
|
|
48
|
+
-v /path/to/data:/workspace/data \
|
|
49
|
+
--shm-size=8g neurostorm:latest
|
|
50
|
+
```
|
|
51
|
+
---
|
|
52
|
+
## Workflows
|
|
53
|
+
|
|
54
|
+
### 1. Data Preprocessing
|
|
55
|
+
**Input:** Raw fMRI volumes in MNI152 space (`.nii` / `.nii.gz`)
|
|
56
|
+
**Output:** Per-frame `.pt` tensor files ready for model input
|
|
57
|
+
```bash
|
|
58
|
+
# Brain extraction (requires FSL)
|
|
59
|
+
bash datasets/brain_extraction.sh /path/to/raw /path/to/extracted
|
|
60
|
+
# Convert to 4D volume tensors (background removal, resampling, Z-normalization)
|
|
61
|
+
python datasets/preprocessing_volume.py \
|
|
62
|
+
--dataset_name hcp \
|
|
63
|
+
--load_root ./data/hcp \
|
|
64
|
+
--save_root ./processed_data/hcp \
|
|
65
|
+
--num_processes 8
|
|
66
|
+
# (Optional) Convert to 2D ROI time series or functional correlation matrix
|
|
67
|
+
python datasets/generate_roi_data_from_nii.py \
|
|
68
|
+
--atlas_names aal3 cc200 \
|
|
69
|
+
--dataset_names hcp \
|
|
70
|
+
--output_dir ./processed_data \
|
|
71
|
+
--num_processes 8
|
|
72
|
+
```
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
### 2. Pre-training
|
|
76
|
+
**Input:** Preprocessed `.pt` volume files
|
|
77
|
+
**Output:** Pre-trained model checkpoint (`.ckpt`)
|
|
78
|
+
```bash
|
|
79
|
+
# MAE-based pre-training on HCP-YA
|
|
80
|
+
python main.py \
|
|
81
|
+
--pretraining \
|
|
82
|
+
--use_mae \
|
|
83
|
+
--model neurostorm \
|
|
84
|
+
--dataset_name HCP1200 \
|
|
85
|
+
--image_path ./processed_data/hcp \
|
|
86
|
+
--mask_ratio 0.5 \
|
|
87
|
+
--batch_size 8 \
|
|
88
|
+
--learning_rate 1e-4 \
|
|
89
|
+
--max_epochs 100 \
|
|
90
|
+
--loggername tensorboard \
|
|
91
|
+
--project_name pt_neurostorm_mae
|
|
92
|
+
```
|
|
93
|
+
See `scripts/hcp_pretrain/` for ready-made pre-training scripts.
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### 3. Fine-tuning
|
|
97
|
+
**Input:** Preprocessed `.pt` files + pre-trained checkpoint
|
|
98
|
+
**Output:** Fine-tuned checkpoint (`.ckpt`) + TensorBoard logs
|
|
99
|
+
```bash
|
|
100
|
+
# Example: gender classification on HCP-YA
|
|
101
|
+
python main.py \
|
|
102
|
+
--model neurostorm \
|
|
103
|
+
--dataset_name HCP1200 \
|
|
104
|
+
--image_path ./processed_data/hcp \
|
|
105
|
+
--load_model_path ./pretrained_models/neurostorm_mae.ckpt \
|
|
106
|
+
--downstream_task_id 1 \
|
|
107
|
+
--downstream_task_type classification \
|
|
108
|
+
--task_name sex \
|
|
109
|
+
--batch_size 12 \
|
|
110
|
+
--learning_rate 5e-5 \
|
|
111
|
+
--max_epochs 30 \
|
|
112
|
+
--loggername tensorboard \
|
|
113
|
+
--project_name ft_neurostorm_gender
|
|
114
|
+
```
|
|
115
|
+
See `scripts/hcp_downstream/` and other `*_downstream/` folders for task-specific scripts.
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### 4. Inference / Demo
|
|
119
|
+
**Input:** HCP-YA dataset + fine-tuned checkpoint
|
|
120
|
+
**Output:** Prediction results printed to stdout
|
|
121
|
+
```bash
|
|
122
|
+
# Quick demo (age, gender, phenotype)
|
|
123
|
+
sh scripts/run_demo.sh
|
|
124
|
+
# Or directly:
|
|
125
|
+
python demo.py \
|
|
126
|
+
--ckpt_path /path/to/gender.ckpt \
|
|
127
|
+
--task gender \
|
|
128
|
+
--image_path /path/to/HCP1200 \
|
|
129
|
+
--devices 1 \
|
|
130
|
+
--precision 32
|
|
131
|
+
```
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Input / Output Summary
|
|
135
|
+
| Stage | Input | Output |
|
|
136
|
+
|-------|-------|--------|
|
|
137
|
+
| Preprocessing | `.nii` / `.nii.gz` volumes in MNI152 space | Per-frame `.pt` tensors |
|
|
138
|
+
| Pre-training | Preprocessed `.pt` files | Model checkpoint `.ckpt` |
|
|
139
|
+
| Fine-tuning | `.pt` files + pre-trained `.ckpt` | Fine-tuned `.ckpt` + logs |
|
|
140
|
+
| Inference | `.pt` files + fine-tuned `.ckpt` | Predictions (stdout / CSV) |
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Reference
|
|
144
|
+
- Paper: *Towards a General-Purpose Foundation Model for fMRI Analysis* (Nature Biomedical Engineering, 2026)
|
|
145
|
+
- Project: https://cuhk-aim-group.github.io/NeuroSTORM/
|
|
146
|
+
- GitHub: https://github.com/CUHK-AIM-Group/NeuroSTORM
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
Created At: 2026-04-02 00:23 HKT
|
|
150
|
+
Last Updated At: 2026-04-02 00:23 HKT
|
|
151
|
+
Author: chengwang96
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: brain-visualization
|
|
3
|
+
description: "Use this skill whenever the user wants to visualize neuroimaging analysis results, including 3D brain connectivity networks, atlas-based regional activation summaries, or FreeSurfer cortical surface meshes with anatomical colors. Triggers include: 'brain visualization', 'visualize connectome', '3D brain network', 'zALFF visualization', 'brain activation map', 'FreeSurfer PLY export', 'surface mesh rendering', or any request to turn neuroimaging outputs into interpretable figures or 3D models."
|
|
4
|
+
license: MIT License (NeuroClaw custom skill - freely modifiable within the project)
|
|
5
|
+
layer: base
|
|
6
|
+
skill_type: tool
|
|
7
|
+
dependencies:
|
|
8
|
+
- nibabel-skill
|
|
9
|
+
- nilearn-tool
|
|
10
|
+
---
|
|
11
|
+
# Brain Visualization
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
`brain-visualization` is the NeuroClaw skill for turning processed neuroimaging outputs into publication-friendly figures and 3D assets.
|
|
16
|
+
|
|
17
|
+
It focuses on three common visualization tasks drawn from the methods demonstrated in the referenced rs-fMRI tutorial:
|
|
18
|
+
- 3D brain connectivity visualization from atlas coordinates and ROI-to-ROI connectivity matrices
|
|
19
|
+
- atlas-based brain region activation ranking and coordinate export from zALFF-like volumetric maps
|
|
20
|
+
- FreeSurfer cortical surface export to colored PLY meshes for downstream 3D rendering
|
|
21
|
+
|
|
22
|
+
This skill is intended for analysis outputs that already exist. It does not replace preprocessing or statistical modeling skills such as `fmri-skill`, `nilearn-tool`, `freesurfer-tool`, or `fsl-tool`.
|
|
23
|
+
|
|
24
|
+
## Agent Reference Rule
|
|
25
|
+
|
|
26
|
+
When implementing or adapting visualization workflows, the agent should first consult the curated reference snippets in `skills/brain-visualization/scripts/` instead of copying directly from the tutorial scripts with hard-coded paths.
|
|
27
|
+
|
|
28
|
+
Reference snippets available:
|
|
29
|
+
- `scripts/connectome_reference.py` -> atlas coordinate extraction + strongest-edge connectome plotting
|
|
30
|
+
- `scripts/zalff_summary_reference.py` -> MNI resampling + zALFF regional summary + coordinate export
|
|
31
|
+
- `scripts/freesurfer_ply_reference.py` -> FreeSurfer surface + annotation to colored PLY export
|
|
32
|
+
|
|
33
|
+
These snippets are distilled from `rs-fMRI-Pipeline-Tutorial/` and are intended as the preferred starting point for new agent-generated code in this skill.
|
|
34
|
+
|
|
35
|
+
## Quick Reference
|
|
36
|
+
|
|
37
|
+
| Task | What needs to be visualized | Typical input | Expected output |
|
|
38
|
+
|------|-----------------------------|---------------|-----------------|
|
|
39
|
+
| 3D connectome figure | strongest ROI-to-ROI connections on a template brain | atlas NIfTI + connectivity matrix (`.npy` / `.csv`) + template T1 | static network figure (`.png`) |
|
|
40
|
+
| Regional activation summary | top active atlas regions with MNI coordinates | BOLD-derived zALFF or similar volumetric map + atlas + labels | ranked CSV table + coordinate table |
|
|
41
|
+
| FreeSurfer surface export | anatomical cortical mesh with region colors | `lh.pial` / `rh.pial` + `.annot` files | colored mesh (`.ply`) |
|
|
42
|
+
| Publication-ready snapshots | compact figures for reports or manuscripts | any of the above | PNG figures and tabular summaries |
|
|
43
|
+
|
|
44
|
+
## Core Visualization Patterns
|
|
45
|
+
|
|
46
|
+
### 1. 3D Brain Network Visualization
|
|
47
|
+
|
|
48
|
+
Recommended when the user has a connectivity matrix and wants an interpretable whole-brain figure.
|
|
49
|
+
|
|
50
|
+
Typical approach:
|
|
51
|
+
- Load an atlas image such as AAL3 and derive ROI coordinates with Nilearn.
|
|
52
|
+
- Load a symmetric functional connectivity matrix.
|
|
53
|
+
- Zero the diagonal and keep only the strongest edges for readability.
|
|
54
|
+
- Plot the network on a standard-space template using `nilearn.plotting.plot_connectome`.
|
|
55
|
+
|
|
56
|
+
Typical Python stack:
|
|
57
|
+
- `numpy`
|
|
58
|
+
- `nibabel`
|
|
59
|
+
- `matplotlib`
|
|
60
|
+
- `nilearn`
|
|
61
|
+
|
|
62
|
+
Example command pattern:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
python skills/brain-visualization/scripts/connectome_reference.py \
|
|
66
|
+
--atlas path/to/AAL3v1.nii \
|
|
67
|
+
--template path/to/mni_icbm152_t1_tal_nlin_sym_09a.nii \
|
|
68
|
+
--matrix path/to/fc_matrix.npy \
|
|
69
|
+
--output outputs/3D_brain_network.png
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Recommended outputs:
|
|
73
|
+
- `3D_brain_network_AAL166_strongest.png`
|
|
74
|
+
|
|
75
|
+
### 2. Atlas-Based Regional Activation Summary
|
|
76
|
+
|
|
77
|
+
Recommended when the user wants a ranked list of active regions rather than only a voxelwise map.
|
|
78
|
+
|
|
79
|
+
Typical approach:
|
|
80
|
+
- Resample BOLD-derived data into MNI space.
|
|
81
|
+
- Compute ALFF or zALFF-like summary statistics.
|
|
82
|
+
- Use `NiftiLabelsMasker` to extract atlas-level regional values.
|
|
83
|
+
- Rank regions and export the top regions with MNI coordinates.
|
|
84
|
+
|
|
85
|
+
Typical Python stack:
|
|
86
|
+
- `numpy`
|
|
87
|
+
- `pandas`
|
|
88
|
+
- `nibabel`
|
|
89
|
+
- `nilearn`
|
|
90
|
+
|
|
91
|
+
Example command pattern:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
python skills/brain-visualization/scripts/zalff_summary_reference.py \
|
|
95
|
+
--bold path/to/rest_bold.nii.gz \
|
|
96
|
+
--atlas path/to/AAL3v1.nii \
|
|
97
|
+
--labels path/to/AAL3v1.nii.txt \
|
|
98
|
+
--mask path/to/mni_mask.nii.gz \
|
|
99
|
+
--output-dir outputs/active_brain_results
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Recommended outputs:
|
|
103
|
+
- `TOP10_active_regions.csv`
|
|
104
|
+
- `top10_coordinates.csv`
|
|
105
|
+
- `all_brain_regions_activity.csv`
|
|
106
|
+
|
|
107
|
+
### 3. FreeSurfer Colored Surface Export
|
|
108
|
+
|
|
109
|
+
Recommended when the user needs a mesh that can be opened in Blender, MeshLab, or downstream 3D pipelines.
|
|
110
|
+
|
|
111
|
+
Typical approach:
|
|
112
|
+
- Read FreeSurfer geometry from `lh.pial` / `rh.pial`.
|
|
113
|
+
- Read anatomical labels from `lh.aparc.annot` / `rh.aparc.annot`.
|
|
114
|
+
- Map vertex labels to RGB colors from the annotation color table.
|
|
115
|
+
- Export ASCII PLY with per-vertex color fields.
|
|
116
|
+
|
|
117
|
+
Typical Python stack:
|
|
118
|
+
- `nibabel`
|
|
119
|
+
- `numpy`
|
|
120
|
+
|
|
121
|
+
Example command pattern:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
python skills/brain-visualization/scripts/freesurfer_ply_reference.py \
|
|
125
|
+
--surf path/to/lh.pial \
|
|
126
|
+
--annot path/to/lh.aparc.annot \
|
|
127
|
+
--output outputs/lh_colored.ply
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Recommended outputs:
|
|
131
|
+
- left hemisphere colored mesh (`.ply`)
|
|
132
|
+
- right hemisphere colored mesh (`.ply`)
|
|
133
|
+
|
|
134
|
+
## Installation
|
|
135
|
+
|
|
136
|
+
Install the common visualization dependencies in the existing `neuroclaw` environment:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
conda activate neuroclaw
|
|
140
|
+
conda install -n neuroclaw -c conda-forge numpy pandas nibabel nilearn matplotlib networkx -y
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Optional packages depending on workflow:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
conda install -n neuroclaw -c conda-forge scipy seaborn plotly -y
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
If FreeSurfer surface export is needed, ensure FreeSurfer outputs already exist and `nibabel` can access the surface and annotation files.
|
|
150
|
+
|
|
151
|
+
## When to Call This Skill
|
|
152
|
+
|
|
153
|
+
- The user has already produced a connectivity matrix and wants a 3D connectome figure.
|
|
154
|
+
- The user needs atlas-level summaries of resting-state activation metrics such as zALFF.
|
|
155
|
+
- The user wants to export FreeSurfer cortical surfaces into colored 3D meshes.
|
|
156
|
+
- The user is preparing figures or supplementary materials for papers, presentations, or reports.
|
|
157
|
+
|
|
158
|
+
## Complementary / Related Skills
|
|
159
|
+
|
|
160
|
+
- `fmri-skill` -> preprocessing and fMRI workflow planning
|
|
161
|
+
- `nilearn-tool` -> ROI extraction, connectivity computation, seed maps, GLM support
|
|
162
|
+
- `freesurfer-tool` -> anatomical reconstruction and parcellation generation
|
|
163
|
+
- `paper-writing` -> convert generated figures/tables into manuscript assets
|
|
164
|
+
|
|
165
|
+
## Important Notes & Limitations
|
|
166
|
+
|
|
167
|
+
- This skill is for visualization and result packaging, not raw image preprocessing.
|
|
168
|
+
- Connectivity figures should usually threshold or sparsify edges; plotting full dense matrices produces unreadable figures.
|
|
169
|
+
- Atlas labels, atlas volume, and connectivity matrix dimensions must match.
|
|
170
|
+
- MNI-space summary workflows assume the volume has already been aligned or resampled appropriately.
|
|
171
|
+
- FreeSurfer colored PLY export depends on valid `.annot` files; missing or mismatched annotations will degrade vertex coloring.
|
|
172
|
+
|
|
173
|
+
## Reference
|
|
174
|
+
|
|
175
|
+
This skill is adapted from the visualization ideas and example workflows in:
|
|
176
|
+
- rs-fMRI-Pipeline-Tutorial: https://github.com/Karcen/rs-fMRI-Pipeline-Tutorial
|
|
177
|
+
|
|
178
|
+
Key referenced methods in the local tutorial copy:
|
|
179
|
+
- 3D brain network plotting with AAL atlas and Nilearn
|
|
180
|
+
- MNI152 zALFF regional activation ranking
|
|
181
|
+
- FreeSurfer colored cortical surface export to PLY
|
|
182
|
+
|
|
183
|
+
Curated reference snippets in this skill:
|
|
184
|
+
- `skills/brain-visualization/scripts/connectome_reference.py`
|
|
185
|
+
- `skills/brain-visualization/scripts/zalff_summary_reference.py`
|
|
186
|
+
- `skills/brain-visualization/scripts/freesurfer_ply_reference.py`
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
Created At: 2026-04-14 00:15 HKT
|
|
190
|
+
Last Updated At: 2026-04-14 00:40 HKT
|
|
191
|
+
Author: chengwang96
|