In [35]:
%load_ext autoreload

%autoreload 2


The autoreload extension is already loaded. To reload it, use:
  %reload_ext autoreload

In [41]:
from AllenImageSyncroSDK import AllenImageSyncroSDK

In [ ]:


In [42]:
allensdk=AllenImageSyncroSDK()

In [43]:
allensdk.reference_to_image(1,0,0,0,[100054727])


Out[43]:
{u'id': 0,
 u'msg': [{u'image_sync': {u'section_data_set_id': u'100054727',
    u'section_image_id': 101076332,
    u'section_number': 2,
    u'x': -2417.3885850519555,
    u'y': -1548.4395986819839}}],
 u'num_rows': 0,
 u'start_row': 0,
 u'success': True,
 u'total_rows': 0}

In [48]:
#this takes a plate from the e18 atlas (100740810)
#and a location roughly over p2a on that plate
#and maps it to the p56 atlas (id=181276165)
# see http://atlas.brain-map.org/atlas?atlas=181276160#atlas=181276160&plate=100740810&structure=16382&x=3997&y=2293&zoom=0&resolution=0.99&z=6

allensdk.image_to_atlas(100740810,3997,2293,181276165)

#the result says it is on section_image_id=10083770 at 7831,3699
#which is correctly over p2a
#see http://atlas.brain-map.org/atlas?atlas=181276165#atlas=181276165&plate=100883770&structure=16382&x=7831.99560546875&y=3700.004638671875&zoom=0&resolution=2.09&z=7


Out[48]:
{u'id': 0,
 u'msg': {u'image_sync': {u'section_data_set_id': None,
   u'section_image_id': 100883770,
   u'section_number': 130,
   u'x': 7831.975024025194,
   u'y': 3699.6414734399523}},
 u'num_rows': 0,
 u'start_row': 0,
 u'success': True,
 u'total_rows': 0}

In [45]:
allensdk.image_to_reference(100837249,0,0)


url http://api.brain-map.org/api/v2/image_to_reference/100837249.json?x=0.000000&y=0.000000
Out[45]:
{u'id': 0,
 u'msg': {u'image_to_reference': {u'x': -252.62020458000075,
   u'y': 368.6918056779996,
   u'z': 1922.0098100000012}},
 u'num_rows': 0,
 u'start_row': 0,
 u'success': True,
 u'total_rows': 0}

In [ ]: