Enh/pycortex features

Hi Chris,

Heres the PR for the new pycortex features in the NV codebase:
-symmetrical colormap ranges
-view all collection images in pycortex (which was a little bit tricky due to the undocumented architecture changes in pycortex)

I added a checksum of the file properties of a collection, so that if the collection contents change, the static pycortex output will be regenerated.

More to come!

Cheers,
Gabriel
Only because I wanted to stick with the convention of pycortex directories
being completely static media.  I wanted to consider database tracking of
pycortex metadata as a separate effort, which was my original reasoning.

But actually, yeah maybe it's nicer to just add a last_md5 field to the
collections model for this purpose.

On Mon, Nov 3, 2014 at 4:58 PM, Chris Filo Gorgolewski <
notifications@github.com> wrote:

> In neurovault/apps/statmaps/views.py:
>
> >
> >      _, _, ext = split_filename(image.file.url)
> >      pycortex_url = image.file.url[:-len(ext)] + "_pycortex/index.html"
> >      return redirect(pycortex_url)
> >
> >
> > +def view_collection_with_pycortex(request, cid):
> > +    volumes = []
> > +    collection = get_collection(cid,request,mode='file')
> > +    images = Image.objects.filter(collection=collection)
> > +    basedir = os.path.split(images[0].file.path)[0]
> > +    baseurl = os.path.split(images[0].file.url)[0]
> > +    output_dir = os.path.join(basedir, "pycortex_all")
> > +    col_state = collection_md5sum(collection)
> > +    state_fpath = os.path.join(output_dir,'md5sum')
> > +
> > +    if os.path.exists(output_dir):
> > +        # check if collection contents have changed
> > +        existing_state = open(state_fpath,'r').read()
>
> why keep this in a file not in the database?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NeuroVault/NeuroVault/pull/33/files#r19779456>.
>



-- 
*Gabriel Rivera*

InfoCortex UG
rivera@infocortex.com

+49 (0) 176 7223 1002
+1 917.375.0045

Friedensstraße 11/Kaiserplatz
D-60311 Frankfurt am Main
www.infocortex.com