Skip to content

Commit

Permalink
Add option to specify sulci to plot.
Browse files Browse the repository at this point in the history
  • Loading branch information
cchen23 committed Jul 25, 2024
1 parent 915ed73 commit fa6afa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions cortex/quickflat/composite.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 : array-like
List of sulci to include
Other Parameters
----------------
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions cortex/quickflat/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -203,7 +203,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:
Expand Down

0 comments on commit fa6afa7

Please sign in to comment.