From fa6e2834d21a75793e6819997049d290ec6e0ed3 Mon Sep 17 00:00:00 2001 From: Catherine Chen Date: Mon, 5 Aug 2024 07:52:15 -0700 Subject: [PATCH] ENH Add option to specify which sulci to show. (#550) * Add option to specify sulci to plot. * DOC update docstrings for sulci_list. --- cortex/quickflat/composite.py | 6 ++++-- cortex/quickflat/view.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cortex/quickflat/composite.py b/cortex/quickflat/composite.py index 01846e21..dba9b7a3 100644 --- a/cortex/quickflat/composite.py +++ b/cortex/quickflat/composite.py @@ -220,7 +220,7 @@ def add_rois(fig, dataview, extents=None, height=None, with_labels=True, roi_lis return img -def add_sulci(fig, dataview, extents=None, height=None, with_labels=True, overlay_file=None, **kwargs): +def add_sulci(fig, dataview, extents=None, height=None, with_labels=True, sulci_list=None, overlay_file=None, **kwargs): """Add sulci layer to figure Parameters @@ -236,6 +236,8 @@ def add_sulci(fig, dataview, extents=None, height=None, with_labels=True, overla Height of image. None defaults to height of images already present in figure. with_labels : bool Whether to display text labels for sulci + sulci_list : list + List of sulci to include Other Parameters ---------------- @@ -252,7 +254,7 @@ def add_sulci(fig, dataview, extents=None, height=None, with_labels=True, overla svg_kws = _convert_svg_kwargs(kwargs) layer_kws = _parse_defaults('sulci_paths') layer_kws.update(svg_kws) - sulc = svgobject.get_texture('sulci', height, labels=with_labels, **layer_kws) + sulc = svgobject.get_texture('sulci', height, labels=with_labels, shape_list=sulci_list, **layer_kws) if extents is None: extents = _get_extents(fig) _, ax = _get_fig_and_ax(fig) diff --git a/cortex/quickflat/view.py b/cortex/quickflat/view.py index 9109aee8..740b6038 100644 --- a/cortex/quickflat/view.py +++ b/cortex/quickflat/view.py @@ -36,7 +36,7 @@ def make_figure(braindata, recache=False, pixelwise=True, thick=32, sampler='nea linewidth=None, linecolor=None, roifill=None, shadow=None, labelsize=None, labelcolor=None, cutout=None, curvature_brightness=None, curvature_contrast=None, curvature_threshold=None, fig=None, extra_hatch=None, - colorbar_ticks=None, colorbar_location='center', roi_list=None, + colorbar_ticks=None, colorbar_location='center', roi_list=None, sulci_list=None, nanmean=False, **kwargs): """Show a Volume or Vertex on a flatmap with matplotlib. @@ -68,6 +68,8 @@ def make_figure(braindata, recache=False, pixelwise=True, thick=32, sampler='nea cutout : str Name of flatmap cutout with which to clip the full flatmap. Should be the name of a sub-layer of the 'cutouts' layer in //overlays.svg + sulci_list : list + List of sulci to include Other Parameters ---------------- @@ -203,7 +205,7 @@ def make_figure(braindata, recache=False, pixelwise=True, thick=32, sampler='nea if with_sulci: sulc_im = composite.add_sulci(ax, dataview, extents=extents, height=height, linewidth=linewidth, linecolor=linecolor, shadow=shadow, labelsize=labelsize, labelcolor=labelcolor, with_labels=with_labels, - overlay_file=overlay_file) + overlay_file=overlay_file, sulci_list=sulci_list) layers['sulci'] = sulc_im # Add custom if extra_disp is not None: