Skip to content

Instantly share code, notes, and snippets.

@dyf
Created June 15, 2017 16:55
Show Gist options
  • Save dyf/e92bd50abb59f20110c2b38989379104 to your computer and use it in GitHub Desktop.
Save dyf/e92bd50abb59f20110c2b38989379104 to your computer and use it in GitHub Desktop.
create stimulus analysis objects from NWB + analysis file
from allensdk.brain_observatory.locally_sparse_noise import LocallySparseNoise
from allensdk.core.brain_observatory_cache import BrainObservatoryCache
import allensdk.brain_observatory.stimulus_info as stiminfo
experiment_id = 12345 # dummy id
analysis_file = '/path/to/analysis.h5'
boc = BrainObservatoryCache(manifest_file='boc/manifest.json')
data_set = boc.get_ophys_experiment_data(experiment_id)
# if it's one of the newer experiments, use si.LOCALLY_SPARSE_4DEG
# or si.LOCALLY_SPARSE_NOISE_8DEG instead
lsn = LocallySparseNoise.from_analysis_file(data_set,
analysis_file,
si.LOCALLY_SPARSE_NOISE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment