@brainpilot/skills 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -0
- package/skills/01_Meta-Skills/contribute-skill/SKILL.md +277 -0
- package/skills/01_Meta-Skills/contribute-skills-via-pr/SKILL.md +163 -0
- package/skills/01_Meta-Skills/paper-to-skill/SKILL.md +435 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/extraction-guide.md +286 -0
- package/skills/01_Meta-Skills/paper-to-skill/references/skill-template.md +250 -0
- package/skills/01_Meta-Skills/repo-to-skill/SKILL.md +289 -0
- package/skills/01_Meta-Skills/share-case/SKILL.md +253 -0
- package/skills/01_Meta-Skills/share-usage/README.md +63 -0
- package/skills/01_Meta-Skills/share-usage/SKILL.md +395 -0
- package/skills/01_Meta-Skills/verify-skill/SKILL.md +331 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/SKILL.md +194 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/effect-sizes.md +352 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-power-analysis/references/sample-size-guide.md +407 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/SKILL.md +361 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-statistics/references/common-analyses.md +517 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/SKILL.md +292 -0
- package/skills/02_Cross-Domain_Foundation/cogsci-visualization/references/plot-recipes.md +709 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/SKILL.md +286 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/common-assumptions.md +320 -0
- package/skills/02_Cross-Domain_Foundation/research-literacy/references/planning-template.md +143 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/SKILL.md +197 -0
- package/skills/03_Cognitive_Psychology/alternative-uses-task-designer/references/instruction-templates.md +60 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/SKILL.md +246 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/classic-paradigms.md +435 -0
- package/skills/03_Cognitive_Psychology/cognitive-paradigm-design/references/design-principles.md +256 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/SKILL.md +270 -0
- package/skills/03_Cognitive_Psychology/creativity-self-efficacy-mediation/references/lavaan-templates.md +172 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/SKILL.md +238 -0
- package/skills/03_Cognitive_Psychology/divergent-thinking-scoring/references/scoring-rubric.md +143 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/SKILL.md +203 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/fitting-guide.md +571 -0
- package/skills/03_Cognitive_Psychology/drift-diffusion-model/references/model-variants.md +427 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/SKILL.md +310 -0
- package/skills/03_Cognitive_Psychology/evidence-accumulation-selector/references/ez-diffusion-formulas.md +137 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/SKILL.md +300 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/application-guide.md +278 -0
- package/skills/03_Cognitive_Psychology/signal-detection-analysis/references/sdt-formulas.md +318 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/SKILL.md +283 -0
- package/skills/03_Cognitive_Psychology/visual-search-array-generator/references/array-generation-parameters.yaml +111 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/SKILL.md +301 -0
- package/skills/04_Psycholinguistics/reading-time-analysis/references/measure-computation-guide.md +195 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/SKILL.md +257 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/analysis-guide.md +356 -0
- package/skills/04_Psycholinguistics/self-paced-reading-designer/references/region-segmentation.md +266 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/SKILL.md +346 -0
- package/skills/04_Psycholinguistics/sentence-stimulus-norming/references/lexical-databases-guide.md +184 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/SKILL.md +226 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/component-paradigm-map.md +276 -0
- package/skills/05_EEG_ERP/eeg-paradigm-designer/references/timing-parameters.md +244 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/SKILL.md +367 -0
- package/skills/05_EEG_ERP/eeg-preprocessing-pipeline-guide/references/parameter-lookup-tables.md +138 -0
- package/skills/05_EEG_ERP/erp-analysis/SKILL.md +185 -0
- package/skills/05_EEG_ERP/erp-analysis/references/erp-components.md +447 -0
- package/skills/05_EEG_ERP/erp-analysis/references/preprocessing-pipeline.md +277 -0
- package/skills/05_EEG_ERP/erp-analysis/references/statistical-approaches.md +351 -0
- package/skills/05_EEG_ERP/mne-python-guide/SKILL.md +174 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/decoding.md +178 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/io_formats.md +160 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/preprocessing.md +259 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/simulation.md +173 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/source_localization.md +234 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/statistics.md +196 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/time_frequency.md +165 -0
- package/skills/05_EEG_ERP/mne-python-guide/references/visualization.md +175 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/06_fMRI_Neuroimaging/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/SKILL.md +296 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/design-matrix-guide.md +214 -0
- package/skills/06_fMRI_Neuroimaging/fmri-glm-analysis-guide/references/statistical-inference.md +288 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/SKILL.md +274 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/quality-control.md +336 -0
- package/skills/06_fMRI_Neuroimaging/fmri-preprocessing-pipeline-guide/references/step-by-step-pipeline.md +380 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/SKILL.md +264 -0
- package/skills/06_fMRI_Neuroimaging/fmri-task-design-guide/references/design-optimization-examples.md +114 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/06_fMRI_Neuroimaging/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/SKILL.md +123 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/database-subjects.md +179 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/dataset-types.md +208 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/freesurfer-fmriprep.md +162 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mapping-transforms.md +181 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/mni-utils.md +207 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/surface-analysis.md +219 -0
- package/skills/06_fMRI_Neuroimaging/pycortex-guide/references/visualization.md +251 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/SKILL.md +297 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/model-patterns.md +197 -0
- package/skills/07_Computational_Modeling/act-r-model-builder/references/parameter-table.yaml +204 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/SKILL.md +294 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/diagnostics-checklist.md +351 -0
- package/skills/07_Computational_Modeling/bayesian-cognitive-model-builder/references/prior-selection-guide.md +241 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/SKILL.md +269 -0
- package/skills/07_Computational_Modeling/parameter-recovery-checker/references/recovery-diagnostics.md +207 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/SKILL.md +317 -0
- package/skills/08_Computational_Neuroscience/brain-connectivity-modeler/references/method-implementation-guide.md +116 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/SKILL.md +273 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/decoding-methods.md +170 -0
- package/skills/08_Computational_Neuroscience/neural-decoding-analysis/references/rsa-guide.md +266 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/SKILL.md +305 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/data-requirements.md +60 -0
- package/skills/08_Computational_Neuroscience/neural-population-analysis-guide/references/method-comparison.md +151 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/SKILL.md +376 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/hh-parameters.md +117 -0
- package/skills/08_Computational_Neuroscience/spiking-network-model-builder/references/network-regimes.md +130 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/SKILL.md +258 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/indicator-parameters.md +242 -0
- package/skills/09_Cellular_Molecular_Neuroscience/calcium-imaging-analysis-guide/references/pipeline-details.md +211 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/SKILL.md +261 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/opsin-catalog.md +124 -0
- package/skills/09_Cellular_Molecular_Neuroscience/optogenetics-protocol-designer/references/stimulation-parameters.md +304 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/SKILL.md +367 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/disconnection-guide.md +152 -0
- package/skills/10_Clinical_Neuropsychology/lesion-symptom-mapping-guide/references/vlsm-pipeline.md +182 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/SKILL.md +250 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/deficit-profiles.md +302 -0
- package/skills/10_Clinical_Neuropsychology/neuropsych-battery-selector/references/test-catalog.md +304 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/SKILL.md +345 -0
- package/skills/11_Developmental_Cognition/infant-looking-time-designer/references/age-parameters.yaml +186 -0
- package/skills/12_Social_Cognition/tom-task-selector/SKILL.md +379 -0
- package/skills/12_Social_Cognition/tom-task-selector/references/task-database.md +317 -0
- package/skills/13_Visualization/nature-figure/README.md +442 -0
- package/skills/13_Visualization/nature-figure/SKILL.md +60 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-01-bar-charts.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-02-line-trends.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-03-heatmaps.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-04-scatter-bubble.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-05-radar-polar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-06-distributions.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-07-forest-interval.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-08-area-stacked.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-09-image-plates.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/chart-atlas/atlas-10-network-matrix.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_motivation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/Dispersion_observation_distillation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_contrastive.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_CEDAR.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_results_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/ImmunoStruct_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/assets/RNAGenScape_schematic.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/figures/comparison.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_ablation.py +86 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_CellSpliceNet/plot_comparison.py +109 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/diffusion_swiss_roll.py +97 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/diffusion_swiss_roll.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_GeneRegulatory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/fig2_comparison_Trajectory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.pdf +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/figures/figX_comparison_Ablation.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Ablation.py +64 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_GeneRegulatory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Cflows/plot_comparison_Trajectory.py +74 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/idea.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/figures/illustration.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_idea.py +76 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_Dispersion/plot_illustration.py +404 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/figures/freq_prior.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_FPGM/plot_freq_prior.py +146 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_ablation_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_Cancer.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/figures/bars_comparison_IEDB.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/plot_bars.py +216 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ImmunoStruct/raw_data.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/manifold_holes.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_optimization.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_comparison_speed.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/figures/results_sweep.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_comparison.py +228 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_hole_manifold.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_manifold.py +61 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_RNAGenScape/plot_sweep.py +77 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_posttraining.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/figures/comparison_radar.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_comparison_radar.py +173 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_VIGIL/plot_posttraining.py +82 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/brute_force.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_category.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/correctness_by_subcategory.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/rewriting.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/figures/selfcorrection_math.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_brute_force.py +248 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_category.py +132 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_correctness_by_subcategory.py +131 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_rewriting.py +105 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_brainteaser/plot_selfcorrection_math.py +99 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/composition_heatmap.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/figures/trend_by_month.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_composition.py +81 -0
- package/skills/13_Visualization/nature-figure/assets/figures4papers/figure_ophthal_review/plot_trend.py +125 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig1-material-mechanism-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig2-spatial-imaging-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig3-in-vivo-efficacy-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig4-single-cell-systems-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/assets/gallery/fig5-validation-perturbation-rich.png +0 -0
- package/skills/13_Visualization/nature-figure/evals/evals.json +37 -0
- package/skills/13_Visualization/nature-figure/manifest.yaml +57 -0
- package/skills/13_Visualization/nature-figure/references/api.md +428 -0
- package/skills/13_Visualization/nature-figure/references/backend-selection.md +100 -0
- package/skills/13_Visualization/nature-figure/references/chart-types.md +281 -0
- package/skills/13_Visualization/nature-figure/references/common-patterns.md +350 -0
- package/skills/13_Visualization/nature-figure/references/demos.md +65 -0
- package/skills/13_Visualization/nature-figure/references/design-theory.md +436 -0
- package/skills/13_Visualization/nature-figure/references/figure-contract.md +93 -0
- package/skills/13_Visualization/nature-figure/references/nature-2026-observations.md +112 -0
- package/skills/13_Visualization/nature-figure/references/qa-contract.md +119 -0
- package/skills/13_Visualization/nature-figure/references/r-template-index.md +66 -0
- package/skills/13_Visualization/nature-figure/references/r-workflow.md +161 -0
- package/skills/13_Visualization/nature-figure/references/tutorials.md +251 -0
- package/skills/13_Visualization/nature-figure/static/core/contract.md +29 -0
- package/skills/13_Visualization/nature-figure/static/core/stance.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/python.md +37 -0
- package/skills/13_Visualization/nature-figure/static/fragments/backend/r.md +44 -0
- package/skills/14_Writing/markdown-report-writing/SKILL.md +306 -0
- package/skills/14_Writing/markdown-report-writing/references/compatibility-matrix.md +72 -0
- package/skills/14_Writing/markdown-report-writing/references/templates.md +299 -0
- package/skills/15_Others/neuroimaging-power-guide/SKILL.md +324 -0
- package/skills/15_Others/neuroimaging-power-guide/references/effect-size-lookup-tables.md +102 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/SKILL.md +330 -0
- package/skills/15_Others/neuroimaging-sample-size-calculator/references/worked-examples.md +220 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
# Dataset Types Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Volume](#volume)
|
|
5
|
+
2. [Vertex](#vertex)
|
|
6
|
+
3. [VolumeRGB / VertexRGB](#volumergb--vertexrgb)
|
|
7
|
+
4. [Volume2D / Vertex2D](#volume2d--vertex2d)
|
|
8
|
+
5. [Dataset](#dataset)
|
|
9
|
+
6. [Colors Utility](#colors-utility)
|
|
10
|
+
|
|
11
|
+
## Volume
|
|
12
|
+
|
|
13
|
+
Wraps 3D/4D volumetric data with subject, transform, and colormap metadata.
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
cortex.Volume(data, subject, xfmname, mask=None, cmap=None, vmin=None, vmax=None, description="", **kwargs)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Description |
|
|
20
|
+
|-----------|------|-------------|
|
|
21
|
+
| `data` | ndarray or str | 3D `(z,y,x)`, 4D `(t,z,y,x)`, 1D masked `(v,)`, 2D masked `(t,v)`, or NIfTI path |
|
|
22
|
+
| `subject` | str | Subject name in `cortex.db` |
|
|
23
|
+
| `xfmname` | str | Transform name in database |
|
|
24
|
+
| `mask` | ndarray, optional | Binary 3D mask; auto-detected if data is 1D/2D |
|
|
25
|
+
| `cmap` | str | Matplotlib colormap name |
|
|
26
|
+
| `vmin/vmax` | float | Color scale bounds (default: 1st/99th percentile) |
|
|
27
|
+
|
|
28
|
+
Key properties and methods:
|
|
29
|
+
- `vol.volume` — returns unmasked 3D/4D array
|
|
30
|
+
- `vol.linear` — True if data is masked (1D/2D)
|
|
31
|
+
- `vol.movie` — True if data has time dimension
|
|
32
|
+
- `vol.shape` — 3D volume shape
|
|
33
|
+
- `vol.map(projection="nearest")` — convert to Vertex via surface mapping
|
|
34
|
+
- `vol.save(filename)` — save to HDF5
|
|
35
|
+
- `vol.save_nii(filename)` — save as NIfTI
|
|
36
|
+
- `Volume.random(subject, xfmname)` — class method for random test data
|
|
37
|
+
- `Volume.empty(subject, xfmname, value=0)` — class method for constant volume
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
# From numpy array
|
|
41
|
+
vol = cortex.Volume(np.random.randn(31, 100, 100), "S1", "fullhead",
|
|
42
|
+
cmap="hot", vmin=0, vmax=3)
|
|
43
|
+
|
|
44
|
+
# From NIfTI file
|
|
45
|
+
vol = cortex.Volume("func.nii.gz", "S1", "fullhead")
|
|
46
|
+
|
|
47
|
+
# Masked data (1D)
|
|
48
|
+
mask = cortex.db.get_mask("S1", "fullhead", "thick")
|
|
49
|
+
masked_data = np.random.randn(mask.sum())
|
|
50
|
+
vol = cortex.Volume(masked_data, "S1", "fullhead", mask=mask)
|
|
51
|
+
|
|
52
|
+
# 4D movie data
|
|
53
|
+
movie_vol = cortex.Volume(np.random.randn(100, 31, 100, 100), "S1", "fullhead")
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Vertex
|
|
57
|
+
|
|
58
|
+
Wraps surface vertex data (one value per vertex).
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
cortex.Vertex(data, subject, cmap=None, vmin=None, vmax=None, description="", **kwargs)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
| Parameter | Type | Description |
|
|
65
|
+
|-----------|------|-------------|
|
|
66
|
+
| `data` | ndarray | 1D `(v,)` or 2D `(t,v)` for movie |
|
|
67
|
+
| `subject` | str | Subject name in `cortex.db` |
|
|
68
|
+
|
|
69
|
+
Key properties and methods:
|
|
70
|
+
- `vx.vertices` — data with time dim added if needed
|
|
71
|
+
- `vx.left` / `vx.right` — hemisphere-specific data
|
|
72
|
+
- `vx.llen` / `vx.rlen` — vertex counts per hemisphere
|
|
73
|
+
- `vx.hem` — "left", "right", or "both"
|
|
74
|
+
- `vx.volume(xfmname, projection="nearest")` — map back to volume (approximate)
|
|
75
|
+
- `vx.map(target_subj, surface_type="fiducial")` — project to another subject
|
|
76
|
+
- `vx.blend_curvature(alpha)` — blend with curvature, returns VertexRGB
|
|
77
|
+
- `Vertex.random(subject)` — random test data
|
|
78
|
+
- `Vertex.empty(subject, value=0)` — constant vertex data
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
# Full brain (both hemispheres)
|
|
82
|
+
n_verts = cortex.db.get_surf("S1", "fiducial", "both", merge=True, nudge=False)[0].shape[0]
|
|
83
|
+
vx = cortex.Vertex(np.random.randn(n_verts), "S1", cmap="RdBu_r", vmin=-3, vmax=3)
|
|
84
|
+
|
|
85
|
+
# Single hemisphere (auto-padded)
|
|
86
|
+
left_pts, _ = cortex.db.get_surf("S1", "fiducial", "left")
|
|
87
|
+
vx_left = cortex.Vertex(np.random.randn(left_pts.shape[0]), "S1")
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## VolumeRGB / VertexRGB
|
|
91
|
+
|
|
92
|
+
Direct RGB(A) color specification per voxel or vertex.
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
cortex.VolumeRGB(red, green, blue, subject=None, xfmname=None, alpha=None,
|
|
96
|
+
description="", channel1color=(255,0,0), channel2color=(0,255,0),
|
|
97
|
+
channel3color=(0,0,255), vmin=None, vmax=None, autorange="individual")
|
|
98
|
+
|
|
99
|
+
cortex.VertexRGB(red, green, blue, subject=None, alpha=None, ...)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
| Parameter | Type | Description |
|
|
103
|
+
|-----------|------|-------------|
|
|
104
|
+
| `red/green/blue` | ndarray or Volume/Vertex | Data channels |
|
|
105
|
+
| `alpha` | ndarray or Volume/Vertex, optional | Transparency channel |
|
|
106
|
+
| `channel1/2/3color` | tuple(int,int,int) | RGB color for each channel |
|
|
107
|
+
| `vmin/vmax` | float or tuple(3) | Per-channel or shared bounds |
|
|
108
|
+
| `autorange` | str | "individual" or "shared" percentile ranging |
|
|
109
|
+
|
|
110
|
+
```python
|
|
111
|
+
# Three-channel RGB volume
|
|
112
|
+
r = cortex.Volume(data_r, "S1", "fullhead")
|
|
113
|
+
g = cortex.Volume(data_g, "S1", "fullhead")
|
|
114
|
+
b = cortex.Volume(data_b, "S1", "fullhead")
|
|
115
|
+
rgb = cortex.VolumeRGB(r, g, b)
|
|
116
|
+
|
|
117
|
+
# With alpha transparency
|
|
118
|
+
alpha = cortex.Volume(significance_map, "S1", "fullhead")
|
|
119
|
+
rgb = cortex.VolumeRGB(r, g, b, alpha=alpha)
|
|
120
|
+
|
|
121
|
+
# Custom channel colors
|
|
122
|
+
rgb = cortex.VolumeRGB(ch1, ch2, ch3, subject="S1", xfmname="fullhead",
|
|
123
|
+
channel1color=(255, 100, 0),
|
|
124
|
+
channel2color=(0, 200, 100),
|
|
125
|
+
channel3color=(100, 0, 255))
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Volume2D / Vertex2D
|
|
129
|
+
|
|
130
|
+
Two data dimensions visualized with a 2D colormap.
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
cortex.Volume2D(dim1, dim2, subject=None, xfmname=None, cmap=None,
|
|
134
|
+
vmin=None, vmax=None, vmin2=None, vmax2=None)
|
|
135
|
+
|
|
136
|
+
cortex.Vertex2D(dim1, dim2, subject=None, cmap=None,
|
|
137
|
+
vmin=None, vmax=None, vmin2=None, vmax2=None)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Parameter | Type | Description |
|
|
141
|
+
|-----------|------|-------------|
|
|
142
|
+
| `dim1/dim2` | ndarray or Volume/Vertex | Two data dimensions |
|
|
143
|
+
| `vmin/vmax` | float | Bounds for dim1 |
|
|
144
|
+
| `vmin2/vmax2` | float | Bounds for dim2 |
|
|
145
|
+
| `cmap` | str | 2D colormap name |
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
# Activation + significance
|
|
149
|
+
activation = cortex.Volume(beta_map, "S1", "fullhead")
|
|
150
|
+
significance = cortex.Volume(-np.log10(pval_map), "S1", "fullhead")
|
|
151
|
+
vol2d = cortex.Volume2D(activation, significance,
|
|
152
|
+
vmin=-5, vmax=5, vmin2=0, vmax2=5)
|
|
153
|
+
cortex.quickshow(vol2d)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Dataset
|
|
157
|
+
|
|
158
|
+
Container for multiple named Dataview objects. Used for multi-map viewers.
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
cortex.Dataset(**named_dataviews)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
ds = cortex.Dataset(
|
|
166
|
+
activation=cortex.Volume(act_data, "S1", "fullhead", cmap="hot"),
|
|
167
|
+
contrast=cortex.Volume(con_data, "S1", "fullhead", cmap="RdBu_r"),
|
|
168
|
+
surface=cortex.Vertex(surf_data, "S1", cmap="viridis")
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Save and load
|
|
172
|
+
ds.save("experiment.hdf")
|
|
173
|
+
ds = cortex.load("experiment.hdf") # alias for Dataset.from_file
|
|
174
|
+
|
|
175
|
+
# Save portable (includes subject geometry)
|
|
176
|
+
ds.save("portable.hdf", pack=True)
|
|
177
|
+
|
|
178
|
+
# Access views
|
|
179
|
+
ds["activation"] # or ds.activation
|
|
180
|
+
for name, view in ds:
|
|
181
|
+
print(name)
|
|
182
|
+
|
|
183
|
+
# Append more views
|
|
184
|
+
ds.append(new_map=cortex.Volume(...))
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Colors Utility
|
|
188
|
+
|
|
189
|
+
Predefined colors for RGB visualizations:
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
from cortex.dataset import Colors
|
|
193
|
+
Colors.RoseRed # (237, 35, 96)
|
|
194
|
+
Colors.LimeGreen # (141, 198, 63)
|
|
195
|
+
Colors.SkyBlue # (0, 176, 218)
|
|
196
|
+
Colors.DodgerBlue # (30, 144, 255)
|
|
197
|
+
Colors.Red # (255, 0, 0)
|
|
198
|
+
Colors.Green # (0, 255, 0)
|
|
199
|
+
Colors.Blue # (0, 0, 255)
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Numpy-style arithmetic works on all data types:
|
|
203
|
+
```python
|
|
204
|
+
vol_sum = vol1 + vol2
|
|
205
|
+
vol_diff = vol1 - vol2
|
|
206
|
+
vol_scaled = vol1 * 2.0
|
|
207
|
+
vol_abs = abs(vol1)
|
|
208
|
+
```
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# FreeSurfer & fMRIPrep Integration Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Import from FreeSurfer](#import-from-freesurfer)
|
|
5
|
+
2. [FreeSurfer Utilities](#freesurfer-utilities)
|
|
6
|
+
3. [Import from fMRIPrep](#import-from-fmriprep)
|
|
7
|
+
|
|
8
|
+
## Import from FreeSurfer
|
|
9
|
+
|
|
10
|
+
### import_subj
|
|
11
|
+
|
|
12
|
+
Import a FreeSurfer-processed subject into the pycortex database.
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
cortex.freesurfer.import_subj(freesurfer_subject, pycortex_subject=None, freesurfer_subject_dir=None, whitematter_surf='smoothwm')
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Default | Description |
|
|
19
|
+
|-----------|------|---------|-------------|
|
|
20
|
+
| `freesurfer_subject` | str | required | FreeSurfer subject name |
|
|
21
|
+
| `pycortex_subject` | str | None | Pycortex subject name (defaults to freesurfer_subject) |
|
|
22
|
+
| `freesurfer_subject_dir` | str | None | FreeSurfer SUBJECTS_DIR (defaults to env var) |
|
|
23
|
+
| `whitematter_surf` | str | 'smoothwm' | White matter surface to import |
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
# Basic import
|
|
27
|
+
cortex.freesurfer.import_subj("fsaverage")
|
|
28
|
+
|
|
29
|
+
# Import with different pycortex name
|
|
30
|
+
cortex.freesurfer.import_subj("sub-01", pycortex_subject="S1",
|
|
31
|
+
freesurfer_subject_dir="/path/to/freesurfer/subjects")
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### import_flat
|
|
35
|
+
|
|
36
|
+
Import flattened cortical surfaces from FreeSurfer.
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
cortex.freesurfer.import_flat(freesurfer_subject, patch, hemis=['lh', 'rh'],
|
|
40
|
+
pycortex_subject=None, flat_type='freesurfer',
|
|
41
|
+
freesurfer_subject_dir=None)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Parameter | Type | Default | Description |
|
|
45
|
+
|-----------|------|---------|-------------|
|
|
46
|
+
| `freesurfer_subject` | str | required | FreeSurfer subject name |
|
|
47
|
+
| `patch` | str | required | Patch name (e.g., "full" for full hemisphere) |
|
|
48
|
+
| `hemis` | list | ['lh','rh'] | Hemispheres to import |
|
|
49
|
+
| `flat_type` | str | 'freesurfer' | Flattening method used |
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
cortex.freesurfer.import_flat("sub-01", "full", pycortex_subject="S1")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## FreeSurfer Utilities
|
|
56
|
+
|
|
57
|
+
### Surface Operations
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
# Parse FreeSurfer surface file
|
|
61
|
+
pts, polys = cortex.freesurfer.parse_surf("/path/to/lh.pial")
|
|
62
|
+
|
|
63
|
+
# Write FreeSurfer surface
|
|
64
|
+
cortex.freesurfer.write_surf("output_surf", pts, polys)
|
|
65
|
+
|
|
66
|
+
# Get surface with type
|
|
67
|
+
pts, polys = cortex.freesurfer.get_surf("sub-01", "lh", "pial")
|
|
68
|
+
|
|
69
|
+
# Get curvature data
|
|
70
|
+
curv = cortex.freesurfer.get_curv("sub-01", "lh", type="wm")
|
|
71
|
+
|
|
72
|
+
# Parse curvature file
|
|
73
|
+
curv_data = cortex.freesurfer.parse_curv("/path/to/lh.curv")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Surface-to-Surface Projection
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
# Project data between subjects via FreeSurfer sphere
|
|
80
|
+
projected = cortex.freesurfer.mri_surf2surf(
|
|
81
|
+
data, source_subj="sub-01", target_subj="fsaverage",
|
|
82
|
+
hemi="lh")
|
|
83
|
+
|
|
84
|
+
# Get projection matrix (for repeated use)
|
|
85
|
+
matrix = cortex.freesurfer.get_mri_surf2surf_matrix(
|
|
86
|
+
source_subj="sub-01", hemi="lh",
|
|
87
|
+
surface_type="sphere.reg", target_subj="fsaverage")
|
|
88
|
+
projected = matrix.dot(data)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### FreeSurfer Processing
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# Run autorecon
|
|
95
|
+
cortex.freesurfer.autorecon("sub-01", type="all", parallel=True)
|
|
96
|
+
|
|
97
|
+
# Flatten cortical surface
|
|
98
|
+
cortex.freesurfer.flatten("sub-01", "lh", patch="full")
|
|
99
|
+
|
|
100
|
+
# Create fiducial (mid-cortical) surface
|
|
101
|
+
cortex.freesurfer.make_fiducial("sub-01")
|
|
102
|
+
|
|
103
|
+
# Get ROI labels
|
|
104
|
+
label_verts = cortex.freesurfer.get_label("S1", "V1", fs_subject="sub-01")
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### File Path Helpers
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
# Get FreeSurfer file paths
|
|
111
|
+
paths = cortex.freesurfer.get_paths("sub-01", "lh", type="surf")
|
|
112
|
+
# type options: "patch", "surf", "curv", "slim"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Import from fMRIPrep
|
|
116
|
+
|
|
117
|
+
### import_subj
|
|
118
|
+
|
|
119
|
+
Import an fMRIPrep-processed subject into pycortex.
|
|
120
|
+
|
|
121
|
+
```python
|
|
122
|
+
cortex.fmriprep.import_subj(subject, source_dir, session=None,
|
|
123
|
+
dataset=None, sname=None, old_fmriprep=False)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
| Parameter | Type | Default | Description |
|
|
127
|
+
|-----------|------|---------|-------------|
|
|
128
|
+
| `subject` | str | required | BIDS subject ID (e.g., "01") |
|
|
129
|
+
| `source_dir` | str | required | Path to fMRIPrep output directory |
|
|
130
|
+
| `session` | str | None | BIDS session ID |
|
|
131
|
+
| `dataset` | str | None | BIDS dataset name |
|
|
132
|
+
| `sname` | str | None | Pycortex subject name (default: auto-generated) |
|
|
133
|
+
| `old_fmriprep` | bool | False | Use old fMRIPrep directory structure |
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
# Import from fMRIPrep output
|
|
137
|
+
cortex.fmriprep.import_subj(
|
|
138
|
+
subject="01",
|
|
139
|
+
source_dir="/path/to/fmriprep/output",
|
|
140
|
+
session="01",
|
|
141
|
+
sname="S1"
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
# After import, subject is available in cortex.db
|
|
145
|
+
vol = cortex.Volume(data, "S1", "my_transform")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Typical Workflow
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
# 1. Run fMRIPrep on your BIDS dataset (outside pycortex)
|
|
152
|
+
# 2. Import the subject
|
|
153
|
+
cortex.fmriprep.import_subj("01", "/data/derivatives/fmriprep")
|
|
154
|
+
|
|
155
|
+
# 3. Create alignment transform
|
|
156
|
+
cortex.align.automatic("sub-01", "task_bold",
|
|
157
|
+
reference="/data/derivatives/fmriprep/sub-01/func/sub-01_task-rest_bold.nii.gz")
|
|
158
|
+
|
|
159
|
+
# 4. Visualize
|
|
160
|
+
vol = cortex.Volume("beta_map.nii.gz", "sub-01", "task_bold")
|
|
161
|
+
cortex.quickshow(vol)
|
|
162
|
+
```
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
# Mapping & Transforms Reference
|
|
2
|
+
|
|
3
|
+
## Table of Contents
|
|
4
|
+
1. [Volume-to-Surface Mapping](#volume-to-surface-mapping)
|
|
5
|
+
2. [Mapper Types](#mapper-types)
|
|
6
|
+
3. [Transform Class](#transform-class)
|
|
7
|
+
4. [Alignment](#alignment)
|
|
8
|
+
|
|
9
|
+
## Volume-to-Surface Mapping
|
|
10
|
+
|
|
11
|
+
### get_mapper
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
cortex.mapper.get_mapper(subject, xfmname, type='nearest', recache=False, **kwargs)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Default | Description |
|
|
18
|
+
|-----------|------|---------|-------------|
|
|
19
|
+
| `subject` | str | required | Subject name |
|
|
20
|
+
| `xfmname` | str | required | Transform name |
|
|
21
|
+
| `type` | str | 'nearest' | Mapper type (see table below) |
|
|
22
|
+
| `recache` | bool | False | Force recomputation |
|
|
23
|
+
|
|
24
|
+
Returns a Mapper object that can project data between volume and surface space.
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
mapper = cortex.mapper.get_mapper("S1", "fullhead", type="trilinear")
|
|
28
|
+
|
|
29
|
+
# Volume → Surface
|
|
30
|
+
vertex_data = mapper(volume_data)
|
|
31
|
+
|
|
32
|
+
# Surface → Volume (inverse)
|
|
33
|
+
volume_data = mapper.backwards(vertex_data)
|
|
34
|
+
|
|
35
|
+
# Access mask
|
|
36
|
+
mask = mapper.mask
|
|
37
|
+
left_mask, right_mask = mapper.hemimasks
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### High-Level Convenience
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
# Volume.map() method
|
|
44
|
+
vol = cortex.Volume(data, "S1", "fullhead")
|
|
45
|
+
vx = vol.map("nearest") # returns Vertex
|
|
46
|
+
|
|
47
|
+
# Direct function
|
|
48
|
+
from cortex.mapper import vol2surf
|
|
49
|
+
vertex_data = vol2surf(data, "S1", "fullhead", target_surface="native")
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### nanproject
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from cortex.mapper import nanproject
|
|
56
|
+
vertex_data = nanproject(volume_data_with_nans, mapper, reweigh=True)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Handles NaN values during projection by reweighting non-NaN contributions.
|
|
60
|
+
|
|
61
|
+
## Mapper Types
|
|
62
|
+
|
|
63
|
+
| Type | Class | Description |
|
|
64
|
+
|------|-------|-------------|
|
|
65
|
+
| `'nearest'` | PointNN | Nearest-neighbor point sampling |
|
|
66
|
+
| `'trilinear'` | PointTrilin | Trilinear interpolation at surface points |
|
|
67
|
+
| `'gaussian'` | PointGauss | Gaussian kernel sampling |
|
|
68
|
+
| `'lanczos'` | PointLanczos | Lanczos interpolation |
|
|
69
|
+
| `'const_nearest'` | ConstPatchNN | Constant-depth patch, nearest neighbor |
|
|
70
|
+
| `'const_trilinear'` | ConstPatchTrilin | Constant-depth patch, trilinear |
|
|
71
|
+
| `'const_lanczos'` | ConstPatchLanczos | Constant-depth patch, Lanczos |
|
|
72
|
+
| `'line_nearest'` | LineNN | Line sampling (WM→pial), nearest |
|
|
73
|
+
| `'line_trilinear'` | LineTrilin | Line sampling (WM→pial), trilinear |
|
|
74
|
+
| `'line_lanczos'` | LineLanczos | Line sampling (WM→pial), Lanczos |
|
|
75
|
+
|
|
76
|
+
Point mappers sample at a single cortical depth. Line mappers average across the cortical ribbon (white matter to pial surface). Patch mappers sample a local neighborhood.
|
|
77
|
+
|
|
78
|
+
Recommended defaults:
|
|
79
|
+
- Quick visualization: `'nearest'`
|
|
80
|
+
- Publication quality: `'line_nearest'` or `'trilinear'`
|
|
81
|
+
- Smoothest results: `'lanczos'`
|
|
82
|
+
|
|
83
|
+
## Transform Class
|
|
84
|
+
|
|
85
|
+
```python
|
|
86
|
+
from cortex.xfm import Transform
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Creating Transforms
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# From 4x4 matrix + reference NIfTI
|
|
93
|
+
xfm = Transform(np.eye(4), "reference.nii.gz")
|
|
94
|
+
|
|
95
|
+
# From FSL FLIRT output
|
|
96
|
+
xfm = Transform.from_fsl("flirt_matrix.mat", "func.nii.gz", "anat.nii.gz")
|
|
97
|
+
|
|
98
|
+
# From FreeSurfer bbregister
|
|
99
|
+
xfm = Transform.from_freesurfer("register.dat", "func.nii.gz", "S1")
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Using Transforms
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
# Apply to points
|
|
106
|
+
transformed_pts = xfm(pts) # pts shape (N, 3)
|
|
107
|
+
|
|
108
|
+
# Inverse
|
|
109
|
+
inv_xfm = xfm.inv
|
|
110
|
+
|
|
111
|
+
# Compose transforms
|
|
112
|
+
combined = xfm1 * xfm2
|
|
113
|
+
|
|
114
|
+
# Save to database
|
|
115
|
+
xfm.save("S1", "my_transform", xfmtype="magnet")
|
|
116
|
+
|
|
117
|
+
# Convert to FSL format
|
|
118
|
+
xfm.to_fsl("anat.nii.gz", direction='func>anat')
|
|
119
|
+
|
|
120
|
+
# Convert to FreeSurfer format
|
|
121
|
+
xfm.to_freesurfer("register.dat", "S1")
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Transform Types
|
|
125
|
+
|
|
126
|
+
| Type | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `"magnet"` | Scanner magnet coordinates → anatomical |
|
|
129
|
+
| `"coord"` | Coordinate transform (default) |
|
|
130
|
+
| `"raw"` | Raw affine matrix |
|
|
131
|
+
|
|
132
|
+
## Alignment
|
|
133
|
+
|
|
134
|
+
Functions for aligning functional volumes to cortical surfaces.
|
|
135
|
+
|
|
136
|
+
### Manual Alignment (FreeSurfer FreeView)
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
cortex.align.manual(subject, xfmname, output_name="register.lta",
|
|
140
|
+
wm_color="yellow", pial_color="blue", wm_surface='white',
|
|
141
|
+
noclean=False, reference=None, inspect_only=False)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
| Parameter | Type | Default | Description |
|
|
145
|
+
|-----------|------|---------|-------------|
|
|
146
|
+
| `subject` | str | required | Subject name |
|
|
147
|
+
| `xfmname` | str | required | Transform name to save |
|
|
148
|
+
| `output_name` | str | "register.lta" | Output registration filename |
|
|
149
|
+
| `wm_color` | str | "yellow" | White matter surface color in FreeView |
|
|
150
|
+
| `pial_color` | str | "blue" | Pial surface color in FreeView |
|
|
151
|
+
| `wm_surface` | str | "white" | White matter surface type |
|
|
152
|
+
| `reference` | str | None | Path to functional volume |
|
|
153
|
+
| `inspect_only` | bool | False | View alignment without editing |
|
|
154
|
+
|
|
155
|
+
Opens FreeView GUI for interactive alignment. Saves result to database.
|
|
156
|
+
|
|
157
|
+
### Automatic Alignment
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
# Using FreeSurfer bbregister
|
|
161
|
+
cortex.align.automatic(subject, xfmname, reference, init="coreg",
|
|
162
|
+
epi_mask=False, intermediate=None, reference_contrast="t2", noclean=False)
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
| Parameter | Type | Default | Description |
|
|
166
|
+
|-----------|------|---------|-------------|
|
|
167
|
+
| `subject` | str | required | Subject name |
|
|
168
|
+
| `xfmname` | str | required | Name to save transform as |
|
|
169
|
+
| `reference` | str | required | Path to functional volume |
|
|
170
|
+
| `init` | str | "coreg" | Initialization: "coreg", "fsl", "header", "spm" |
|
|
171
|
+
| `epi_mask` | bool | False | Use EPI mask during registration |
|
|
172
|
+
| `reference_contrast` | str | "t2" | Reference image contrast type: "t1" or "t2" |
|
|
173
|
+
| `noclean` | bool | False | Keep temporary files after alignment |
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
# Using FSL FLIRT BBR
|
|
177
|
+
cortex.align.automatic_fsl(subject, xfmname, reference="func.nii.gz")
|
|
178
|
+
|
|
179
|
+
# Fine-tune existing alignment
|
|
180
|
+
cortex.align.autotweak(subject, xfmname)
|
|
181
|
+
```
|