In [1]:
%load_ext autoreload
%autoreload 2

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


/oasis/scratch/iizhaki/temp_project/PV/python-virtualEnv3/lib/python2.7/site-packages/skimage/filter/__init__.py:6: skimage_deprecation: The `skimage.filter` module has been renamed to `skimage.filters`.  This placeholder module will be removed in v0.13.
  warn(skimage_deprecation('The `skimage.filter` module has been renamed '

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')


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-7-a305d5931ee3> in <module>()
      1 sec = 0
      2 
----> 3 dm_prev = DataManager(generate_hierarchy=False, stack='RS141', resol='x5', section=sec)
      4 supporters_prev = dm_prev.load_pipeline_result('supporters', 'pkl')
      5 

NameError: name 'DataManager' is not defined

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 [ ]: