parcellate
lacuna.prepare.parcellate
¶
Reduce a whole-brain connectome to a parcellated NxN connectivity matrix.
Functional branch only for now: load a voxelwise fMRI HDF5 connectome (same
format consumed by lacuna run fnm), project timeseries onto parcel means
using the atlas resampled to the connectome grid, compute a per-subject
Pearson correlation matrix, average across subjects via Fisher z, and write
the resulting group-level :class:~lacuna.core.data_types.ConnectivityMatrix
as a BIDS-style TSV + JSON sidecar (mirrors the layout produced by
lacuna run snm for its disconnectivity matrix).
The structural branch (--modality structural) is wired up separately.
ResolvedParcellation
dataclass
¶
An atlas ready for use by the parcellate pipeline.
Source code in src/lacuna/prepare/parcellate.py
parcellate_functional(connectome_path, parcellations, output_dir, *, overwrite=False, verbose=False)
¶
Compute group-average parcellated FC matrices from a voxelwise HDF5 connectome.
One output TSV+JSON pair is written per parcellation under output_dir.
Returns the list of TSV paths.
Source code in src/lacuna/prepare/parcellate.py
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
resolve_parcellations(parcel_atlases, custom_parcellation)
¶
Turn CLI --parcel-atlases / --custom-parcellation into objects.
Source code in src/lacuna/prepare/parcellate.py
run_parcellate_functional_cli(args)
¶
Entry point for lacuna parcellate --modality functional.