gallantlab/pycortex — pull request #116 by infocortex (2014-11-09 06:45:13+00:00)
Title: Enh/static options

Hi Guys,

In our work on generating static pycortex views into NeuroVault, we've arrived a few small changes that we think might improve the usage of pycortex when used to generate views that are served and deployed by another site or webapp.

In our usage a generic subject (fsaverage) is used in all data views, so as a result, the same CTM data in the datastore cache is copied to each static directory. As the number of data sets stored in Neurovault continues to grow, led to a considerable amount of redundant data on disk.

As a solution I've added a an optional argument to make_static() that disables of the copying of the ctm data. In that case, of course the user will have to serve these files separately with their web server, which works well for us.

The other change included in this PR addresses a similar issue. The htmlembed feature is neat, it makes nicely portable static views, but one disadvantage is that the embedding makes caching impossible, and since the views are often fairly large >10mb, this can be problematic for a web deployment of pycortex content.

To sort that out, we've also added a optional arg that tells make_static to skip the embedding, and keep the conventional urls in the html output.

The changes are pretty small in scope, default-off optional args, so I hope you'll find it a useful change for the static-generation use case of pycortex.

BTW, sorry for all the less-meaningful diff lines, my editor removes trailing whitespace, hope you don't mind.

Thanks!
Gabriel