question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

problem running the demo

See original GitHub issue

Hi,

I have followed all the steps from your guide and the installation was okay. But when I try to to run the demo I get this:


In [6]: ds = cortex.load("S1_retinotopy.hdf")
Mask not found, generating...
Traceback (most recent call last):
  File "cortex/dataset/__init__.py", line 92, in from_file
    ds.views[name] = Dataview.from_hdf(node)
  File "cortex/dataset/views.py", line 179, in from_hdf
    vmin=vmin[0], vmax=vmax[0], state=state, **attrs)
  File "cortex/dataset/views.py", line 72, in _from_hdf_view
    return _from_hdf_data(h5, data, xfmname=xfmname, vmin=vmin, vmax=vmax, **kwargs)
  File "cortex/dataset/views.py", line 61, in _from_hdf_data
    return Volume(dnode, subj, xfmname, mask=mask, **kwargs)
  File "cortex/dataset/views.py", line 248, in __init__
    cmap=cmap, vmin=vmin, vmax=vmax, description=description, **kwargs)
  File "cortex/dataset/braindata.py", line 110, in __init__
    self._check_size(mask)
  File "cortex/dataset/braindata.py", line 149, in _check_size
    self.mask = db.get_mask(self.subject, self.xfmname, mask)
  File "cortex/database.py", line 526, in get_mask
    mask = get_cortical_mask(subject, xfmname, type)
  File "cortex/utils.py", line 99, in get_cortical_mask
    dist, idx = get_vox_dist(subject, xfmname)
  File "cortex/utils.py", line 132, in get_vox_dist
    fiducial, polys = db.get_surf(subject, surface, merge=True)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 470, in get_surf
    left, right = [ self.get_surf(subject, type, hemisphere=h) for h in ["lh", "rh"]]
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 489, in get_surf
    wpts, polys = self.get_surf(subject, 'wm', hemi)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 494, in get_surf
    from . import formats
ImportError: cannot import name formats
Mask not found, generating...
Traceback (most recent call last):
  File "cortex/dataset/__init__.py", line 92, in from_file
    ds.views[name] = Dataview.from_hdf(node)
  File "cortex/dataset/views.py", line 179, in from_hdf
    vmin=vmin[0], vmax=vmax[0], state=state, **attrs)
  File "cortex/dataset/views.py", line 72, in _from_hdf_view
    return _from_hdf_data(h5, data, xfmname=xfmname, vmin=vmin, vmax=vmax, **kwargs)
  File "cortex/dataset/views.py", line 61, in _from_hdf_data
    return Volume(dnode, subj, xfmname, mask=mask, **kwargs)
  File "cortex/dataset/views.py", line 248, in __init__
    cmap=cmap, vmin=vmin, vmax=vmax, description=description, **kwargs)
  File "cortex/dataset/braindata.py", line 110, in __init__
    self._check_size(mask)
  File "cortex/dataset/braindata.py", line 149, in _check_size
    self.mask = db.get_mask(self.subject, self.xfmname, mask)
  File "cortex/database.py", line 526, in get_mask
    mask = get_cortical_mask(subject, xfmname, type)
  File "cortex/utils.py", line 99, in get_cortical_mask
    dist, idx = get_vox_dist(subject, xfmname)
  File "cortex/utils.py", line 132, in get_vox_dist
    fiducial, polys = db.get_surf(subject, surface, merge=True)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 470, in get_surf
    left, right = [ self.get_surf(subject, type, hemisphere=h) for h in ["lh", "rh"]]
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 489, in get_surf
    wpts, polys = self.get_surf(subject, 'wm', hemi)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 494, in get_surf
    from . import formats
ImportError: cannot import name formats
Mask not found, generating...
Traceback (most recent call last):
  File "cortex/dataset/__init__.py", line 92, in from_file
    ds.views[name] = Dataview.from_hdf(node)
  File "cortex/dataset/views.py", line 179, in from_hdf
    vmin=vmin[0], vmax=vmax[0], state=state, **attrs)
  File "cortex/dataset/views.py", line 72, in _from_hdf_view
    return _from_hdf_data(h5, data, xfmname=xfmname, vmin=vmin, vmax=vmax, **kwargs)
  File "cortex/dataset/views.py", line 61, in _from_hdf_data
    return Volume(dnode, subj, xfmname, mask=mask, **kwargs)
  File "cortex/dataset/views.py", line 248, in __init__
    cmap=cmap, vmin=vmin, vmax=vmax, description=description, **kwargs)
  File "cortex/dataset/braindata.py", line 110, in __init__
    self._check_size(mask)
  File "cortex/dataset/braindata.py", line 149, in _check_size
    self.mask = db.get_mask(self.subject, self.xfmname, mask)
  File "cortex/database.py", line 526, in get_mask
    mask = get_cortical_mask(subject, xfmname, type)
  File "cortex/utils.py", line 99, in get_cortical_mask
    dist, idx = get_vox_dist(subject, xfmname)
  File "cortex/utils.py", line 132, in get_vox_dist
    fiducial, polys = db.get_surf(subject, surface, merge=True)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 470, in get_surf
    left, right = [ self.get_surf(subject, type, hemisphere=h) for h in ["lh", "rh"]]
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 489, in get_surf
    wpts, polys = self.get_surf(subject, 'wm', hemi)
  File "cortex/database.py", line 34, in memofn
    self._memocache[h] = fn(self, *args, **kwargs)
  File "cortex/database.py", line 494, in get_surf
    from . import formats
ImportError: cannot import name formats

I just dropped S1_retinotopy.hdf in the pycortex file.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
marklescroartcommented, Jun 2, 2016

Hello,

Pardon our late reply. This got a little long, and is probably more info than you need; we will probably post this answer in a more general FAQ at some point. Anyway:

The error you got tells us that the config file for pycortex is pointing to an incorrect directory for the color maps that pycortex uses. This probably occurred due to some irregularity in how you downloaded and installed pycortex, and/or put pycortex onto your python path. (For example, this might happen if you moved the source code directory after installing pycortex.)

In any case, you can edit the config file to resolve this issue, to tell pycortex where to find the colormap directory that it has lost. pycortex also has probably lost the subjects database, so we’ll fix that too while we’re at it.

In the pycortex source folder, there should be a sub-folder called filestore. In that sub-folder are two folders called colormaps and db. In the normal installation process, these two files are copied somewhere else on your computer (the specific directory is platform-specific; on Ubuntu, this will be in /usr/local/share/pycortex; on Mac OS, it will depend on your python install. If you use Anaconda, it should be in <anaconda directory>/share/pycortex/. You can probably find it by searching for folders named pycortex with spotlight.

In the colormaps folder are a bunch of image files, such as ‘jet.png’ and ‘RdBu_2D.png’. In the subjects directory, there will only be one folder (S1), for the example subject. This is where data (surfaces, ROIs, etc) for future subjects will be stored, so this folder should NOT just be the db/ folder in your source directory.

These directories don’t have to stay where they’re put. For example, if you want your subjects directory to just be ~/Subjects/, you just need to change an entry in your config file. The config file is kind of hiding for now. Sorry about that.

On Ubuntu, the config file can be found at: ~/.config/pycortex/options.cfg

On Mac OS, it can be found at ‘~/Library/Application Support/pycortex/options.cfg’

(in both cases, ~ is your home directory)

If it’s not in either of those places, and you are able to import pycortex, try calling cx.options.userdir - that will point you to the directory in which the config file lives.

In the config file, below that line that reads: [basic]

add this line: (replace any line starting with filestore= if it’s there) filestore = /path/to/your/source/directory/filestore/db/

and below the line that reads: [webgl]

add this line: colormaps = /path/to/your/source/directory/filestore/colormaps/

… And that should do it. Note that there are many other settings in the config file that can be changed to change the default appearance of your viewers, so you might want to poke around there a bit. Or not. Up to you.

0reactions
MorningstarZhangcommented, Sep 20, 2018

how did you change the the url to localhost? I am struggling with this still: WARNING:tornado.access:404 GET /stim/retinotopy.ogv

Have you solved it? I have the same problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem running the demo · Issue #25 · ElectronNET ... - GitHub
The demo is launching but all button "View Demo" does nothing. I don't see any error in the console of dev tools. Am...
Read more >
Problem running the demo, page 1 - Forum - GOG.com
Whenever I try to run it in Direct3D (fullscreen or windowed mode) the game gives me an error saying "the requested driver is...
Read more >
Syntax error shows running the Demo - Google Groups
When i run the Demo "sh demo_CH_archive", it says: demo_CH_archive: 2: demo_CH_archive: Syntax error: word unexpected (expecting ")").
Read more >
Problem running Demo :: Choice of Rebels: Uprising General ...
Problem running Demo. Love to buy/play this game, but the demo just opens a blank window. No error messages. System is running 64-bit...
Read more >
Problem running the demo source code - Microchip Technology
Hi, I'm having trouble in running the demo source code. When i try to build it by clicking "Build All" option, it showed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found