Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cortex/rois.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def to_svg(self, open_inkscape=False, filename=None):
# Find polys
allbpolys = np.unique(surf.connected[inbound+exbound].indices)
selbpolys = surf.polys[allbpolys]
inpolys = np.in1d(selbpolys, inbound).reshape(selbpolys.shape)
expolys = np.in1d(selbpolys, exbound).reshape(selbpolys.shape)
inpolys = np.isin(selbpolys, inbound)
expolys = np.isin(selbpolys, exbound)
badpolys = np.logical_or(inpolys.all(1), expolys.all(1))
boundpolys = np.logical_and(np.logical_or(inpolys, expolys).all(1), ~badpolys)

Expand Down
2 changes: 1 addition & 1 deletion cortex/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def flatten_slim(
)
# Cull pts that are not in manifold
pi = np.arange(len(pts))
pii = np.in1d(pi, polys.flatten())
pii = np.isin(pi, polys.flatten())
idx = np.nonzero(pii)[0]
pts_new = pts[idx]
# Match indices in polys to new index for pts
Expand Down
2 changes: 1 addition & 1 deletion cortex/surfinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def make_surface_graph(tris):
mwallset = set.union(*(set(g[v]) for v in fog.nodes())) & set(allbounds)
#cutset = (set(g.nodes()) - mwallset) & set(allbounds)

mwallbounds = [np.in1d(b, mwallset) for b in bounds]
mwallbounds = [np.isin(b, mwallset) for b in bounds]
changes = [np.nonzero(np.diff(b.astype(float))!=0)[0]+1 for b in mwallbounds]

#splitbounds = [np.split(b, c) for b,c in zip(bounds, changes)]
Expand Down
4 changes: 2 additions & 2 deletions cortex/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,12 +811,12 @@ def get_roi_masks(subject, xfmname, roi_list=None, gm_sampler='cortical', split_
vert_in_scan = np.hstack([np.array((m>0).sum(1)).flatten() for m in mapper.masks])
vert_in_scan = vert_in_scan[roi_verts[roi]]
elif use_cortex_mask:
vox_in_roi = np.in1d(vox_idx.flatten(), roi_verts[roi]).reshape(vox_idx.shape)
vox_in_roi = np.isin(vox_idx, roi_verts[roi])
roi_voxels[roi] = vox_in_roi & cortex_mask
# This is not accurate... because vox_idx only contains the indices of the *nearest*
# vertex to each voxel, it excludes many vertices. I can't think of a way to compute
# this accurately for non-mapper gm_samplers for now... ML 2017.07.14
vert_in_scan = np.in1d(roi_verts[roi], vox_idx[cortex_mask])
vert_in_scan = np.isin(roi_verts[roi], vox_idx[cortex_mask])
# Compute ROI coverage
pct_coverage[roi] = vert_in_scan.mean() * 100
if use_mapper:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
# Minimum requirements for the build system to execute, according to PEP518
# specification.
requires = ["setuptools>=64", "setuptools-scm>=8", "build", "numpy", "cython", "wheel"]
requires = ["setuptools>=64", "setuptools-scm>=8", "build", "numpy>=1.13.0", "cython", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
setuptools
future
numpy
numpy>=1.13.0
scipy
tornado>=4.3
shapely
Expand Down