26 lines
642 B
Python
26 lines
642 B
Python
import nixio as nix
|
|
import os
|
|
from IPython import embed
|
|
|
|
def read_baseline_eod(dataset):
|
|
base = dataset.split(os.path.sep)[-1] + ".nix"
|
|
nix_file = nix.File.open(os.path.join(dataset, base))
|
|
embed()
|
|
nix_file.close()
|
|
b = nix_file.blocks[0]
|
|
for t in b.tags():
|
|
if "baseline" in t.name:
|
|
break;
|
|
eod_da = b.data_arrays["LocalEOD-1"]
|
|
eod = t.retrieve_data("LocalEOD-1")
|
|
time = eod_da.dimensions[0].axis(len(eod))
|
|
nix_file.close()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
data_dir = "../data"
|
|
dataset = "2018-11-09-ad-invivo-1"
|
|
eod = read_baseline_eod(os.path.join(data_dir, dataset))
|
|
|
|
|