thunder-project / thunder-extraction

algorithms for feature extraction from spatio-temporal data
MIT License
6 stars 4 forks source link

Neurofinder regions don't load as they lack "regions" #6

Open sofroniewn opened 7 years ago

sofroniewn commented 7 years ago

Trying to load the neurofinder regions using

import extraction as ex
model = ex.load(pathToRegions)

I get an error in the following line ---> 23 regions = many([x['coordinates'] for x in raw['regions']])

as they don't have any regions. If I add in {"regions": .... } to the JSON file then everything is ok.

This is easy for me to do, but I'm wondering why the regions keyword was added and if I should keep it in future json files.

sofroniewn commented 7 years ago

After talking with @freeman-lab solution we agreed on is to check if there is a "regions" field, if yes load the array, if not just try loading the array. This will maintain backwards compatibility with the neurofinder data and allow us to load in the standard data format too