Primary user-facing entry point:
cvnpy.lookup(...)in/Users/iancharest/Documents/codex/cvncode/cvnpy/src/cvnpy/api.py
This is a thin wrapper around:
cvnpy.core.lookup_images.lookup_images(...)
lookup_images(
subject,
vals,
hemi,
view_az_el_tilt,
lookup=None,
**kwargs,
)Returns:
(mapped, lookup, rgb, options)mapped: image-space scalar map (NaN where invalid/outside)lookup: lookup dictionary used/generatedrgb: rendered RGB imageoptions: resolved option dictionary
Geometry / viewpoint:
surftype(sphere,inflated,full.flat.patch.3d, etc.)surfsuffixxyextentimageres
Color / mapping:
cmap(defaultcmapsign4)climrgbnanbackground,bg_cmap,bg_clim
Overlay / threshold:
thresholdabsthresholdoverlayrangeoverlayalpha
ROI:
roimaskroicolorroiwidth
Caching:
savelookupresetcache_dir
Flatmap controls:
flat_apply_support_maskflat_support_ratiotrim_extrapolation_pxflat_filter_sparse_verticesflat_sparse_vertex_quantileflat_sparse_vertex_factorflat_edge_trim_stepsflat_margin_fracflat_fill_small_holes_px
import numpy as np
from cvnpy import lookup
vals = np.random.randn(10000)
mapped, lk, rgb, opts = lookup(
subject="fsaverage",
vals=vals,
hemi="lh",
view=[0, 0, 0],
surftype="full.flat.patch.3d",
cmap="cmapsign4",
cache_dir="/tmp/cvnpy_cache",
)Use /Users/iancharest/Documents/codex/cvncode/cvnpy/src/cvnpy/view/viewpoints.py:
from cvnpy.view.viewpoints import lookup_viewpoint
view, flip, viewhemi = lookup_viewpoint("fsaverage", "lh", "occip", "inflated")Surface loading:
cvnpy.io.surfaces.read_surface(...)
Metric loading:
cvnpy.io.metrics.read_surface_metric(...)