In [ ]:
%load_ext autoreload
%autoreload 2

import sys
sys.path.append('/home/yuncong/Brain/pipeline_scripts')
from utilities2014 import *

In [2]:
os.environ['GORDON_DATA_DIR'] = '/home/yuncong/project/DavidData2014tif/'
os.environ['GORDON_REPO_DIR'] = '/home/yuncong/Brain'
os.environ['GORDON_RESULT_DIR'] = '/home/yuncong/project/DavidData2014results/'
os.environ['GORDON_LABELING_DIR'] = '/home/yuncong/project/DavidData2014labelings/'

In [7]:
sec = 0

dm_prev = DataManager(generate_hierarchy=False, stack='RS141', resol='x5', section=sec)
supporters_prev = dm_prev.load_pipeline_result('supporters', 'pkl')

dm_next = DataManager(generate_hierarchy=False, stack='RS141', resol='x5', section=sec+1)
supporters_next = dm_next.load_pipeline_result('supporters', 'pkl')

matchings_prev_with_next = dm_prev.load_pipeline_result('matchings%dWith%d'%(sec,sec+1), 'pkl')


loaded /home/yuncong/project/DavidData2014results/RS141/0000/RS141_x5_0000_gabor-blueNisslWide-segm-blueNisslRegular-vq-blueNissl_supporters.pkl
loaded /home/yuncong/project/DavidData2014results/RS141/0001/RS141_x5_0001_gabor-blueNisslWide-segm-blueNisslRegular-vq-blueNissl_supporters.pkl
loaded /home/yuncong/project/DavidData2014results/RS141/0000/RS141_x5_0000_gabor-blueNisslWide-segm-blueNisslRegular-vq-blueNissl_matchings0With1.pkl

In [8]:
dual_image = dm_prev.load_pipeline_result('matchedBoundaries%dWith%dSideBySide'%(sec,sec+1), 'jpg')

plt.figure(figsize=(20,20));
plt.imshow(dual_image);
plt.axis('off');


loaded /home/yuncong/project/DavidData2014results/RS141/0000/RS141_x5_0000_gabor-blueNisslWide-segm-blueNisslRegular-vq-blueNissl_matchedBoundaries0With1SideBySide.jpg

In [9]:
wrong_matchings = [2, 5, 6, 8, 9, 10, 12, 14]

In [10]:
for ind in wrong_matchings:
    score, i, j = matchings_prev_with_next[ind]
    print 'matching', ind, '(boundary', i, 'of section', sec, 'and boundary', j, 'of section', sec+1, ') is wrong'
    print len(supporters_prev[i]), len(supporters_next[j])

In [ ]: