wiheto / netplotbrain

A package to create simple 3D network visualizations on a brain.
Apache License 2.0
69 stars 7 forks source link

BUG: problem plotting some parcel atlas with single hemisphere #52

Open wiheto opened 2 years ago

wiheto commented 2 years ago

Following code

import netplotbrain 
# Get 100 node atlas from templateflow
node_dict = {'atlas':       'Schaefer2018', 
             'desc':        '100Parcels7Networks',
             'extension':   '.nii.gz',
             'resolution':  1}
netplotbrain.plot(template = 'MNI152NLin2009cAsym',
                  nodes =     node_dict,
                  nodetype = 'parcels',
                  view =      'S',
                  hemisphere = 'L')

Leads to

RuntimeError: No surface found at the given iso value.

Problem seems to be that some voxels that some voxels for R hemisphere nodes are still included and too small to plot as parcel surfaces.

Solution: Need to add checks about parcel center's hemisphere when getting single hemisphere. OR different non-surface method to plot parcels (just voxels takes too long)

Difficulty to solve: medium to hard