hfp.data_from_file(filepath=params['intermedfolder'] + params['locmaxfile'], skeys=('disttransf', 'disttransfm'), tkeys=('disttransf', 'disttransfm')) hfp.startlogger() try: hfp.logging('hfp datastructure:\n---\n{}---', hfp.datastructure2string(maxdepth=2)) hfp.anytask(lib.getvaluesfromcoords, reciprocal=True, keys='disttransfm', indict=hfp['false', '6155_9552'], tkeys='result_false') hfp.logging('hfp datastructure:\n---\n{}---', hfp.datastructure2string(maxdepth=2)) # y = [] # maxlen = 0 # for d, k, v, kl in hfp['result_false'].data_iterator(): # y.append(v) # x = range(0, len(v)) # plt.plot(x, v) # if len(v) > maxlen: # maxlen = len(v) # # x = range(0, len(hfp['path_dt_6155_9552_0']))
# split_sample_a.write('/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splA.raw_neurons.crop.split_xyz.h5') # Sample B sample = IPL( filepath= '/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splB.raw_neurons.crop.h5' ) sample.logging('Sample B datastructure\n---\n{}', sample.datastructure2string()) reskeys = ('0', '1') split_sample = IPL() split_sample['z'] = sample.anytask(lib.split, 2, axis=0, result_keys=reskeys, return_only=True) split_sample['y'] = sample.anytask(lib.split, 2, axis=1, result_keys=reskeys, return_only=True) split_sample['x'] = sample.anytask(lib.split, 2, axis=2, result_keys=reskeys, return_only=True) split_sample = split_sample.switch_levels(1, 2) sample.logging('Split sample B datastructure\n---\n{}',
# print k2 # hfp.anytask(lib.getvaluesfromcoords, v2, # reciprocal=False, # keys='disttransfm', # tkeys='{}.{}.{}'.format('result_false', k, k2)) # Pop selected labels a = hfp['true', 'border'] a.pop('63') for k, v in a.iteritems(): print k for k2, v2 in v.iteritems(): print k2 hfp.anytask(lib.getvaluesfromcoords, v2, reciprocal=False, keys=('disttransf', 'raw'), tkeys='{}.{}.{}'.format('result_true', k, k2)) #'{}.{}.{}'.format('result_true', k, k2) a = hfp['false', 'border'] # a.pop('63') for k, v in a.iteritems(): print k for k2, v2 in v.iteritems(): print k2 hfp.anytask(lib.getvaluesfromcoords, v2, reciprocal=False, keys=('disttransfm', 'raw'),
from hdf5_image_processing import Hdf5ImageProcessingLib as IPL import processing_lib as lib # Sample A probs probs_a = IPL( filepath= '/mnt/localdata01/jhennies/neuraldata/cremi_2016/sample_A_train_betas/sample_A_train_mcseg_beta_0.5.h5' ) probs_a.logging('Probs A datastructure\n---\n{}', probs_a.datastructure2string()) probs_a.anytask(lib.swapaxes, 0, 2) probs_a.write( '/mnt/localdata01/jhennies/neuraldata/cremi_2016/sample_A_train_betas/cremi.splA.train.seg_beta_0.5.crop.h5' ) reskeys = ('0', '1') split_probs_a = IPL() split_probs_a['z'] = probs_a.anytask(lib.split, 2, axis=0, result_keys=reskeys, return_only=True, rtrntype=IPL) split_probs_a['y'] = probs_a.anytask(lib.split, 2, axis=1, result_keys=reskeys, return_only=True,
from hdf5_image_processing import Hdf5ImageProcessingLib as IPL import processing_lib as lib # Sample A probs probs_a = IPL( filepath='/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splA.probs_cantorV1.h5' ) probs_a.logging('Probs A datastructure\n---\n{}', probs_a.datastructure2string()) probs_a.anytask(lib.swapaxes, 0, 2) probs_a.write('/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splA.train.probs.crop.h5') reskeys = ('0', '1') split_probs_a = IPL() split_probs_a['z'] = probs_a.anytask(lib.split, 2, axis=0, result_keys=reskeys, return_only=True, rtrntype=IPL) split_probs_a['y'] = probs_a.anytask(lib.split, 2, axis=1, result_keys=reskeys, return_only=True, rtrntype=IPL) split_probs_a['x'] = probs_a.anytask(lib.split, 2, axis=2, result_keys=reskeys, return_only=True, rtrntype=IPL) split_probs_a = split_probs_a.switch_levels(1, 2) probs_a.logging('Split sample A datastructure\n---\n{}', split_probs_a.datastructure2string()) split_probs_a.write('/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splA.train.probs.crop.split_xyz.h5')
# # split_sample_a = split_sample_a.switch_levels(1, 2) # sample_a.logging('Split sample A datastructure\n---\n{}', split_sample_a.datastructure2string()) # # split_sample_a.write('/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splA.raw_neurons.crop.split_xyz.h5') # Sample B sample = IPL( filepath='/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splB.raw_neurons.crop.h5' ) sample.logging('Sample B datastructure\n---\n{}', sample.datastructure2string()) reskeys = ('0', '1') split_sample = IPL() split_sample['z'] = sample.anytask(lib.split, 2, axis=0, result_keys=reskeys, return_only=True) split_sample['y'] = sample.anytask(lib.split, 2, axis=1, result_keys=reskeys, return_only=True) split_sample['x'] = sample.anytask(lib.split, 2, axis=2, result_keys=reskeys, return_only=True) split_sample = split_sample.switch_levels(1, 2) sample.logging('Split sample B datastructure\n---\n{}', split_sample.datastructure2string()) split_sample.write('/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splB.raw_neurons.crop.split_xyz.h5') # Sample C sample = IPL( filepath='/mnt/localdata02/jhennies/neuraldata/cremi_2016/cremi.splC.raw_neurons.crop.h5' ) sample.logging('Sample C datastructure\n---\n{}', sample.datastructure2string())