chrisfilo/NeuroVault — pull request #1 by tyarkoni (2013-05-19 00:20:45+00:00)
Title: added neurosynth viewer and basic styling

Added the Neurosynth viewer; should be basically functional now if you create a new Study and add StatMaps. Note that you'll need to have the current version of the neurosynth package installed for the conversion from nifti to json to work. If you don't have it installed, it will fail silently and nothing will happen (except that the viewer won't work properly).

Some other comments:

* I added Bootstrap and jQuery to the project and added some basic styling. This is a placeholder and isn't meant to commit us to any particular look, I just wanted something that would make the viewer look reasonable for now.

* I added a 'static' subdirectory to the statmaps app for app-specific files, and one to the main app for general files. I also reworked the templates quite a bit.

* I created an 'anatomical' subdir under /data to house the anatomical underlay files. This isn't an ideal way to do it; much better would be to write a fixture generator that automatically creates a record for the MNI152 image, processes it, and puts it in the standard location when the app is first created. I'm not sure how to do this in Django though, so I haven't done it. For now this is probably fine, it's just not very elegant since it means the viewer has the location of the anatomical JSON file hardcoded.

* I updated the url() calls so that all the templates and views are namespaced (i.e., I changed url('login') to url('users:login'), etc. This seems like the recommended practice, but feel free to undo it if it's a problem. It also solved a conflict I was getting when trying to reverse namespaced routes that weren't namespaced yet (e.g., after saving a study's statmaps).

* For now, any generated JSON files are dumped in the same place as the original images.

Let me know if you run into any problems, but I tested this in a couple of browsers and the viewing seems to work well for me.