Skip to content
Eric Denovellis edited this page Dec 7, 2015 · 12 revisions

Web Server

In order for SpectraVis to load files, a web server is needed. You can run this on your local machine easily via python:

  • python -m SimpleHTTPServer 8000 & (in Python 2) or
  • python -m http.server 8000 & (in Python 3)

This allows viewing of the application at http://localhost:8000/ in your web browser. If you use npm to install SpectraVis, this will automatically come with tools to launch a local web server. If installing via npm, type gulp in the local directory and the visualization will appear at http://localhost:8000/. It will also automatically update the visualizations based on changes you make locally.

Directory structure

SpectraVis expects the following file structure in order to run.

spectravis/
  index.html
  css/
    main.css
  js/
    main.js
    vendor.js
  DATA/
    brainImages/
      brainImage_(SUBJECTID).png
    channels_(SUBJECTID).json
    edges_(SUBJECTID)_(EDGESTATID).json
    spectrogram_(SUBJECTID)_(CHANNELID).json
    subjects.json
    visInfo.json
    edgeTypes.json

where:

  • SUBJECTID corresponds to a unique identifying key for a subject defined in subjects.json
  • EDGESTATID corresponds to the unique identifying key for a given edge statistic defined in the edgeTypes.json
  • CHANNELID corresponds to the unique identifying key for a channel/sensor (e.g. an electrode).

main.js and vendor.js contain all the javascript needed to run the application. vendor.js consists of external libraries needed to run the code in main.js.

Data Format

All .json files should be placed in the DATA folder. You can find more information about each of these .json files in the wiki:

Is there an easy way to get my data from matlab to json?

Yes! See JSONlab --- an tool to convert Matlab data structures into JSON files. See the matlab folder in SpectraVis for examples on how to convert data into the right format for SpectraVis.