MICA-MNI / ENIGMA

The ENIGMA Toolbox is an open-source repository for accessing 100+ ENIGMA statistical maps, visualizing cortical and subcortical surface data, and relating neuroimaging findings to micro- and macroscale brain organization. 🤠
https://enigma-toolbox.readthedocs.io
BSD 3-Clause "New" or "Revised" License
128 stars 31 forks source link

Unable to run the example scripts #18

Closed qniksefat closed 2 years ago

qniksefat commented 2 years ago

Hi,

I'm trying to plot subcortical regions with your example data -or with random data shaped like (1, 16).

import numpy as np
from enigmatoolbox.datasets import load_example_data

# Load all example data from an individual site
cov, metr1_SubVol, metr2_CortThick, metr3_CortSurf = load_example_data()

from enigmatoolbox.utils.useful import reorder_sctx

# Re-order the subcortical data alphabetically and by hemisphere
metr1_SubVol_r = reorder_sctx(metr1_SubVol)

metr1_SubVol_r.iloc[0, 2:].to_numpy()
# this np array has a shape of (1, 16) 

from enigmatoolbox.plotting import plot_subcortical

plot_subcortical(
    # ventricles=False,
    array_name=metr1_SubVol_r.iloc[0, 2:].to_numpy(),
    cmap='RdBu_r', color_bar=True, color_range=(-0.5, 0.5),
)

I'm having python 3.8 on mac M1 processor. installed vtk==9.1.0 via pip. getting many errors:

2022-08-08 09:51:01.378 (  64.234s) [          32FB66] vtkPythonAlgorithm.cxx:112    ERR| vtkPythonAlgorithm (0x600001c18820): Failure when calling method: "ProcessRequest":

ValueError: Input port 1 of ''vtkTriangleFilter'' does not accept multiple connections.

2022-08-08 09:51:01.490 (  64.346s) [          32FB66]       vtkExecutive.cxx:753    ERR| vtkCompositeDataPipeline (0x600001430000): Algorithm vtkPythonAlgorithm(0x600001c18820) returned failure for request: vtkInformation (0x600003834e80)

Debug: Off
  Modified Time: 195
  Reference Count: 2
  Registered Events: (none)
  Request: REQUEST_DATA
  FROM_OUTPUT_PORT: 0
  ALGORITHM_AFTER_FORWARD: 1
  FORWARD_DIRECTION: 0

ValueError: Input port 1 of ''vtkTriangleFilter'' does not accept multiple connections.

Finally, it throws ValueError: Array shape is not valid. though I checked the array_name in the code which needs to be (1, 16) or (1, 14) ordered.. Any thoughts?

saratheriver commented 2 years ago

Hello!

Sorry to hear you're having trouble with the toolbox. I tried to replicate the error with python3.8 and vtk==9.1.0 but it seems to work fine on my end (?)

Perhaps try to git pull the latest version of enigma toolbox and pip install [ENIGMADIRECTORY] ... see if this works?

Sara.