Error importing hoc files

20 views
Skip to first unread message

Max Henderson

unread,
Feb 1, 2012, 4:02:25 PM2/1/12
to neuro...@googlegroups.com
Hi, I am running into an error whenever I try to load a hoc file to use neuronvisio.  Basically, I download a swc file from a site like neuromorpho. I use cvapp to convert this file into a hoc file, which looks good in an editor. Then, I try to use neuronvisio to load the hoc file, but I consistently get the same error regardless of several different hoc files:

IOError: file ``/home/.../test.hoc`` exists but it is not an HDF5 file

Thanks!

Michele Mattioni

unread,
Feb 2, 2012, 4:42:54 AM2/2/12
to neuro...@googlegroups.com
Hi Max,

which version of Neuronvisio are you using?

Loading directly an hoc is possible only with the latest development on github.
To load an hoc file with version 0.7.3 you can do something like:

from neuron import h
from neuronvisio.controls import Controls
controls = Controls()
h.load_file('path/to/file.hoc')

Check out this:
http://mattions.github.com/neuronvisio/gettingstarted.html#hoc-intergration

HIH,
Michele.

Max Henderson

unread,
Feb 2, 2012, 3:17:59 PM2/2/12
to neuronvisio
Hi Michele,

I actually used the link you included to setup neuronvisio, and I am
using the 0.7.3 version. I am able to boot up neuronvisio GUI window
just fine, but when I click to open the hoc file, it keeps saying it
is not HDF5 (whatever that means). Is there any example hoc programs
online you would suggest trying to load that you know work? I could
try that and see if I get the same error.

Thanks!

-Max

On Feb 2, 4:42 am, Michele Mattioni <matti...@gmail.com> wrote:
> Hi Max,
>
> which version of Neuronvisio are you using?
>
> Loading directly an hoc is possible only with the latest development on github.
> To load an hoc file with version 0.7.3 you can do something like:
>
>     from neuron import h
>     from neuronvisio.controls import Controls
>     controls = Controls()
>     h.load_file('path/to/file.hoc')
>
> Check out this:http://mattions.github.com/neuronvisio/gettingstarted.html#hoc-interg...

Uri Cohen

unread,
Feb 2, 2012, 3:23:56 PM2/2/12
to neuro...@googlegroups.com
Max,
We've just recently added a support for loading hoc files directly from the 'load' button. This should work in the development version you can get at github (enter https://github.com/mattions/neuronvisio and press the code button, then the zip button to download a copy).

In version 0.7.3 indeed the load button expects HDF files exclusively.
Hope this helps,

            Uri Cohen
--

Michele Mattioni

unread,
Feb 3, 2012, 6:14:42 AM2/3/12
to neuro...@googlegroups.com
Hi Max,

if you want to stick with 0.7.3, you could try some inspiration from
the pyramidal example on github
https://github.com/mattions/neuronvisio/tree/master/examples/pyramidal

Check out the readme as well
https://github.com/mattions/neuronvisio/blob/master/examples/pyramidal/README_NEURONVISIO.rst

In particular this is the main script:
https://github.com/mattions/neuronvisio/blob/master/examples/pyramidal/main.py

If you are able to load the GUI, then simply do

from neuron import h
h.load_file('main_model_file.hoc')

Otherwise, you can try the dev version as Uri suggested,
however we are still trying to squash these two bugs
(https://github.com/mattions/neuronvisio/issues/32,
https://github.com/mattions/neuronvisio/issues/34)

HIH,
Michele.

Max Henderson

unread,
Feb 3, 2012, 12:55:13 PM2/3/12
to neuronvisio
Hey guys, thanks for the help! I am now able to run the hoc files just
fine! It still is being weird using the GUI window for loading the hoc
files, but if I use the command line:

from neuron import h
h.load_file('my file.hoc')

it works just fine! Thanks again for the helpful responses.

On Feb 3, 6:14 am, Michele Mattioni <matti...@gmail.com> wrote:
> Hi Max,
>
> if you want to stick with 0.7.3, you could try some inspiration from
> the pyramidal example on githubhttps://github.com/mattions/neuronvisio/tree/master/examples/pyramidal
>
> Check out the readme as wellhttps://github.com/mattions/neuronvisio/blob/master/examples/pyramida...
>
> In particular this is the main script:https://github.com/mattions/neuronvisio/blob/master/examples/pyramida...
>
> If you are able to load the GUI, then simply do
>
>     from neuron import h
>     h.load_file('main_model_file.hoc')
>
> Otherwise, you can try the dev version as Uri suggested,
> however we are still trying to squash these two bugs
> (https://github.com/mattions/neuronvisio/issues/32,https://github.com/mattions/neuronvisio/issues/34)
>
> HIH,
> Michele.
>
>
>
>
>
>
>
> On Thu, Feb 2, 2012 at 8:23 PM, Uri Cohen <uri.co...@gmail.com> wrote:
> > Max,
> > We've just recently added a support for loading hoc files directly from the
> > 'load' button. This should work in the development version you can get at
> > github (enterhttps://github.com/mattions/neuronvisioand press the code
Reply all
Reply to author
Forward
0 new messages