scieee Open visual document viewer

A Robust Role for Motor Cortex

Lopes, Gonçalo Cardoso

Abstract

The function of mammalian motor cortex has remained a persistent mystery. There is a long history of research linking activity in this part of the brain with the control of voluntary movements but surprisingly there is an equally large body of evidence in non-human animals describing all kinds of complex behaviours that are not impaired when motor cortex is fully removed. What is the reason behind this discrepancy? What kind of movements are actually controlled by motor cortex? This thesis attempts to reconcile the many con icting views on the cortical control of movement and outline a strategy for investigating the teleology of this brain region. We start out by introducing a new set of hardware and software tools for neuroscience that aim to make it easier to study in detail more naturalistic motor behaviours in rodents. These tools allow the experimenter to quickly recon gure the physical and virtual environment of a behaviour task while simultaneously tracking in real-time ne-scale measurements of motor performance. (...)

Full text

Disse a ion p esen ed o ob ain he Ph.D deg ee in Biology | Neu oscience Ins i u o de Tecnologia Química e Biológica An ónio Xa ie | Uni e sidade No a de Lisboa Oei as, Decembe , 2016 Gonçalo C. Lopes A Robus Role o Mo o Co ex Gonçalo C. Lopes Disse a ion p esen ed o ob ain he Ph.D deg ee in Biology | Neu oscience Ins i u o de Tecnologia Química e Biológica An ónio Xa ie | Uni e sidade No a de Lisboa Oei as, Decembe , 2016 A Robus Role o Mo o Co ex Resea ch wo k coo dina ed by: A Robus Role o Mo o Co ex Gonçalo C. Lopes A Disse a ion P esen ed o he Facul y o Uni e sidade No a de Lisboa in Candidacy o he Deg ee o Doc o o Philosophy Supe iso s: Joseph J. Pa on Adam R. Kamp 2016 In lo ing memo y o Kiba Acknowledgmen s An imp essi ely la ge numbe o people ha e accompanied me h ough- ou his jou ney, and o all o hem I am deeply and p o oundly hank ul. All in e ac ions ha e a meaning we can ne e ecognize and hei combined impac ipples in o he u u e unaba ed. This is ue e en i I o ge o publicly acknowledge some o hem, as I'm su e will be he case. The Champalimaud Neu oscience P og amme has been o me a place o deep pe sonal and in ellec ual ans o ma ion. I can ba ely ecognize he pe son ha six yea s ago se ou on he jou ney om compu e science o neu oscience, in igued by he mys e ies o he b ain. The eo s o he ins i u e as a whole o b ing oge he people om widely die en cul- u al and academic backg ounds has c ea ed a nexus in which in e es ing pe sonali ies canno help bu be o ged and empe ed. I will ne e o ge he unique oppo uni y I had o in e ac wi h such a la ge communi y o scien is s om all o e he wo ld, and o discuss nea ly e e y possible opic o my u mos sa is ac ion. These in e ac ions we e always done eely and passiona ely, in he bes spi i o scien ic companionship, wi h no ega d o hie a chy o ank. My  s dedica ion goes o my companions o he In e na ional Neu - oscience Doc o al P og amme, Ca olina Do an, Simone Lackne , Tiago Ma ques, I o Ma celo, B uno Mi anda, Raimundo Leong, and Gus a o Mo eno, who in he yea o 2010 emba ked wi h me on his ad en u e. Toge he we ha e sha ed much mo e han jus ou ini ial aining in neu - oscience. E en hough we all pa ed o pu sue ou own indi idual p ojec s, he e we e many c ucial poin s du ing he jou ney whe e, e en se endip- i ously, we we e s ill able o suppo each o he as pilla s o sani y in he middle o uncon ollable u bulence. I was an honou and a pleasu e o ha e me each one o you and I hope o ha e con ibu ed back a small inkling o all he inspi a ion and admi a ion you ha e p o ided me. ix Financial Suppo The esea ch leading o hese esul s has ecei ed unding om he Eu opean Union's Se en h F amewo k P og amme (FP7/2007-2013) un- de g an ag eemen no. 600925 and he Bial Founda ion (G an 190/12). GL was suppo ed by he PhD S uden ship SFRH/BD/51714/2011 om he Founda ion o Science and Technology, and a Visi ing Resea ch Fellow s ipend om he Sainsbu y Wellcome Cen e o Neu al Ci cui s and Be- ha iou a Uni e si y College London. The Champalimaud Neu oscience P og amme is suppo ed by he Champalimaud Founda ion. x i Con en s Acknowledgemen s ........................ ix Tí ulo e Resumo ..........................xiii Abs ac ............................... x Financial Suppo .........................x i 1 Towa ds a Teleology o Co ical Mo o Con ol 1 1.1 Chap e Summa y ....................... 2 1.2 A Dilemma o Co ical Mo o Con ol . . . . . . . . . . . . 3 1.2.1 Disco e y o he Mo o Co ex . . . . . . . . . . . . 3 1.2.2 The Gol z-Fe ie Deba es . . . . . . . . . . . . . . . 4 1.3 The Role o he Co icospinal T ac . . . . . . . . . . . . . . 8 1.3.1 A Func ional Theo y o he Mo o Co ex . . . . . . 9 1.3.2 The Eec s o Lesions in he Co icospinal T ac . . 13 1.4 An In eg a i e View o he Mo o Sys em . . . . . . . . . . 20 1.4.1 The Coo dina i e Role o Inhibi ion . . . . . . . . . 22 1.4.2 Hie a chical O ganiza ion o Mo o Beha iou . . . . 25 1.5 A S a egy o P obing Co ical Con ol . . . . . . . . . . . 30 1.5.1 Ou line o he Thesis . . . . . . . . . . . . . . . . . . 32 2 Rapid P o o yping Tools o he S udy o Beha iou 47 2.1 Chap e Summa y ....................... 48 2.2 In oduc ion........................... 49 x ii 2.3 Me hods............................. 51 2.3.1 The Modula Beha iou Box . . . . . . . . . . . . . 51 2.3.2 The Bonsai F amewo k . . . . . . . . . . . . . . . . . 55 2.4 Resul s.............................. 71 2.4.1 Ge ing S a ed wi h Bonsai . . . . . . . . . . . . . . 71 2.4.2 Unde he Hood . . . . . . . . . . . . . . . . . . . . 72 2.4.3 Applica ions . . . . . . . . . . . . . . . . . . . . . . . 74 2.5 Discussion............................ 79 2.6 Acknowledgemen s . . . . . . . . . . . . . . . . . . . . . . . 82 2.7 Au ho con ibu ions . . . . . . . . . . . . . . . . . . . . . . 83 3 Mo ing wi h and wi hou Mo o Co ex 87 3.1 Chap e Summa y ....................... 88 3.2 In oduc ion........................... 89 3.3 Me hods............................. 91 3.4 Resul s..............................103 3.5 Discussion............................121 3.6 Acknowledgemen s . . . . . . . . . . . . . . . . . . . . . . . 122 3.7 Au ho con ibu ions . . . . . . . . . . . . . . . . . . . . . . 123 4 Ex ended Discussion 129 4.1 Chap e Summa y .......................130 4.2 A challenge om obo ics . . . . . . . . . . . . . . . . . . . 131 4.3 A p imo dial ole o mo o co ex . . . . . . . . . . . . . . 133 4.4 Implica ions o non-p ima e mammals . . . . . . . . . . . . 133 4.5 Implica ions o p ima e s udies . . . . . . . . . . . . . . . . 134 4.6 Some specula ion on he ole o di ec co ical con ol . . . 135 4.7 Some p elimina y conclusions . . . . . . . . . . . . . . . . . 136 x iii Chap e 1 Towa ds a Teleology o Co ical Mo o Con ol The inni e e ili y o he o ganism as a eld o adap ed eac ions has become mo e appa en . The pu pose o a eex seems as legi ima e and u gen an objec o na u al inqui y as he pu pose o he colou ing o an insec o a blossom. And he impo ance o physiology is, ha he eex eac ion canno be eally in elligible o he physiologis un il he knows i s aim. Si Cha les S. She ing on , The In eg a i e Ac ion o he Ne ous Sys em (1906) 1 1.1 Chap e Summa y Mo o co ex has 150 yea s o conic ing his o y. I was o iginally dened as he pa o co ex whe e mo emen s can be e oked by low-cu en s im- ula ion. S imula ed poin s ac oss he co ical su ace we e ound o be o ganized in o a ough map o he body. A monosynap ic p ojec ion sys- em, he co icospinal ac , was ound o di ec ly link mo o co ex o neu ons in con ala e al spinal co d. The e is a ma ked dec ease in g anu- la laye IV, he main sou ce o inpu s om senso y halamus, ac oss his exci able zone. Lesions o he mo o co ex in humans can cause pa alysis in any limb and pe manen ly dis up he execu ion o basic ac ions such as s anding o walking. Reco dings o neu al ac i i y in mo o co ex co - ela e wi h a ious mo emen pa ame e s. These lines o e idence suppo he idea ha his pa o he b ain di ec ly con ols mo emen . Howe e , lesions o he mo o co ex in non-human animals p ese e mos o he animal's beha iou epe oi e. Sec ioning o he co icospinal ac in p ima es is sucien o eins a e he p ima y eec s o mo o co ical lesions, bu he e a e also as p ojec ions om mo o co ex o o he co ical and sub-co ical a eas, including mul iple disynap ic pa allel descending pa hways o spinal cen e s ia b ains em. In mos mammals, he co icospinal ac does no a ge mo o neu ons in en al spinal co d, as i does in mos p ima es, bu a he spinal in e neu ons. I is clea ha his pa o he b ain is somehow in ol ed in mo emen , bu a la ge numbe o ques ions emain s angely unanswe ed. I mo o co ex is a con olle , wha kind o mo emen s does i con ol? How does i in e ac wi h o he exis ing b ain s uc u es o gene a e beha iou ? Why do mo o co ical lesions p oduce such an appa en ly incomple e eec on mo emen ? This chap e is an a emp o piece oge he all he agmen - a y and con adic o y e idence on mo o co ical s uc u e and physiology in o de o de i e a unied unc ional pic u e o co ical mo o con ol. 2 1.2 A Dilemma o Co ical Mo o Con ol The in ol emen o he b ain and spinal co d in mo o con ol has been ecognized since he ea lies known clinical eco ds on head and spinal in- ju y, da ing back o ancien Egyp (Louis, 1994; an Middendo p, Sanchez & Bu idge, 2010). Howe e , he ole o he ne ous sys em in gene a ing beha iou was no ully app ecia ed un il Gal ani  s epo ed his amous expe imen s on animal elec ici y (Gal ani, 1791). By isola ing he scia ic ne e and gas ocnemius muscle in he og, Gal ani clea ly demons a ed in a se ies o s imula ion expe imen s ha an elec ical p ocess, con ained en i ely wi hin he biology o he og's leg, was esponsible o he spon- aneous gene a ion o muscle con ac ions. This would lead o e he ol- lowing cen u y o he disco e y and physiological cha ac e iza ion o he ne e impulse, he ac ion po en ial, ha a els ac oss he ne e o ini i- a e muscle mo emen (du Bois-Reymond, 1843; Be ns ein, 1868; Schue ze, 1983). The success o hese seminal expe imen s immedia ely aised a undamen al ques ion ega ding ne e conduc ion: i spon aneous muscle con ac ion is gene a ed by ne e impulses ansmi ed h oughou he ne ous sys em, how is his ansmission coo dina ed in o de o gene a e he complex pa e ns o muscle ac i i y obse ed in na u al beha iou ? 1.2.1 Disco e y o he Mo o Co ex In sea ch o answe s o his ques ion, many esea che s looked a he b ain, he sea o ana omical con e gence o he ne ous sys em, o such an in- eg a i e ole. Following Gal ani's oo s eps, se e al a emp s we e made o s imula e he ce eb al co ex elec ically, bu wi h li le success (G oss, 2007). I wasn' un il he 1870s ha he  s indica ions o a di ec in- ol emen o he co ex in he p oduc ion o mo emen came o ligh , a ound he ime when Hughlings Jackson unde wen his s udies on epi- lep ic con ulsions (Jackson, 1870). He obse ed ha in some pa ien s he 3  s would s a by a delibe a e spasm on one side o he body, and ha die en body pa s would become sys ema ically aec ed one a e he o he . He connec ed he o de ly ma ch o hese spasms o he exis ence o localized lesions in he pos -mo em b ain o his pa ien s and hypo hesized ha he o igin o hese  s was uncon olled exci a ion caused by local changes in co ical g ey ma e (Jackson, 1870). In ha same yea , F i sch and Hi zig published hei amous s udy demons a ing ha i is possible o elici mo emen s by di ec s imula ion o he co ex in dogs (F i sch & Hi zig, 1870). Fu he mo e, s imula ion o die en pa s o he co ex p oduced mo emen in die en pa s o he body (F i sch & Hi zig, 1870). I appea ed ha he causal mechanism o epilep ic con ulsions p edic ed by Hughlings Jackson had been ound, and wi h i a possible explana ion o how he no mal b ain migh con ol mo emen . The ce eb al co ex was al eady conside ed a he ime o be he sea o easoning and sensa- ion, so i ac i i y o e his so-called mo o co ex was able o exe di ec con ol o e he whole muscula u e o he body, hen i migh ep esen in he no mal b ain he a ea ha connec s oli ion o muscles (F i sch & Hi zig, 1870). 1.2.2 The Gol z-Fe ie Deba es Da id Fe ie , a Sco ish neu ologis deeply imp essed by he ideas o Hughlings Jackson and by he posi i e esul s o F i sch and Hi zig's ex- pe imen s, p oceeded o ep oduce and expand on hei obse a ions wi h comp ehensi e s imula ion s udies showing how ac i i y in he mo o co - ex was sucien o p oduce a la ge a ie y o mo emen s ac oss a wide ange o mammalian species (Fe ie , 1873). Meanwhile, o he esea ch- e s ac oss Eu ope such as Gol z and Ch is iani we e acing a dilemma: in many o he so-called lowe mammals massi e lesions o he ce eb al co ex ailed o demons a e any isible long- e m impai men s in he mo- o beha iou o animals (James, 1885; Gol z, 1888). These wo lines o 4 inqui y  s clashed a he se en h In e na ional Medical Cong ess held in London in Augus 1881, whe e Gol z o S assbu g and Fe ie o London p esen ed hei esul s in a se ies o deba es on he localiza ion o unc ion in he ce eb al co ex (Phillips, Zeki & Ba low, 1984; Tyle & Malessa, 2000). Gol z assumed a clea an i-localiza ionis posi ion. He ad anced ha i was impossible o p oduce a comple e pa esis o any muscle, o comple e dys unc ion o any pe cep ion, by des uc ion o any pa o he ce eb al co ex, and ha he ound mos ly deci s o gene al in elligence in his dogs (Tyle & Malessa, 2000). Following Gol z's p esen a ion, Fe ie emphas- ized he dange o gene alizing om he dog o animals o o he o de s (e.g. man and monkey). He hen p oceeded o exhibi his own lesion esul s by means o an isep ic su ge y in he monkey, desc ibing how a ci cumsc ibed unila e al lesion o he mo o co ex p oduced comple e con ala e al pa a- lysis o he leg. He also p oduced a s iking se ies o mic oscopic sec ions o Walle ian degene a ion (Walle , 1850) o he mo o pa h om he co ex o he con ala e al spinal co d, he c ossed descending p ojec ions o ming he py amidal co icospinal ac (Tyle & Malessa, 2000). The deba es concluded wi h he public demons a ion o li e specimens: a dog wi h la ge lesions o he pa ie al and pos e io lobes om Gol z; and om Fe ie , a hemiplegic monkey wi h a unila e al lesion o he mo o co ex o he con ala e al side. As p edic ed, Gol z's dog showed a clea abili y o locomo e and a oid obs acles and o make use o i s o he basic senses, while displaying peculia deci s o in elligence such as ailing o espond wi h ea o he c acking o a whip o igno ing obacco smoke blown o i s ace. On he o he hand, Fe ie 's monkey showed up se e ely hemiplegic, in a condi ion simila o human s oke pa ien s. A e he demons a ions, he animals we e killed and hei b ains emo ed. P e- limina y obse a ions e ealed ha he lesions in Gol z's dog we e less ex ensi e han expec ed, pa icula ly on he le hemisphe e. Fe ie 's le- 5 sions on he o he hand we e p ecisely ci cumsc ibed o he con ala e al mo o co ex. These demons a ions secu ed he iumph o Fe ie , who wen on o  mly es ablish he localiza ionis app oach o neu ology and he idea o a soma o opic a angemen o e he mo o co ex. The Gol z-Fe ie deba es had a - eaching implica ions h oughou he en i e esea ch communi y o he ime, and he basic dilemma ha was p esen ed has spa ked con o e sy and con usion o o e a hund ed yea s since (Phillips e al., 1984; Lashley, 1924; de Ba enne, 1933; Tyle & Malessa, 2000; G oss, 2007). In he mean ime, iews o mo o co ex ha e e ol ed o sugges i plays a ole in unde s anding he mo emen s o o he s (Rizzola i & C aighe o, 2004), imagining one's own mo emen s (Po o e al., 1996), o in lea ning new mo emen s (Kawai e al., 2015), bu whe e a e we oday ega ding i s sugges ed p ima y ole in di ec ly con olling mo emen ? S imula ing mo o co ex causes mo emen ; mo o co ex is ac - i e du ing mo emen Mo o co ex is s ill b oadly dened as he egion o he ce eb al hemi- sphe es om which mo emen s can be e oked by low-cu en s imula- ion, ollowing F i sch and Hi zig's o iginal expe imen s in 1870 (F i sch & Hi zig, 1870). S imula ing die en pa s o he mo o co ex elici s mo e- men in die en pa s o he body, and sys ema ic s imula ion su eys ha e e ealed a opog aphical ep esen a ion o he en i e skele al muscu- la u e ac oss he co ical su ace (Ley on & She ing on, 1917; Peneld & Bold ey, 1937; Nea sey e al., 1986). Elec ophysiological eco dings in mo o co ex ha e ou inely ound co ela ions be ween neu al ac i i y and many die en mo emen pa ame e s, such as muscle o ce (E a s, 1968), mo emen di ec ion (Geo gopoulos, Schwa z & Ke ne , 1986), speed (Schwa z, 1993), o e en aniso opic limb mechanics (Sco , G ibble, G a- ham & Cabel, 2001) a he le el o bo h single neu ons (E a s, 1968; 6 Chu chland & Shenoy, 2007) and popula ions (Geo gopoulos e al., 1986; Chu chland e al., 2012). De e mining wha exac ly his ac i i y in mo o co ex con ols (Todo o , 2000) has been u he complica ed by s ud- ies using long s imula ion du a ions in which con inuous s imula ion a a single loca ion in mo o co ex e okes complex, mul i-muscle mo emen s (G aziano, Taylo & Moo e, 2002; Aalo & G aziano, 2006). Howe e , as a whole, hese obse a ions all suppo he long s anding iew ha ac i i y in mo o co ex is in ol ed in he di ec con ol o mo emen . Mo o co ex lesions p oduce die en deci s in die en species Wha ypes o mo emen equi e mo o co ex? In humans, a mo o co - ical lesion is de as a ing. Pe manen inju y o he on al lobes o he b ain by s oke o mechanical means is o en ollowed by weakness o pa alysis o he limbs in he side o he body opposi e o he lesion (Louis, 1994). Al hough he pa e ic symp oms ha e a endency o eco e pa - ially by hemsel es, especially wi h aining and ehabili a ion, pe man- en mo emen deci s and loss o muscle con ol in he aec ed limbs is he common p ognosis; mo emen is pe manen ly and ob iously impai ed (Laplane, Talai ach, Meininge , Bancaud & Boucha eine, 1977; Kwakkel, Kollen, an de G ond & P e o, 2003). In non-human p ima es, sim- ila g oss mo emen deci s a e obse ed a e lesions, albei ansien ly (Ley on & She ing on, 1917; T a is, 1955). The longes las ing eec o a mo o co ical lesion is he dec eased mo ili y o dis al o elimbs, especially in he con ol o indi idual nge mo emen s equi ed o p ecision skills (Ley on & She ing on, 1917; Da ling, Pizzimen i & Mo ec a , 2011). Bu equally imp essi e is he ex en o which o he mo emen s ully eco e , including he abili y o si , s and, walk, climb and e en each o g asp, as long as p ecise nge mo emen s a e no equi ed (Ley on & She ing on, 1917; Da ling e al., 2011; Zaaimi, Edgley, So e opoulos & Bake , 2012). In non-p ima e mammals, he absence o las ing deci s ollowing mo o 7 Tha he py amidal ac s a e in he dog equisi e o oli- ional impulses o each limbs and body seems nega i ed by he ac ha he animal can un, leap, u n o ei he side, use neck and jaws, &c. wi h ease and success a e nea ly, i no wholly, comple e degene a ion o hese ac s on bo h sides. Fu he , a e comple e degene a ion o one py amid, he e is in he dog no ob ious die ence be ween he mo emen s o he igh and le sides. (She ing on, 1885, p.189) In e es ingly, he does no e ha `de ec o mo ion is obse able only as a clumsiness in execu ion o ne mo emen s' (She ing on, 1885). These obse a ions once again s ood ou in s a k con as wi h lesion expe imen s epo ed by Fe ie in he monkey, whe e cau e iza ion o specic mo o co ical a eas p oduced comple e and pe sis en pa alysis o he co es- ponding body pa s (Fe ie & Yeo, 1884). Yea s la e , She ing on would come back o he mo o co ex wi h a new se o landma k s udies on s imula ion and abla ion o he p ecen al egion (G ünbaum & She ing on, 1903; G aham B own & She ing on, 1913; Ley on & She ing on, 1917). In hese s udies oge he wi h G ün- baum, She ing on a ge ed mo o co ical lesions o he exci able a ea o he a m o he leg and acked he eco e y o he animals o e ime. Following he ini ial pa esis and loss o muscle con ol hey obse ed d a- ma ic eco e y o mos skilled mo o ac s, such as peeling open a banana o climbing cages (Ley on & She ing on, 1917). In o de o es whe he he eco e y p ocess was due o co ical eo ganiza ion, hey sys ema ic- ally s imula ed he a eas adjacen o he lesion as well as he mo o co ex o he opposi e hemisphe e, bu ailed o e oke mo emen s in he aec ed limb (Ley on & She ing on, 1917), as would be expec ed i commands we e a eling down he co icospinal ac in spa ed egions. Fu he mo e, subsequen abla ion o hose a eas ailed o p oduce any new impai men s 14 in he eco e ed limb, lea ing She ing on and his colleagues a a loss o nd he locus o eco e y (Ley on & She ing on, 1917). Con used by hese esul s, which hey hough caused conce n o, s u- den s o ce eb al physiology, Glees and Cole in oduced a se o mo e quan i a i e beha iou al assays in he hope o acking in de ail he e- co e y o mo o con ol (Glees & Cole, 1950; Cole, 1952). They s udied he beha iou o monkeys sol ing a ious puzzle boxes ollowing successi e ci cumsc ibed lesions o he humb, index and a m a eas o he mo o co - ex. As She ing on epo ed, he e was a quick eco e y a e an ini ial pe iod o pa alysis and loss o mo o con ol. Howe e , e en hough he monkeys ully eco e ed hei abili y o skill ully open he puzzle box, some sub le mo emen deci s and pa esis in he con ol o ne mo emen s o he digi s was epo ed o pe sis (Glees & Cole, 1950). When s imula - ing mo o co ical a eas su ounding he ci cumsc ibed lesions, hey we e able o e oke mo emen s in he impac ed digi s and eins a e he pa e ic symp oms a e u he abla ion (Glees & Cole, 1950). This sugges ed he hypo hesis ha su ounding a eas o he mo o co ex could unde go eo ganiza ion ollowing he lesion. Howe e , an impo an die ence o emphasize be ween hese expe imen s and hose o She ing on is he ac ha only ela i ely ci cumsc ibed mo o co ical egions we e emo ed in each su ge y, whe eas in he o iginal She ing on s udy he en i e elbow, w is , index, humb and emaining digi mo o a eas we e excised a once (Ley on & She ing on, 1917), mos likely causing degene a ion o he en- i e co icospinal pa hway o he aec ed limb. The p esence o an in ac co icospinal ac , exci abili y o mo emen s o low-cu en s imula ion and ansien pa e ic symp oms ollowing abla ion hus seem o go hand in hand. In he hopes o cla i ying he con usion o which exac mo emen s we e con olled by co ex, o he s udies ocused on lesions es ic ed o he co - icospinal ac , using bo h unila e al and bila e al sec ion a he le el 15 o he medulla y py amids (Towe , 1940; Law ence & Kuype s, 1968a; Law ence & Kuype s, 1968b). The goal was o isola e he eec s o all he indi idual descending pa hways o he spinal co d and esol e once and o all he ques ion o whe he he co icospinal ac o he mo o co ex was he sou ce o all  olun a y mo emen s. Sa ah Towe was he  s o desc ibe in de ail he esul s o unila e al and bila e al py amido omy in p ima es, wi h and wi hou lesion o he mo o co ex (Towe , 1940). She summa ized he condi ion as hypo onic pa esis, cha ac e ized by a loss o skele al muscle one and dep ession o he asomo o sys em, along wi h gene al weakening o he eexes in ol ing he aec ed limb segmen s. Al- hough all disc e e usage o he hand and digi s was elimina ed, she did emphasize he clea p esence o olun a y mo emen s in he a ious pu - pose ul compensa ions p oduced by he animals o deal wi h he aic ion. Towe a ibu ed hese compensa ions o he p ese ed capaci ies o b ain- s em ci cui s. A mo e deni i e s udy o dissocia e he eec s o di ec co icospinal and indi ec b ains em descending pa hways was conduc ed by Law ence and Kuype s, and p esen ed in hei now classical publica ions (Law ence & Kuype s, 1968a; Law ence & Kuype s, 1968b). Using he Klü e boa d, a ask whe e monkeys ha e o pick mo sels o ood om die en ly sized ound holes, hey obse ed ha while no mal monkeys ou inely pick up he ood by pinching indi idual bi s wi h hei nge s, monkeys wi h bila - e al co icospinal lesions we e mos ly unable o pe o m his p ecise pince mo emen , and ins ead employed coa se compensa o y clasping s a egies o e ie e he ood (Law ence & Kuype s, 1968a). In addi ion, lesioned monkeys we e consis en ly epo ed o be somewha slowe and less agile han no mal animals. Howe e , mos o hei o e all mo emen epe oi e was su p isingly p ese ed. Thei nal conclusions  ema kably well wi h he ini ial obse a ions o She ing on in he dog, sugges ing ha he co icospinal pa hways supe impose speed and agili y on subco ical 16 mechanisms, and p o ide he capaci y o ac iona ion o mo emen s such as independen nge mo emen s (Law ence & Kuype s, 1968a). These obse a ions ecapi ula e he eec s o mo o co ical lesions epo ed by She ing on, bu emain a odds wi h he p ima y s a ed ole in ol ing mo o co ex, and he di ec co icospinal ac , wi h he con ol o all olun a y mo emen s. The e a e ana omical die ences in co icospinal p ojec ions be ween p ima es and o he mammals In p ima es, he conspicuous eec s o mo o co ical lesion can also be induced by sec ioning he co icospinal ac , he di ec monosynap ic p o- jec ion ha connec s mo o co ex, and o he co ical egions, o he spinal co d (Towe , 1940; Law ence & Kuype s, 1968a). In monkeys, and sim- ila ly in humans, his pa hway has been ound o di ec ly e mina e on spinal mo o neu ons esponsible o he con ol o dis al muscles (Ley on & She ing on, 1917; Be nha d & Bohm, 1954) and is also hough o sup- po he low-cu en mo emen esponses e oked by elec ical s imula ion o he co ex, as e idenced by he inc eased dicul y in ob aining a s imu- la ion esponse ollowing sec ion a he le el o he medulla (Woolsey e al., 1972). Howe e , he co icospinal ac is by no means he only pa hway om co ex o mo emen (Figu e 1.2). Mo o co ex a ge s many o he b ain egions ha can hemsel es gene a e mo emen . In ac , his specialized connec ion om elencephalon o spinal co d appea ed only ecen ly in e eb a e e olu ion ( en Donkelaa , 2009), and was u he elabo a ed o include a di ec connec ion om co ex o mo o neu ons only in some p ima e species and o he highly manipula i e mammals such as accoons (Hene & Mas e on, 1983). In all o he mammals, including ca s and a s, he e mina ion pa e n o he co icospinal ac la gely a oids he mo o neu on pools in en al spinal co d and concen a es ins ead on 17 in e media e zone in e neu ons and do sal senso y neu ons (Kuype s, 1981; Yang & Lemon, 2003). Why hen is he e such a la ge dependency on his ac o human mo o con ol? One possibili y is ha he ub ospinal ac a descending pa hway o igina ing in he b ains em and e mina ing in he in e media e zoneis degene a ed in humans compa ed o o he p ima es and mammals (Na han & Smi h, 1955, 1982), and is hough o play a ole in compensa ing o he loss o he co icospinal ac in non-human species (Law ence & Kuype s, 1968b; Zaaimi e al., 2012). I hus seems likely ha mos mammals ely on indi ec  pa hways o con ey co ical mo o commands o muscles. These die ences in ana omy migh explain he lack o conspicuous, las ing mo emen deci s ollow- ing mo o co ical lesion in non-p ima es, bu lea es behind a signican ques ion: wha is he mo o co ex ac ually con olling in all hese o he mammals? Wha is he ole o mo o co ex in non-p ima e mammals? In he a , a la ge po ion o co ex is conside ed mo o  based on ana- omical (Donoghue & Wise, 1982), s imula ion (Donoghue & Wise, 1982; Nea sey e al., 1986) and elec ophysiological e idence (Hyland, 1998). Howe e , he mos consis en ly obse ed long- e m mo o con ol deci ollowing mo o co ical lesion has been an impai men in supina ion o he w is and indi idua ion o digi s du ing g asping, which in u n impai s eaching o ood pelle s h ough a na ow e ical sli (Whishaw e al., 1991; Ala e dash ili & Whishaw, 2008). Despi e he ac ha ac i i y in oden mo o co ex has been co ela ed wi h mo emen s in e e y pa o he body (no jus dis al limbs) (Hill, Cu is, Moo e & Klein eld, 2011; E lich, Bialek & B ody, 2011), i would appea we a e led o conclude ha his la ge high-le el mo o s uc u e, wi h dense ee en p ojec ions o mo o a eas in he spinal co d (Kuype s, 1981), basal ganglia (Tu ne & DeLong, 2000; Wu, Co win & Reep, 2009), halamus (Lee, Ca ell & 18 ~ 110BmillionByea s ~ 560BmillionByea s Human Fo eb ain In e b ain Midb ain SpinalBco d Hindb ain Mo o Pallium S ia um Thalamus Tec um MLR Ce ebellum B ains em Do sal Ven al MM Roden Mo o Pallium S ia um Thalamus Tec um MLR Ce ebellum B ains em Do sal Ven al MM Lamp ey Mo o Pallium S ia um Thalamus Tec um MLR Ce ebellum B ains em ? Do sal Ven al MM Figu e 1.2. Fo eb ain mo o con ol pa hways ac oss die en e eb a e axa. The molecula di e gence imes be ween human (p ima e), oden and lamp ey g oups (Kuma & Hedges, 1998) a e no ed abo e a schema ic iew o he majo di isions in he e eb a e b ain. A ows indica e he descending monosynap ic p ojec ions iden ied in each g oup om mo o egions o he o eb ain pallium o lowe mo o cen es. No e he special- ized monosynap ic p ojec ion di ec ly a ge ing spinal mo o neu ons in human. MLR, Mesencephalic Locomo o Region; M, Mo o Neu ons. 19 Simons, 2008), ce ebellum (Bake , Ja id & Edgley, 2001) and b ains em (Ja a & Hyland, 1999), as well as o mos p ima y senso y a eas (Pe - eanu e al., 2012; Schneide , Nelson & Mooney, 2014), e ol ed simply o acili a e mo e p ecise w is o a ions and g asping ges u es. Maybe we a e missing some hing. Migh he e be o he p oblems in mo emen con- ol ha mo o co ex is sol ing, bu ha we may be o e looking wi h ou cu en assays? 1.4 An In eg a i e View o he Mo o Sys em A die en app oach o he p oblems o mo o con ol de eloped ini ially om s udies on he in eg a ion o spinal eexes conduc ed by he She ing- on school. While many esea che s con inued o look o he in eg a ion o complex mo emen s in highe b ain s uc u es like he mo o co ex, She - ing on u ned ins ead o sys ema ically cha ac e izing ana omically and physiologically he dis ibu ion o ee en (She ing on, 1892) and ae - en (She ing on, 1893a) ne e oo s in he spinal co d o mul iple species. His goal was o shed ligh on he so-called eex a c , he ne e pa hways in ol ed in muscula eac ions like he knee-je k whe eby simple senso y s imuli elici an immedia e, au oma ic esponse om he animal, e en in he absence o highe b ain inpu (She ing on, 1893b). She ing on and his con empo a ies s udied in de ail a numbe o long and sho spinal eexes 3 in a a ie y o model o ganisms unde die en le els o anes hesia, pha macological manipula ions and spinal anssec ion (She ing on & Lasle , 1903). This sys ema ic app oach made abundan ly clea a numbe o ac s abou how he ne ous sys em o ganizes mo o beha iou . 3 A eex ac ion in which a s imulus applied o one egion elici s a esponse in ano he egion is e med a long spinal eex, whe eas a eex eac ion whe e he muscula esponse happens in he same egion as he s imulus is e med a sho spinal eex. 20 The  s one, and pe haps he mos s iking, is ha complex mo o esponses can be in eg a ed and coo dina ed e en in he comple e absence o he b ain (She ing on, 1906). While he exis ence o au oma isms and xed ac ion pa e ns had been ecognized since an iqui y, sys ema ic s im- ula ion s udies in dece eb a e animals quickly e ealed ha he eex was a om being a igid and xed en i y, bu was a he adap i e and dy- namic. In pa icula , eex ci cui s e ealed a much wide ange o e- sponse cha ac e is ics han ne e be s, which we e well known since he ime o Gal ani o exhibi comple e s e eo ypy in hei esponse o a s im- ulus unde a ious condi ions 4 . Indeed, he mo o ou pu p oduced by he massi ely simplied spinal ci cui s was ema kably o ganized and displayed clea e hological mean- ing: adap i e beha iou s such as sc a ching (She ing on & Lasle , 1903), shaking (Gol z & Ewald, 1896; She ing on & Lasle , 1903) o eex s ep- ping and s anding (She ing on, 1910; She ing on, 1915) we e all a ailable o be elici ed om s imula ion o he isola ed spinal sys em. S ikingly, hese eexes we e also shown o be deployed and modula ed app op i- a ely o specic s imuli. The sc a ch eex, o example, ca ies he oo oughly o he place o s imula ion (She ing on, 1904), and in eex s ep- ping he animal can main ain a hy hmic ma ch h ough all phases o locomo ion o e unobs uc ed su aces (She ing on, 1910). In eg a ion o hese eexes wi h inpu om he ele ecep o s is ob iously en i ely ab- sen , bu hese obse a ions cla ied, beyond any easonable doub , ha spinal co d ci cui s alone a e sucien o p oduce and sus ain en i e beha- iou sequences unde he igh condi ions. Fu he mo e, deae en a ion expe imen s showed ha aspec s o hese hy hmic ne wo k mo i s pe sis 4 Some unique esponse cha ac e is ics o eex a c conduc ion include i e e sibili y o he di ec ion o conduc ion; a igabili y and e ac o y pe iod; g ea e a iabili y o h eshold; empo al acili a ion wi h successi e s imuli; a weake co espondence o end-eec wi h in ensi y and equency o he s imulus; and a g ea e suscep ibili y o me abolic and pha macological manipula ions (She ing on, 1906, p.14) 21 e en in he absence o senso y inpu (G aham B own, 1911). Many o hese eex ci cui s we e la e e med cen al pa e n gene a o s , o CPGs (G illne & Zangge , 1975; G illne , 1981), and ound o be p esen ac oss bo h e eb a e and in e eb a e species (O lo sky, Deliagina & G illne , 1999; Sel e s on, 2010). 1.4.1 The Coo dina i e Role o Inhibi ion One o he aspec s o spinal eexes ha mos deeply imp essed She ing- on was he gene al capaci y o eex ci cui s o ini ia e and swi ch be ween concu en esponses despi e he exis ence o a nal common pa h om he ne ous sys em o muscles (She ing on, 1904). Mo o neu ons in he spinal co d send hei axons h ough he en al oo s o spinal segmen s o synapse di ec ly on muscle b es. F om his expe imen s, She ing on showed ha i was common o nd mul iple mo o neu ons pa icipa ing syne gis ically o an agonis ically in a single coo dina ed eex esponse. Mo e impo an ly, he e ealed ha he same mo o neu ons we e ac ually sha ed among mul iple, po en ially conic ing, eex a cs. She ing on was ascina ed by he ac ha hese an agonis ic eexes, ini ia ed sim- ul aneously om dis inc senso y ecep o s, we e s ill ound o be able o coo dina e hei inuence despi e sha ing his nal common pa h o muscles. Tha such coo dina ion exis ed was made clea by s imula ion expe imen s whe e wo o mo e eexes we e elici ed a he same ime, gene a ing muscle esponses o he combined s imula ion ha we e no a simple summa ion o linea combina ion o he esponses ob ained by s imula ion deli e ed in isola ion. She ing on desc ibes he concep ion clea ly: Take he p ima y e inal eex, which mo es he eye so as o b ing he o ea o he si ua ion o he s imula ing image. F om all he ecep o s in each la e al e inal hal ise eex 22 a cs wi h a nal common pa h in he ne e o he opposi e ec us la e alis . Suppose simul aneous s imula ion o wo o hese e inal poin s, one nea e o, one a he om, he o ea. I he a cs o bo h poin s pou hei impulses in o he nal common pa h oge he , he eec mus be a esul an o he wo discha ges. I hese sum, he sho ening o he muscle will be oo g ea and he o ea swing oo a o ei he poin . I he esul an be a comp omise be ween he wo indi idual poin s, he o ea will come o lie be ween he wo poin s o s imula ion. In bo h cases he esul ob ained would be useless o he pu poses o ei he .... When wo s imuli a e applied simul aneously which would e oke eex ac ions ha employ he same nal common pa h in die en ways, in my expe ience one eex appea s wi hou he o he . The esul is his eex o ha eex, bu no he wo oge he . (She ing on, 1904, p.461) In She ing on's ime he exis ence o such common pa hs was a p ob- lem o he classic iew o eex con ol, whe e he unc ion o he ne ous sys em was concei ed in e ms o ne e conduc ion o exci a o y impulses. The exis ence o he nal common pa h media ing mul iple eexes made i necessa y o speak openly o he p oblem o how o coo dina e die en ci cui elemen s and o desc ibe mechanisms ha would allow he same neu ons o ake on con ex -dependen oles in gene a ing mo o esponses. I was du ing he hun o such a mechanism o eex a c coo dina ion ha She ing on hi upon he undamen al ole o inhibi ion in he o gan- iza ion o neu al unc ion. Inhibi ion had always been a complica ed opic o physiologis s, bu ollowing he demons a ion o ca diac muscle inhibi- ion by he agus ne e (Webe , 1846), and Secheno 's g and p oposal o a cen al o igin o eex inhibi ion (Secheno , 1863), She ing on was able o 23 Kably & La oie, 1996). These obse a ions sugges ha mo o co ex neu ons a e necessa y o p ecise s epping and adjus men o ongoing loco- mo ion o changing condi ions. Howe e , long- e m eec s seem o equi e comple e lesion o bo h he co icospinal and ub ospinal ac s (D ew e al., 2002). E en in hese animals, he olun a y ac o s epping o e an obs acle does no disappea en i ely, and mo eo e , hey can adap o changes in he heigh o he obs acles (D ew e al., 2002). Specically, e en hough hese animals ne e egain he abili y o g ace ully clea an obs acle, when aced wi h a highe obs acle, hey a e able o adjus hei s epping heigh in such a way ha would ha e allowed hem o com o - ably clea he lowe obs acle (D ew e al., 2002). Fu he mo e, deci s caused by lesions es ic ed o he py amidal ac seem o disappea o e ime (Liddell & Phillips, 1944), and a e mos clea ly isible only he  s ime an animal encoun e s a new obs acle (Liddell & Phillips, 1944). The iew ha mo o co ex in non-p ima e mammals is p incipally esponsible o adjus ing ongoing mo emen pa e ns gene a ed by lowe b ain s uc u es is appealing. Wha is his modula ion good o ? Wha does i allow an animal o achie e? How can we assay i s necessi y? 1.5 A S a egy o P obing Co ical Con ol I should now be clea ha he in ol emen o mo o co ex in he di ec con ol o all  olun a y mo emen  is human-specic. The e is a ole o mo o co ex ac oss mammals in he con ol o p ecise mo emen s o he ex emi ies, especially hose equi ing indi idual mo emen s o he nge s, bu hese eec s a e sub le in non-p ima e mammals. Fu he mo e, wha would be a de as a ing impai men o humans may no be so se e e o mammals ha do no depend on p ecision nge mo emen s o su i al. The e o e, gene alizing his specic ole o mo o co ex om humans o all o he mammals would be misleading. We could be missing ano he , mo e 30 p imo dial ole o his s uc u e ha p edomina es in o he mammals, and by doing so, we may also be missing an impo an ole in humans. The p oposal ha mo o co ex induces modica ions o ongoing mo e- men syne gies, p omp ed by he elec ophysiological s udies o ca loco- mo ion, deni ely poin s o a ole consis en wi h he esul s o a ious lesion s udies. Howe e , in assays used, he abili y o modi y ongoing mo emen gene ally eco e s a e a mo o co ical lesion. Wha a e he en i onmen al si ua ions in which mo o co ical modula ion is mos use- ul? Co ex has long been p oposed o be he s uc u e esponsible o in- eg a ing a ep esen a ion o he wo ld and imp o ing he p edic i e powe o his ep esen a ion wi h expe ience (Ba low, 1985; Doya, 1999). I mo- o co ex is he means by which hese ep esen a ions can gain inuence o e he body, howe e sub le and modula o y, can we nd si ua ions (i.e. asks) in which his co ical con ol is equi ed? The necessi y o co ex o a ious beha iou al asks has been ac i ely in es iga ed in expe imen al psychology o o e a cen u y, including he ounda ional wo k o Ka l Lashley and his s uden s (Lashley, 1921, 1950). In he a , la ge co ical lesions we e ound o p oduce li le o no impai - men in mo emen con ol, and e en deci s in lea ning and decision mak- ing abili ies we e dicul o demons a e consis en ly o e epea ed i- als. Howe e , Lashley did no ice some e idence ha co ical con ol may be in ol ed in pos u al adap a ions o unexpec ed pe u ba ions (Lashley, 1921). These s udies once again seem o ecapi ula e he wo mos consis - en obse a ions ound ac oss he en i e mo o co ical lesion li e a u e in non-p ima e mammals since Hi zig (F i sch & Hi zig, 1870), Gol z (Gol z, 1888), She ing on (She ing on, 1885) and o he s (Oakley, 1979; Te y e al., 1989). One, di ec olun a y con ol o e mo emen is mos deni ely no abolished h ough lesion; and wo, ce ain aspec s o some mo emen s a e deni ely impai ed, bu only unde ce ain challenging si ua ions. The 31 la e a e o en epo ed only anecdo ally. I was his collec ion o in- iguing obse a ions in animals wi h mo o co ical lesions ha p omp ed us o expand he scope o s anda d labo a o y asks o include a b oade ange o mo o con ol challenges ha b ains encoun e in hei na u al en i onmen s. 1.5.1 Ou line o he Thesis In his wo k, an a emp o delinea e a new ole o mo o co ex is epo - ed. As many p e ious eo s, i s a s wi h beha iou , and he ealiza ion ha con olled exposu e o animals o a wide ange o en i onmen s is o absolu e necessi y o gain insigh in o he eleology o he sys em. To his end, we ha e de eloped new ools o make i easie o su ey a la ge ange o en i onmen s while eco ding as many ne scale measu es o be- ha iou and physiology as possible. These echnical and me hodological de elopmen s a e desc ibed in Chap e 2. In Chap e 3, a se o beha iou and lesion s udies is epo ed in he a . These s udies had he goal o p obing he limi s o eco e y ollow- ing ex ensi e co ical lesions by exposing animals o mo e challenging and dynamic en i onmen s. De ailed analysis o he momen by momen be- ha iou o lesioned animals e ealed a numbe o in iguing obse a ions, he implica ions o which we discuss in Chap e 4. 32 Re e ences Aalo, T. N. & G aziano, M. S. A. (2006). Possible o igins o he com- plex opog aphic o ganiza ion o mo o co ex: educ ion o a mul- idimensional space on o a wo-dimensional a ay. The Jou nal o neu oscience : he ocial jou nal o he Socie y o Neu oscience , 26 (23), 628897. doi:10.1523/JNEUROSCI.0768-06.2006 Ala e dash ili, M. & Whishaw, I. Q. (2008). Mo o co ex s oke im- pai s indi idual digi mo emen in skilled eaching by he a . The Eu opean jou nal o neu oscience , 28 (2), 31122. doi:10.1111/j.1460- 9568.2008.06315.x A ms ong, D. M. & D ew, T. (1984). Discha ges o py amidal ac and o he mo o co ical neu ones du ing locomo ion in he ca . The Jou nal o Physiology , 346 , 471495. Ashby, W. R. (1960). Design o a b ain: The o igin o adap i e beha io . New Yo k: Wiley. Bake , M. R., Ja id, M. & Edgley, S. A. (2001). Ac i a ion o ce ebella climbing b es o a ce ebella pos e io lobe om mo o co ical ou pu pa hways. Jou nal o Physiology , 536 (3), 825839. doi:10. 1111/j.1469-7793.2001.00825.x Ba low, H. (1985). Ce eb al co ex as model builde . Models o he isual co ex , (1985), 3746. Be nha d, C. G. & Bohm, E. (1954). Co ical ep esen a ion and unc ional signicance o he co icomo oneu onal sys em. A chi es o Neu o- logy And Psychia y , 72 (4), 473502. doi:10.1001/a chneu psyc.1954. 02330040075006 Be ns ein, J. (1868). Uebe den zei lichen Ve lau de nega i en Schwankung des Ne ens oms. Püge s A chi , 1 , 173207. doi:10 . 1007 / BF01640316 33 Be z, W. (1874). Ana omische Nachweis zweie Gehi ncen a. Cen albla ü die medizinischen Wissenscha en , 12 , 57880, 59599. Bju s en, L. M., No sell, K. & No sell, U. (1976). Beha iou al epe o y o ca s wi hou ce eb al co ex om in ancy. Expe imen al b ain e- sea ch , 130 (2857), 115130. B odmann, K. (1909). Localisa ion in he Ce eb al Co ex . Sp inge . doi:10. 1097/00005053-191012000-00013 B ösamle, C. & Schwab, M. E. (2000). Ipsila e al, en al co icospinal ac o he adul a : Ul as uc u e, myelina ion and synap ic con- nec ions. Jou nal o Neu ocy ology , 29 , 499507. doi:10.1023/A: 1007297712821 Campbell, A. W. (1905). His ological s udies on he localisa ion o ce eb al unc ion . Chu chland, M. M. & Shenoy, K. V. (2007). Tempo al complexi y and he e ogenei y o single-neu on ac i i y in p emo o and mo o co ex. J Neu ophysiol , 97 (6), 42354257. doi:10.1152/jn.00095.2007 Chu chland, M. M., Cunningham, J. P., Kau man, M. T., Fos e , J. D., Nuyujukian, P., Ryu, S. I. & Shenoy, K. V. (2012). Neu al popula ion dynamics du ing eaching. Na u e , 487 (7405), 516. doi:10.1038/ na u e11129 Cla k, S. L. & Wa d, J. W. (1937). Elec ical s imula ion o he co ex ce eb i o ca s. A ch Neu Psych , 38 (5), 927943. Cla ke, E. & O'Malley, C. (1996). The Human B ain and Spinal Co d: A His o ical S udy Illus a ed by W i ings om An iqui y o he Twen- ie h Cen u y . No man Publishing. Cole, J. (1952). Th ee es s o he s udy o mo o and senso y abili ies in monkeys. Jou nal o Compa a i e and Physiological Psychology , 45 (3), 226230. Da ling, W. G., Pizzimen i, M. A. & Mo ec a , R. J. (2011). Func ional e- co e y ollowing mo o co ex lesions in non-human p ima es: expe i- 34 men al implica ions o human s oke pa ien s. Jou nal o In eg a i e Neu oscience , 10 (3), 353384. doi:10.1142/S0219635211002737 de Ba enne, J. G. D. (1933). "Co icaliza ion" o unc ion and unc- ional localiza ion in he ce eb al co ex. A chi es o Neu ology And Psychia y , 30 (4), 884901. doi:10.1001/a chneu psyc.1933. 02240160196012 Donoghue, J. & Wise, S. P. (1982). The mo o co ex o he a : cy oa chi- ec u e and mic os imula ion mapping. The Jou nal o compa a i e neu ology , 212 (1), 7688. doi:10.1002/cne.902120106 Doya, K. (1999). Wha a e he compu a ions o he ce ebellum, he basal ganglia and he ce eb al co ex? Neu al ne wo ks : he ocial jou nal o he In e na ional Neu al Ne wo k Socie y , 12 (7-8), 961974. D ew, T., Jiang, W., Kably, B. & La oie, S. (1996). Role o he mo o co - ex in he con ol o isually igge ed gai modica ions. Canadian jou nal o physiology and pha macology , 74 (4), 42642. D ew, T., Jiang, W. & Widajewicz, W. (2002). Con ibu ions o he mo o co ex o he con ol o he hindlimbs du ing locomo ion in he ca . B ain esea ch. B ain esea ch e iews , 40 (1-3), 17891. du Bois-Reymond, E. (1843). Vo läuge Ab iss eine Un e suchung übe den sogenann en F oschs om und übe die elek omo o ischen Fische. Annalen de Physik und Chemie , 58 , 130. E lich, J. C., Bialek, M. & B ody, C. D. (2011). A co ical subs a e o memo y-guided o ien ing in he a . Neu on , 72 (2), 33043. doi:10. 1016/j.neu on.2011.07.010 E a s, E. V. (1968). Rela ion o py amidal ac ac i i y o o ce exe ed du ing olun a y mo emen . Jou nal o neu ophysiology , 31 (1), 14 27. Fe ie , D. (1873). Expe imen al Resea ches in Ce eb al Physiology and Pa hology. Jou nal o ana omy and physiology , 8 (P 1), 1525. doi:10.1136/bmj.1.643.457 35 Fe ie , D. & Yeo, G. (1884). A Reco d o Expe imen s on he Eec s o Lesion o Die en Regions o he Ce eb al Hemisphe es. Philo- sophical T ansac ions o he Royal Socie y o London (1776-1886) , 175 (Janua y), 479564. Fo ssbe g, H., G illne , S. & Rossignol, S. (1975). Phase dependen eex e e sal du ing walking in ch onic spinal ca s. B ain Resea ch , 85 (1), 103107. doi:10.1016/0006-8993(75)91013-6 Fos e , M. & She ing on, C. S. (1897). A ex book o physiology (7 h). London: Macmillan. F i sch, G. & Hi zig, E. (1870). Übe die elek ische e egba kei des g oss- hi ns. A chi u Ana omie, Physiologie und Wissenscha liche , 37 , 300332. Gal ani, L. (1791). De i ibus elec ici a is in mo u muscula is com- men a ius. De Bononiensi Scien ia um e A ium Ins i u o a que Academia Commen a ii , 7 , 363418. doi:10 . 1097 / 00000441 - 195402000-00023 Geo gopoulos, A., Schwa z, A. & Ke ne , R. (1986). Neu onal popula ion coding o mo emen di ec ion. Science , 233 (4771), 14161419. doi:10. 1126/science.3749885 Glees, P. & Cole, J. (1950). Reco e y o skilled mo o unc ions a e small epea ed lesions in mo o co ex in macaque. J Neu ophysiol. 13 (2), 137148. Gol z, F. (1888). Übe die e ich ungen des g osshi ns. Püge s A chi gesam e Physiologie des Menschen und de Tie e , 42 , 419467. Gol z, F. & Ewald, J. R. (1896). De Hund mi e kü z em Rückenma k. Püge 's A chi ü die gesam e Physiologie des Menschen und de Tie e , 63 (7), 362400. G aham B own, T. & She ing on, C. S. (1912). On he Ins abili y o a Co ical Poin . P oceedings o he Royal Socie y B: Biological Sci- ences , 85 (July), 250277. doi:10.1098/ spb.1912.0050 36 G aham B own, T. (1911). The In insic Fac o s in he Ac o P og es- sion in he Mammal. P oceedings o he Royal Socie y B: Biological Sciences , 84 (572), 308319. doi:10.1098/ spb.1911.0077. a Xi : NIHMS150003 G aham B own, T. & She ing on, C. S. (1913). No e on he unc ions o he co ex ce eb i. Jou nal o Physiology , 46 (suppl), xxii. G aziano, M. S. A., Taylo , C. S. R. & Moo e, T. (2002). Complex Mo e- men s E oked by Mic os imula ion o P ecen al Co ex. Neu on , 34 , 841851. G illne , S. & Shik, M. L. (1973). On he descending con ol o he lum- bosac al spinal co d om he "mesencephalic locomo o egion". Ac a Physiol Scand. 87 (0001-6772), 320333. G illne , S. & Zangge , P. (1975). How de ailed is he cen al pa e n gen- e a ion o locomo ion? B ain Resea ch , 88 (2), 367371. doi:10.1016/ 0006-8993(75)90401-1 G illne , S. (1981). Con ol o locomo ion in bipeds, e apods, and sh. Handbook o Physiology, The Ne ous Sys em II , 11791236. doi:10. 1002/cphy.cp010226 G oss, C. G. (2007). The disco e y o mo o co ex and i s backg ound. Jou nal o he his o y o he neu osciences , 16 (3), 32031. doi:10. 1080/09647040600630160 G ünbaum, A. S. F. & She ing on, C. S. (1903). Obse a ions on he Physiology o he Ce eb al Co ex o he An h opoid Apes. P oceed- ings o he Royal Socie y o London , 72 (477-486), 152155. doi:10. 1098/ spl.1903.0033 Hebb, D. O. (1949). The O ganiza ion o Beha io : A Neu opsychological Theo y . New Yo k: Wiley. Hene , R. S. & Mas e on, R. B. (1983). The ole o he co icospinal ac in he e olu ion o human digi al dex e i y. B ain, beha io and e olu ion , 23 , 165183. 37 Hill, D. N., Cu is, J. C., Moo e, J. D. & Klein eld, D. (2011). P ima y mo o co ex epo s ee en con ol o ib issa mo ion on mul iple imescales. Neu on , 72 (2), 344356. doi:10.1016/j.neu on.2011.09. 020. a Xi : NIHMS150003 Hyland, B. (1998). Neu al ac i i y ela ed o eaching and g asping in os al and caudal egions o a mo o co ex. Beha iou al B ain Resea ch , 94 (2), 255269. doi:10.1016/S0166-4328(97)00157-5 Jackson, J. H. (1870). A s udy o con ulsions. T ansac ions o he Sain And ews Medical G adua es Associa ion , 3 , 162204. doi:10.1001/ a chneu .1970.00480200090012 James, W. (1885). Localiza ion o unc ions in he b ain. Science , 6 (143), 379380. doi:10.1126/science.ns-6.143.379 Ja a , H. & Hyland, B. (1999). Neu onal ac i i y in a ed nucleus du ing o elimb each- o-g asp mo emen s. Neu oscience , 88 (2), 629642. doi:10.1016/S0306-4522(98)00227-9 Kawai, R., Ma kman, T., Podda , R., Ko, R., Fan ana, A. L., Dhawale, A. K., Kamp, A. R. & Öl eczky, B. P. (2015). Mo o Co ex Is Requi ed o Lea ning bu No o Execu ing a Mo o Skill. Neu on , 113. doi:10.1016/j.neu on.2015.03.024 Kuma , S. & Hedges, S. (1998). A molecula imescale o e eb a e e ol- u ion. Na u e , 392 , 917920. Kushchaye , S. V., Moskalenko, V. F., Wiene , P. C., Tsymbaliuk, V. I., Che kaso , V. G., Dzya ulska, I. V., Ko alchuk, O. I., Sonn ag, V. K. H., Spe zle , R. F. & P eul, M. C. (2012). The disco e y o he py amidal neu ons: Vladimi Be z and a new e a o neu oscience. B ain , 135 (1), 285300. doi:10.1093/b ain/aw 276 Kuype s, H. G. J. M. (1981). Ana omy o he descending pa hways. Com- p ehensi e Physiology , 597666. Kwakkel, G., Kollen, B. J., an de G ond, J. & P e o, A. J. (2003). P ob- abili y o Regaining Dex e i y in he Flaccid Uppe Limb: Impac o 38 Se e i y o Pa esis and Time Since Onse in Acu e S oke. S oke , 34 (9), 21812186. doi:10.1161/01.STR.0000087172.16305.CD Lac oix, S., Ha on, L. a., McKay, H., Yang, H., B an , A., Robe s, J. & Tuszynski, M. H. (2004). Bila e al co icospinal p ojec ions a ise om each mo o co ex in he macaque monkey: a quan i a i e s udy. The Jou nal o compa a i e neu ology , 473 (2), 147161. doi:10.1002/ cne.20051 Langley, J. N. & She ing on, C. S. (1884). Seconda y Degene a ion o Ne e T ac s ollowing emo al o he Co ex o he Ce eb um in he Dog. Jou nal o Physiology , 5 (2), 4965. doi:10.1113/jphysiol.1884. sp000151 Laplane, D., Talai ach, J., Meininge , V., Bancaud, J. & Boucha eine, A. (1977). Mo o consequences o mo o a ea abla ions in man. Jou nal o he Neu ological Sciences , 31 (1), 2949. doi:10 . 1016 / 0022 - 510X(77)90004-1 Lashley, K. S. (1921). S udies o ce eb al unc ion in lea ning. III. The mo o a eas. B ain , 44 , 255285. doi:10.1037/h0070668 Lashley, K. S. (1924). S udies o ce eb al unc ion in lea ning: V. The e en ion o mo o habi s a e des uc ion o he so-called mo o a eas in p ima es. A chi es o Neu ology and Psychia y , 12 (3), 249 276. doi:10.1001/a chneu psyc.1924.02200030002001 Lashley, K. S. (1950). In sea ch o he eng am. Symposia o he Socie y o Expe imen al Biology . Law ence, D. G. & Kuype s, H. G. J. M. (1968a). The unc ional o ganiz- a ion o he mo o sys em in he monkey. I. The eec s o bila e al py amidal lesions. B ain , 91 (1), 114. Law ence, D. G. & Kuype s, H. G. J. M. (1968b). The unc ional o gan- iza ion o he mo o sys em in he monkey. II. The eec s o lesions o he descending b ain-s em pa hways. B ain , 91 (1), 1536. 39 Chap e 2 Rapid P o o yping Tools o he S udy o Beha iou I is no ue ha  he labo a o y can ne e be like li e. The labo a o y mus be like li e! James J. Gibson , The Ecological App oach o Visual Pe cep ion (1979) 47 2.1 Chap e Summa y The s udy o animal beha iou has p o ided emendous insigh in o he unc ions o he b ain. Howe e , in he labo a o y, beha iou is o en s ud- ied in impo e ished and epe i i e egimes in o de o con ol i s complex- i y. In his chap e , we in oduce a se o ha dwa e and so wa e ools ha make i easie o apidly su ey a la ge ange o en i onmen s wi hou losing con ol o e obse able beha iou al da a. In he  s pa o he chap e , we in oduce an a chi ec u e o a mul i-pu pose modula beha iou box. This a chi ec u e makes i possible o use simple ab ica ion and apid p o o yping ools o quickly econgu e a physical en i onmen o die en assays equi ing complex combina ions o senso s and ac ua o s. In he second pa , we p esen Bonsai, a high-pe o mance isual p o- g amming language o con olling and moni o ing eal- ime da a s eams on a digi al compu e . We desc ibe Bonsai's co e p inciples and a chi ec- u e and demons a e how i allows o he apid and exible p o o yping o in eg a ed expe imen al designs in neu oscience. We specically high- ligh some applica ions ha equi e he combina ion o many die en ha dwa e and so wa e componen s, including ideo acking o beha io , elec ophysiology and closed-loop con ol o s imula ion. All he esul s conce ning he Bonsai amewo k ha e been published as: Lopes, G., Bonacchi, N., F azão, J., Ne o, J., A allah, B., Soa es, S., Mo ei a, L., Ma ias, S., I sko , P., Co eia, P., Medina, R., Calca- e a, L., D eos i, E., Pa on, J. & Kamp, A. (2015). Bonsai: An e en - based amewo k o p ocessing and con olling da a s eams. F on ie s in Neu oin o ma ics , 9 (7). doi:10.3389/ nin .2015.00007 48 2.2 In oduc ion The o mal s udy o animal beha iou has a long his o y spanning hund eds o yea s ac oss he elds o e hology, expe imen al psychology and neu - oscience. While he e hologis s mainly endea ou ed o s udy beha iou in i s na u al en i onmen , he psychologis s and neu ophysiologis s ha e classically eso ed, o necessi y, o mo e con olled labo a o y se ings. The eason is mainly one o complexi y. Beha iou is a highly mul i- dimensional, mul i-scale phenomenon ha o en allows no clea sepa a ion be ween ele an and i ele an a iables (Gomez-Ma in, Pa on, Kamp, Cos a & Mainen, 2014). I is in gene al impossible o p edic wha an an- imal is going o do simply because some o he c ucial in o ma ion is no e en accessible o measu emen . In o de o mi iga e his p oblem, neu os- cien is s eso o making impo e ished p epa a ions whe e he numbe o a iables ha a e changing a any gi en momen is low and e y ca e ully con olled. The hope is ha in his way he in e p e a ion o b ain signals eco ded simul aneously wi h animal beha iou will be acili a ed. Depending on he kind o ques ion a neu oscien is is a e , an ap- p op ia e beha iou pa adigm is se up. Anaes he ized and head-xed p epa a ions, as well as classical o ope an condi ioning boxes a e egu- la ly employed o d i e he beha iou o he animal o oscilla e be ween a se o epea edly ep oducible s a es mo e amenable o s a is ical analysis. Building such beha iou assays o en equi es e y specialized enginee ing skills and long de elopmen cycles o ial and e o in o de o ensu e all he ele an a iables a e con olled acco dingly. Because o his, he end- ency o he eld has been o concen a e on a small se o s anda dized assays which ha e been shown o wo k o one a ea o esea ch o o he . Small a ia ions o he s anda d asks a e g adually in oduced in o de o p obe die en aspec s o he sys em. The complexi y o beha iou 49 s udies in neu oscience has hus adi ionally p og essed by a i ion and pains aking accumula ion o small pe u ba ions o o e all design pa e ns. In e es ingly, howe e , many o he mos signican concep ual ad- ances in ou unde s anding o b ain unc ion ha e in ac de eloped pa i passu wi h o ays in o en i ely new beha iou spaces. Mo ing om anaes- he ized o awake physiology comple ely changed he way we unde s and he neu al p ocessing o senso y s imuli (Selle s, Benne , Hu , Williams & F öhlich, 2015). Simila ly, mo ing om head-xed o eely mo ing be- ha iou led o he disco e y o place elds in hippocampus (O'Kee e & Dos o sky, 1971). Single ial analysis o simul aneously eco ded e- sponses ha e e ealed pa e ns o neu al ac i i y such as hippocampal ipples ha a e simply impossible o eco e om s a is ical a e ages o epe i i e beha iou episodes (Fos e & Wilson, 2006; Da idson, Kloos e - man & Wilson, 2009). Each o hese de elopmen s has equi ed signican ad ances in ools used o eco d and con ol beha iou al da a a a ne scale. Un o una ely, he echnical cos and scien ic isk o ying some- hing no el means ha such ad ances a e s ill much ewe and a be ween han would be desi able. F om he beginning o his wo k i was unde s ood ha e ealing he eleology o co ical con ol o e beha iou would equi e jus his kind o o ay in o di e se and po en ially unknown beha iou spaces. We ag eed ha i migh be wo h o y and de elop a oolki o he beha iou al neu oscien is ha would accele a e he explo a ion o his as space. One o he  s ob ious a ge s o imp o emen was he beha iou box. T adi ionally, when a gi en beha iou assay is ound o p oduce in e es ing esul s, i s design is p og essi ely weaked so as o exace ba e he ea u es o he o iginal eec . In his wo k, we s a ed by b eaking apa his concep o he polished beha iou box, and wonde ed wha would happen i ins ead o a s anda d box, we could ha e a box o s anda ds. 50 2.3 Me hods 2.3.1 The Modula Beha iou Box A he ou se i was decided ha he scale o he modula a chi ec u e would p obably ha e o ma ch a gi en animal model, gi en he as ly di - e en size scales be ween oden s, ca s and p ima es. Ou animal model o choice is he oden a us no egicus , and all o ou p oposed design choices a ge i s size scale. Small adjus men s could, howe e , be eas- onably made up o a poin o o he mammals o simila s a u e, such as mice. The main componen and in e ace o he modula box is he indi idual 1×1 module (Figu e 2.1A). This module denes a s anda dized oo p in ( 12 cm ×12 cm ), agains which all o he modules a e measu ed. E e y newly ab ica ed module is buil o specica ion o ma ch a mul iple o his s anda dized oo p in (e.g. i is possible o ha e 2×1 , 2×2 , 4× 1 o any o he mul iple combina ion o he s anda d size). Inside he module oo p in he module designe places a single logical componen o a beha iou box and ensu es ha i can ope a e in isola ion. Figu e 2.1 shows some examples o eusable modules de eloped h oughou he p ojec . One o he p incipal equi emen s o assembling a box is as ening all i s componen s oge he . By ha ing a s anda d oo p in , i is possible o design a se o egula ly spaced moun ing poin s ha allows he ex- pe imen alis o quickly gene a e an en i ely new congu a ion by simply swapping modula componen s inside he box (Figu e 2.2, 2.3). Fo his wo k, we ook ad an age o an exis ing aluminium s uc u al aming sys- em (Bosch Rex o h, DE) o build he common moun ing poin s (Figu e 2.1A). Modules a e as ened agains pos -inse ion nu s which a e able o slide ac oss he whole leng h o he aluminium ail. Each o he modules is as ened by ou sc ews, one in each co ne . In o de o ensu e modules 51 A B C D Figu e 2.1. Some examples o s anda dized beha iou modules. ( A ) De- ail o a 1×1 module moun ed in suppo ame. Fixa ion is achie ed by d i ing a sc ew h ough pos -inse ion nu s placed in he s uc u al aming (see ex ). ( B ) Example ewa d po module which can be oo - o wall-moun ed. All ele an elec onics and wa e dis ibu ion ci cui s a e assembled on he back o he module (no shown). ( C ) Wall-moun ed econgu able obs acle cou se s eppe module. S eppe mo o s moun ed on he back o he module allow o dynamic econgu a ion o he o ien - a ion o each s ep. ( D ) Floo -moun ed obs acle cou se s ep pai . Mul iple o hese modules can be iled oge he o assemble obs acle cou ses o a bi a y leng h. 52 Figu e 2.2. Example o a linea shu ling box assembled om a 1 m ×1 m modula s uc u e using ewa d po and obs acle cou se s ep modules. Figu e 2.3. Side iew o he linea shu ling box. 53 AB Figu e 2.4. Example o e ical assembly. ( A ) De ail o a 1×1 wall- moun ed pla o m module. ( B ) Example o a e ical maze congu a ion. can be igh ly and secu ely xed one nex o he o he , we used a sys em o egula ly spaced double ails (Figu e 2.2). This gi es he ame he exibili y o easily eposi ion and ea ange indi idual modules iling he en i e oo p in o any a bi a ily la ge box. I he suppo ame is laid ou e ically, i is possible o c ea e mod- ula walls o a bi a y dimensions. Some o he modules can be moun ed equally well on a e ical o ho izon al congu a ion, such as ewa d po s (Figu e 2.1B). The h ee-dimensionali y o he design has e en been ex- ploi ed o c ea e e ical mazes (Figu e 2.4) o g ea success. Th oughou he p ojec we made he base o e e y module om 5 mm ac ylic pieces. While no an absolu e equi emen o he design, his choice o plas ic ma e ial has he ad an age ha a lase cu e can be used o e y quickly p oduce a la ge collec ion o cus om-buil modules. In addi ion, pa e ns can be eng a ed o cu on he base o p o ide addi ional moun ing poin s o ha dwa e embedded in he module. The use o such apid p o o yping ab ica ion ools alongside wi h o he shel a ailable elec onic senso s and ac ua o s mean we we e able o comple ely edesign he en i e beha iou box, some imes in a ma e o days. 54 2.3.2 The Bonsai F amewo k Mode n scien ic expe imen s c ucially depend on he con ol and mon- i o ing o many pa allel s eams o da a. Mul iple measu emen de ices, om ideo came as, mic ophones, and p essu e senso s o neu al elec- odes, mus simul aneously send hei da a in eal- ime o a eco ding sys em. Gene al pu pose digi al compu e s ha e g adually eplaced many o he specialized analog and digi al echnologies used o his kind o da a acquisi ion and expe imen con ol, la gely due o he exibili y o p o- g amming and he exponen ial g ow h in compu ing powe . Howe e , he se ial na u e o p og amming ins uc ions and sha ed memo y makes i a challenge, e en o expe ienced p og amme s, o de elop so wa e ha can elegan ly deal wi h he asynch onous, pa allel na u e o scien ic da a. Ano he challenge a ises om he need o so wa e in eg a ion. Each ha dwa e endo p o ides hei own se o d i e s and p og amming in e - aces o congu ing and acqui ing da a om hei de ices. In addi ion, he g ow h o he open-sou ce mo emen has g ea ly inc eased he num- be o eely a ailable echnologies o die en da a p ocessing domains. In eg a ion o hese di e se so wa e and ha dwa e componen s emains a majo challenge o esea che s. These dicul ies lead o inc eased de elopmen imes when se ing up an expe imen . Mo eo e , i equi es expe imen e s o pu sue specialized aining ou side hei domain o esea ch. This limi s he abili y o apidly p o o ype and y ou new designs and can quickly become he ac o limi ing he kinds o ques ions ha a e amenable o scien ic in es iga ion. He e we desc ibe Bonsai, an open-sou ce isual p og amming ame- wo k o p ocessing da a s eams. The main goal o Bonsai is o simpli y and accele a e he de elopmen o so wa e o acqui ing and p ocessing he many he e ogeneous da a sou ces commonly used in (neu o) scien ic esea ch. We aim o acili a e he as implemen a ion o s a e-o - he-a expe imen al designs and o encou age he explo a ion o new pa adigms. 55 show up as p ope ies o he g oup node i sel . This allows o he pa a- me e iza ion o nes ed da aows and inc eases hei euse possibili ies. In addi ion, encapsula ed da aows a e used o speci y mo e complica ed, ye powe ul, ope a o s such as i e a ion cons uc s ha allow o he compac desc ip ion o complex da a p ocessing scena ios ha can be cumbe some o speci y in pu e da aow isual languages (Mosconi & Po a, 2000) (see below). Bonsai was designed o be a modula amewo k, which means i is pos- sible o ex end i s unc ionali y by ins alling addi ional packages con aining sou ces and combina o s de eloped o specic pu poses. New packages can be w i en using C# o any o he.NET p og amming languages. Py hon sc ip s [ ia I onPy hon (I onPy hon Communi y, 2014)] can be embedded in he da aow as ans o ms and sinks, allowing o apid in eg a ion o cus om code. All unc ionali y included in Bonsai was designed using hese modula p inciples, and we hope o encou age o he esea che s o con ib- u e hei own packages and he eby ex end he amewo k o o he applic- a ion domains. A p esen , he a ailable packages include compu e ision and signal p ocessing modules based on he OpenCV lib a y (I seez, 2014). D i e s o se e al came as and in e aces o o he imaging and signal ac- quisi ion ha dwa e we e in eg a ed as Bonsai sou ces and sinks, including suppo o A duino mic ocon olle s (Banzi, Cua ielles, Igoe, Ma ino & Mellis, 2014), se ial po de ices and basic ne wo king using he OSC p o- ocol (W igh , F eed & Momeni, 2003). Gi en he specic applica ions in he domain o neu oscience, we also in eg a ed a numbe o neu oscience echnology packages. The Ephys package, o example, builds on he Open Ephys ini ia i e o he sha ing o elec ophysiology acquisi ion ha dwa e (Voig s, Siegle, Keme e, Moo e & Wilson, 2013) by p o iding suppo o he Rhy hm open-sou ce USB/FPGA in e ace (In an Technologies, US). The e o e, he nex gene a ion ools o elec ophysiology can al eady be used inside Bonsai, he acqui ed physiology da a implici ly in eg a ed wi h 62 o he a ailable da a s eams and hus easily assembled in o a powe ul and exible expe imen al neu oscience pla o m. Ad anced Ope a o s The mos common applica ion o Bonsai is he acquisi ion and p ocessing o simple, independen da a s eams. Howe e , o many mode n expe - imen s, basic acquisi ion and s o age o da a is o en no sucien . Fo example, i can be con enien o only eco d he da a aligned on e en s o in e es , such as he onse o specic s imuli. Fu he mo e, neu oscience expe imen s o en p og ess h ough se e al s ages, especially o beha i- o al assays, whe e con olled condi ions a y sys ema ically ac oss die en sessions o ials. In o de o en o ce hese condi ions, expe imen s need o keep ack o which s age is ac i e and use ha in o ma ion o upda e he s a e o con ol a iables and senso y p ocessing. These equi emen s o en canno be desc ibed by a simple linea pipeline o da a, and equi e cus om code o handle he complica ed logic and bookkeeping o expe i- men al s a es. Below we desc ibe a se o ad anced Bonsai ope a o s ha can be used o exibly econgu e da a p ocessing logic o co e a la ge numbe o scena ios. These ope a o s and hei applica ions a e all buil on he single idea o slicing a da a s eam in o sub-sequences, called win- dows, which a e hen p ocessed independen ly and, po en ially, in pa allel (Figu e 2.7). Bonsai p o ides die en combina o s ha allow he c ea ion o hese sub-sequences om any obse able da a s eam, using elemen coun in- o ma ion, iming, o ex e nal igge s (Figu es 2.7AC). The specic se o ope a ions o apply on each window is desc ibed by encapsula ing a da aow inside a Selec Many g oup, as de ailed in he signal p ocessing example o Figu e 2.7D. The inpu sou ce in his g oup ep esen s each o he window sub-sequences, i.e., i is as i each o he windows is a new da a sou ce, con aining only he elemen s ha a e a pa o ha window. 63 Ready Go Time KeyDown F. A. Time Da a Sou ce S W Window (Elemen Coun ) Sou ce Window (Coun 2, Skip 2) Window (Coun 2, Skip 3) Window (Coun 2, Skip 1) B. S W Sou ce Window (TimeSpan) Sou ce Window (TimeSpan 1s) D. Raw Fil e ed S W S Sou ce Window Selec Many S A W Inpu A e age Ou pu 57 3 27 6 57 3 7 3 2 327 27 6 54 4 5 Sou ce Window (Coun 3, Skip 1) Selec Many (A e age) C. S W T Sou ce Window (T igge ed) T igge T igge Sou ce Window (T igge ed) E. VideoW i e S V W Inpu Ou pu C W S T Came a T igge Selec ManyWindow T igge * * * * * * File 1 File 2 File 3 Came a Selec Many (A e age) Window (T igge ed) Ready R G R Go Repea WK T KeyDown Take (1) Ou pu S S Inpu S imulus Onse Figu e 2.7. Using slicing and window p ocessing combina o s in Bonsai. 64 These elemen s will be p ocessed as soon as hey a e a ailable by he en- capsula ed da aow. Windows can ha e o e lapping common elemen s, in which case hei p ocessing will happen concu en ly. The p ocessing ou pu s om each window a e me ged oge he o p oduce he nal esul . In he case o Figu e 2.7D, pas and u u e samples a e g ouped in win- dows o compu e a unning a e age o he signal h ough ime, necessa ily ime-shi ed by he numbe o u u e samples ha a e conside ed in he a e age. The p ocessing o he elemen s o each window happens independen ly, as i he e was a new isola ed da aow unning o each o he sequences. We can exploi his independence in o de o dynamically u n da aows on and o du ing an expe imen . In he ideo spli ing example o Figu e 2.7E, we use an ex e nal igge sou ce o chop a con inuous ideo s eam in o many small ideo sequences, aligned when he igge  ed. We hen nes a VideoW i e sink in o he Selec Many g oup. The VideoW i e sink is used o encode ideo ames in o a con inuous mo ie le. I s a s by c e- a ing he ideo le upon a i al o he  s ame, and hen encoding e e y ame in he sequence as hey a i e. When he da a s eam is comple ed, he le is closed. By nes ing he VideoW i e inside he Selec Many g oup, wha we ha e eec i ely done is o c ea e a new ideo le o each o he c ea ed windows. Whene e a new igge a i es, a new clip is c ea ed and sa ing p oceeds, implici ly pa allelized, o ha ideo le. Mo e gene ally, we can use his idea o implemen disc e e ansi ions be ween die en p ocessing modes, and chain hese s a es oge he o design complex con ol s uc u es such as ni e s a e machines (FSMs). FSMs a e widely used o model en i onmen s and beha io al assays in sys ems and cogni i e neu oscience. One example is illus a ed in Figu e 2.7F, whe e we depic he con ol scheme o a s imulus- esponse appa a us o a simple eac ion ime ask. In his ask, he e a e only wo s a es: Ready and Go. In he Ready s a e, no s imulus is p esen ed and a ime 65 is a med. Whene e he ime  es, he ask ansi ions in o he Go s a e, and a s imulus is p esen ed. The subjec is ins uc ed o p ess a key as as as possible upon p esen a ion o he s imulus. As soon as he key is p essed, he sys em goes back o he Ready s a e o s a ano he ial. In a FSM, nodes ep esen s a es, e.g., s imulus a ailabili y o ewa d deli e y, and edges ep esen ansi ions be ween s a es ha a e caused by e en s in he assay, e.g., a key p ess. In each s a e, a numbe o ou pu a iables and con ol pa ame e s a e se (e.g., u ning on a ligh ) which ep esen he beha iou o he machine in ha s a e. In he Bonsai da aow model, da aows encapsula ed in a Selec Many g oup can be used o ep esen s a es in a FSM (Figu e 2.7F, bo om). Specically, a s a e is ac i a ed whene e i ecei es an inpu e en , i.e., he da aow nes ed inside he s a e will be u ned on. The dynamics o he nes ed da aow de e mine he dynamics o he s a e. In he Go s a e p esen ed in Figu e 2.7F, he ac i a ion e en is used o igge s imulus onse . In pa allel, we s a lis ening o he key p ess which will e mina e he s a e. Con e sely, o he Ready s a e we would igge s imulus ose and a m he ime o p esen ing he nex s imulus. An impo an di - e ence be ween Bonsai da aows and pu e s a e machine models is ha a da aow is specied as a di ec ed acyclic g aph, i.e., he da a s eam canno loop back on i sel . Howe e , by aking ad an age o he Repea combina o , we can es a a da aow once i is comple ed, allowing us o ese he s a e machine o he nex ial. Many o he con ol asks in expe imen s ha e his sequen ial ial- based s uc u e, which has allowed us o apidly p o o ype complex beha- iou assays, such as closed-loop oden decision making asks, simply by le e aging he exibili y o he da a s eam slicing ope a o s. 66 Al e na i es o Bonsai Al hough g aphical use in e aces ha e played a c ucial ole in he wide- sp ead p oli e a ion o compu ing echnology h oughou a ious scien ic elds, he majo i y o hese in e aces end o be applied o ela i ely na ow domains, such as he ope a ion o a specic ins umen . Thei goal is o en o p o ide access o all he a ious congu a ion pa ame - e s o he ha dwa e and o p o ide basic da a acquisi ion unc ionali y. The e is o en no oppo uni y o pa ame e ize o condi ion he beha iou o he ins umen beyond he possibili ies p esen ed by he in e ace, and in e connec ions wi h o he de ices a e o en limi ed o simple ha dwa e igge s. The al e na i e, when a ailable, is o access low-le el applica ion p og amming in e aces (APIs), and p og am he desi ed beha iou om sc a ch. In he mo e exible domains o da a analysis, beha iou con ol and so wa e simula ions, he use o mo e e sa ile g aphical in e aces has be- come inc easingly p e alen . In hese scena ios, i is no uncommon o encoun e he de elopmen o domain-specic languages (DSLs), whe e g aphical building blocks ela ed o he domain o applica ion can be com- bined oge he by he use o gene a e new beha io s, such as he sequence o s eps in a psychophysics expe imen o a s a e-machine diag am used o con ol s imuli and ewa ds in ope an condi ioning. While p o iding mo e exibili y o he end use , such DSLs a e usually no concei ed, a hei co e, o be applied o wildly die en domains (e.g., an ope an con- di ioning s a e machine is no expec ed o be able o l e con inuous elec ophysiology signals). In ac , mos DSLs will no e en allow he use o ex end he se o buil -in ope a ions. In hose ha do, he de elope may nd a cus omiza ion pi (Cook, Jones, Ken & Wills, 2007), whe e concep s and ope a ions ha a e wi hin he ange o wha he DSL can exp ess a e easy o de elop, whe eas asks ha a e a li le bi ou side o he 67 bounda ies o he language quickly become impossible o oo cumbe some o implemen . As he le el o exibili y o a g aphical use in e ace inc eases, we s a o app oach he space occupied by gene al pu pose isual p og am- ming languages (GPVPL). These a e languages ha a e designed om he ou se o be capable o sol ing p oblems ac oss a wide a ie y o domains using a gene al se o ope a ions. Ideally, he co e building blocks o he language will hemsel es be domain-independen , so ha he use can eas- ily apply he same se o ope a ions o he wides possible class o inpu s. In o de o be e illus a e he eel and exp essi e powe o GPVPLs, and o cla i y whe e Bonsai i sel is posi ioned, we will gi e wo examples o popula languages ha ha e succeeded in his niche: LabVIEW (Na ional Ins umen s, 2014) and Simulink (Ma hWo ks, 2014). LabVIEW is one o he bes examples o a GPVPL applied o he design and con ol o expe imen s (Ellio , Vijayakuma , Zink & Hansen, 2007). In LabVIEW, use s c ea e i ual ins umen s (VIs) which a e composed o a g aphical on -panel con aining an asso men o bu ons, dials, cha s and o he objec s; as well as a back-panel whe e a owcha -like block dia- g am can be used o speci y he beha iou o he VI. In his back-panel, nodes and e minal elemen s can ep esen ha dwa e componen s, nume - ical ope a ions o on -panel objec s, which a e connec ed oge he using i ual wi es ha speci y he ow o da a be ween hem. The popula i y o LabVIEW g ew ini ially om i s suppo o s a e-o - he-a da a acquisi- ion ca ds and ha dwa e as well as i s da a isualiza ion capabili ies. The modula i y o i s a chi ec u e also allowed use s o quickly de elop and implemen new nodes wi hin he language i sel by using VIs hemsel es as nodes. Al hough he LabVIEW back-panel is a da aow isual p og amming language, i s execu ion model ends o ollow a polling, a he han e en - d i en, s a egy o dealing wi h mul iple da a s eams. In o de o p op- 68 e ly scale his model o he inc easing numbe o a ailable p ocesso co es, LabVIEW has implemen ed sophis ica ed code analysis ools ha a emp o iden i y pa allelizable po ions o block diag ams au oma ically (Ellio e al., 2007). Once hese sec ions a e iden ied, LabVIEW will au oma ic- ally gene a e pa allel p ocesses depending on he numbe o a ailable co es and will manage he bo lenecks in he code acco dingly. Al hough his mi iga es he limi a ions o he sequen ial polling p og amming model, i is impo an o ealize ha he goal o such au oma ic pa alleliza ion is s ill o p o ide he use wi h a logically synch onized p og amming model. Simulink is a popula da aow isual p og amming language o mod- eling, simula ing and analyzing mul i-domain dynamic sys ems. I has become ex emely popula o modeling esponse cha ac e is ics o con ol sys ems, allowing no only o he apid p o o yping o algo i hms, bu also he au oma ic gene a ion o mic ocon olle code o embedded sys ems. Again, he success o he language s emmed p ima ily om he exibili y and ease o use o he block diag ams, as well as he numbe o p ebuil ope a ions and da a isualiza ion ools which quickly ook ca e o many c ucial bu edious aspec s o con ol sys ems modeling. Like LabVIEW, he execu ion model o Simulink gene a ed code is s ill based on polling s a egies, whe e eady o execu e da aow nodes a e upda ed in u n as inpu s become a ailable. Again, s a egies o scale he ou pu o Simulink o mul iple co es ha e been p oposed based on analyzing and segmen ing he model in o pa allelizable sec ions which can be con e ed in o equi alen pa allel execu ion code o mic ocon olle s (Kumu a, Nakamu a, Ishiu a, Takeuchi & Imai, 2012). Simila o LabVIEW and Simulink, Bonsai was designed as a gene al pu pose modula language. The co e a chi ec u e o Bonsai is domain- independen and p o ides a gene al amewo k o compose asynch onous da a s eams. A gene al se o composi ion ope a o s, o combina o s, p o ides suppo o i e a ion, segmen a ion and me ging o pa allel da a 69 s eams, as well as o he common manipula ions on obse able sequences. Bo h he sou ces o da a and a ailable p ocessing ope a ions can be ex en- ded wi hin he language i sel using nes ing o da aows. Da a isualize s and a g owing lib a y o da a s eam acquisi ion, p ocessing and logging modules a e p o ided o allow apid p o o yping o a la ge numbe o di - e en applica ions. Howe e , in con as o LabVIEW o Simulink, Bonsai adop s a e y die en s a egy o implemen da aow execu ion. Ra he han ying o de i e a global sequen ial execu ion o de o da aow nodes based on he numbe o ac i e inpu s, Bonsai nodes simply eac o incoming in- pu s immedia ely, wi hou he need o wai o all o hem o be ac i e. When mul iple obse able sequences a e p esen , his allows o a choice o die en concu ency composi ion s a egies. Ne e heless, as he es- ul o he composi ion is an obse able sequence i sel , such concu ency managemen can emain unc ionally isola ed om he combina o ha is handling he composi ion. F om he poin o iew o downs eam ope a - o s, hey a e simply ecei ing an obse able sequence. The e is a adeo, o cou se, ha mo e esponsibili y o managing he ow o da a is passed o he end use , bu i also allows o a ne g ained con ol o concu ency ha is c i ical o he specica ion o pa allel applica ions. One impo an ca ea o de eloping asynch onous sys ems is ha de- bugging can be mo e dicul in si ua ions whe e he p ecise iming and o de ing o e en s is equi ed o ep oduce an oending beha iou . In syn- ch onized and sequen ial execu ion en i onmen s, one can easily go s ep by s ep h ough he p ecise cascade o ans o ma ions ha esul ed in a p oblem. In con as , when mul iple p ocesses a e execu ing concu en ly, i can be ha de o analyze he p og am ow in a simila ly ep oducible, de e minis ic manne . Howe e , i should be no ed ha his issue is no unique o eac i e en i onmen s wi h eal asynch onous de ices. A sequen- 70 ial polling s a egy will be equally decien in ep oducing a pa icula execu ion sequence when da a om pa allel inpu de ices is being accessed. Ano he impo an ca ea is ha Bonsai cu en ly uns exclusi ely in Windows ope a ing sys ems. Howe e , Mic oso has ecen ly open- sou ced he execu ion engine o he.NET amewo k and will pu sue imple- men a ions o all he majo ope a ing sys ems (Linux/Mac). This aises he in e es ing possibili y o e en ually ex ending he Bonsai use base in o hese impo an pla o ms. 2.4 Resul s 2.4.1 Ge ing S a ed wi h Bonsai Communi y The Bonsai amewo k can be downloaded a h ps://bi bucke .o g/ ho izongi /bonsai and ins alled on Windows ope a ing sys ems s a ing wi h Windows 7 and abo e. The websi e is o ganized in o die en sec ions: Downloads (whe e he la es ins alle is loca ed), Wiki (wi h a Ge ing S a ed guide, u o ials and (FAQ) equen ly asked ques ions), and Issues (whe e bugs can be epo ed). We ha e also c ea ed a use o um (add ess is lis ed in he FAQ sec ion) whe e he communi y o Bonsai use s ha e been sha ing hei eedback, ques ions and expe iences. A ideo u o ial in oduc ion o Bonsai is included wi h his publica ion (Video 2.1). Ex ending Bonsai Bonsai was designed om he ou se o suppo many die en laye s o ex ensibili y: (a) Da aows: The  s laye is h ough he c ea ion o Bonsai da aow les hemsel es. Exis ing da aows can be di ec ly eused inside 71 elec ophysiology o o he digi al acquisi ion sys ems whe e mul iple da a samples, om one o mo e channels, a e synch onously acqui ed, bue ed and s eamed o he compu e . These bue s a e o en ep esen ed as da a ma ices, whe e ows a e channels and columns ep esen indi idual da a samples h ough ime, o ice- e sa. Suppo o simple band-pass l e s, h esholding and igge ing allowed us o build exible spike de ec ion and wa e o m ex ac ion sys ems (Figu e 2.8F). Using In an's Rhy hm API, we in eg a ed in o Bonsai suppo o a a ie y o nex -gene a ion elec o- physiology de ices using In an's digi al amplie echnology, such as he Open Ephys acquisi ion sys em (Voig s e al., 2013) o In an's e alua ion boa d (RHD2000, In an Technologies, US). This sys em was success ully used o acqui e and isualize simul aneous eco dings om dense silicon p obes whe e spikes om a loose-pa ch jux acellula pipe e we e used as igge s o align and ex ac wa e o m da a appea ing on he mul i-channel ex acellula p obe. Responses om e e y silicon p obe si e could hen be supe imposed on an accu a e endi ion o he p obe geome y, in eal- ime. The abili y o apidly in eg a e new modules allowed us o suppo he de elopmen and c oss- alida ion o new ools o beha io al neu oscience. A pa adigma ic example was he yPAD, a new me hod o quan i ying eeding beha iou in D osophila melanogas e by measu ing changes in elec ode capaci ance induced by he p oboscis ex ension o a y (I sko e al., 2014). The in eg a ion o he yPAD in Bonsai allowed esea ch- e s o quickly ge s a ed using his app oach o design new expe imen s. Fu he mo e, i also allowed he alida ion o he ool by enabling simul- aneous acquisi ion o high-speed ideo eco dings o y beha iou which we e la e used o anno a ion and classica ion o he senso eeding aces (Figu e 2.8G). In a die en se o expe imen s, Bonsai was used o implemen a a i- a ion on a popula wo-al e na i e o ced choice (2AFC) decision-making ask o oden s (Figu e 2.8H). In his ype o ask, animals a e placed in 78 an en i onmen wi h h ee po s. They a e p esen ed wi h a s imulus in he cen e po and a e wa ds epo hei pe cep ion o he s imulus by going ei he o he le o igh choice po s. In he a ia ion we p esen in his wo k, he wo choice po s we e eplaced by egions o in e es whe e he ac i i y o he animal is analyzed using compu e ision. This example oe ed unique challenges as i combined sophis ica ed sequen ial con ol o a ask en i onmen wi h con inuous da a s eam p ocessing o ideo and senso da a. The in eg a ion o all hese di e se componen s o da a acquisi ion and expe imen con ol does no only allow o he apid deploymen o es ablished p o ocols. In ac , he modula na u e o hei in eg a ion (i.e., how hey can be combined oge he ) opens up new a enues o esea ch, by allowing a ich, apid explo a ion o no el me hodologies. To demons a e his, we c ea ed a dynamic i ual en i onmen o eely mo ing oden s whe e he isual p esen a ion o a s imulus is igh ly con olled in closed- loop o he ac ions o he animal. We used a p ojec ion se up simila o he low-cos mul i- ouch sensing able p oposed by (Han, 2005), whe e a isible ligh ea -p ojec ion sys em is coupled wi h in a ed illumina ion and an in a ed imaging senso o de ec in eal- ime whe e he animal is loca ed wi h espec o he isual display su ace (Video 2.2). 2.5 Discussion A e abou a yea o using Bonsai in an ac i e neu oscience esea ch ins i- u e, dozens o die en expe imen al p o ocols and da a analysis pipelines ha e been success ully implemen ed using he p o ided building blocks (Gou êa, Mon ei o, Soa es, A allah & Pa on, 2014; I sko e al., 2014; Tecuape la e al., 2014). We we e su p ised by he di e si y o applica- ions and by he pace a which new modules and de ices we e de eloped and in eg a ed. 79 The pe o mance achie ed by Bonsai da aow p ocessing was an im- po an conside a ion h oughou . Video p ocessing can be pa icula ly challenging o handle gi en he bandwid h equi ed o quickly acqui e and p ocess la ge da a ma ices. In o de o co ela e con inuous measu es o beha iou wi h neu al ac i i y, i is use ul o hose measu emen s o ha e bo h high spa ial and high empo al esolu ion. Using Bonsai, we we e able o simul aneously p ocess and comp ess g ayscale image sequences om high esolu ion ( 1280 ×960 ) and high ame a e (120 Hz) came as using s anda d o- he-shel desk op compu e s (In el Co e i7, 8 GB RAM). In ac , many o he epo ed assays use mul iple (>2) such ideo s eams wi h success and ac ually p ocess he beha iou ideo online ei he o con- ol s a es o he beha iou p o ocol o o p e-p ocess ideo da a o oine analysis. One o he a eas whe e we see he applica ion o Bonsai becoming mos signican is in he de elopmen o dynamic beha iou assays (en- i onmen s) using eac i e con ol s a egies. B ains e ol ed o gene a e and con ol beha io s ha can deal wi h he complexi y o he na u al wo ld. Howe e , when neu oscien is s y o in es iga e hese beha io s in he lab, i is o en dicul o design equi alen en i onmen al complexi y in a con olled manne . As an example, conside a simple o aging scen- a io in which a land animal mus collec , in a imely manne , ood i ems ha become a ailable a andom in e als in many si es. I he i em is no collec ed in ime, i o s o ge s ea en by compe i o s. In he case o a single o aging si e, a FSM desc ip ion in ui i ely ep esen s he wo k- ings o he en i onmen (Figu e 2.9A). Howe e , le us now conside a si ua ion whe e he en i onmen has wo o hese ood si es ope a ing in- dependen ly, hus in oducing he possibili y o die en e en s occu ing simul aneously a each o he si es. I ou en i onmen is modeled as a ni e-s a e machine, hen we mus ep esen e e y possible combina ion o s a es and ansi ions, as in Figu e 2.9B. In he classical s a e machine 80 Figu e 2.9. Desc ibing he beha iou o dynamic en i onmen s using ei he s a e-machines o da aows. o malism he machine can only be in one s a e a a ime, which means we now need o model each s a e as he combina ion o he indi idual independen s a es a each ewa d loca ion. Fu he mo e, because ans- i ions be ween hese s a es a e asynch onous and independen , we hus ha e edges be ween nea ly e e y pai o nodes, as each ewa d si e can change i s s a e a any poin in ime ela i e o he o he . How would designing such a scena io eel like in a eac i e p og am- ming language? Figu e 2.9C shows a possible specica ion o he 1-si e o aging ask in eac i e e ms. In his case, we ha e wo sou ces o e en s om he en i onmen : one ime signaling he a ailabili y o ewa d (A); and a sampling e en (S) which is igge ed e e y ime he animal checks 81 he loca ion o ood. Bo h o hese e en s can occu independen ly o each o he , bu when a sampling e en coincides wi h ewa d a ailabili y (C), hen ewa d (R) is deli e ed. Because his desc ip ion is in insically asynch onous and pa allel, i makes i ex emely easy o scale he ask o a la ge se o loca ions: jus eplica e he da aow o each o he o he loca ions (Figu e 2.9D). In his example, he design space was made mo e in ui i e by in oducing he pa allel and asynch onous na u e o a eal-wo ld si ua ion in o ou modeling o malism. Ano he dicul y o he classical s a e machine o malism is dealing wi h con inuous a iables. The na u al en i onmen p o ides cons an eal- ime eedback ha igh ly co ela es wi h he ac ions o an animal. Rep oducing such closed-loop in e ac ion and manipula ing i s dynamics is a necessa y ool o ully in es iga ing b ain unc ion. Such models a e i ually impossible o ep esen in a machine o ni e s a es, gi en he po- en ial inni ude o eedback esponses. Howe e , he da aow o malism o asynch onous e en sou ces can easily accommoda e such models. In ac , his is hei na u al ba leg ound; nodes ep esen eac i e ope a o s ha p omp ly espond o inpu alues b oadcas ed by e en sou ces. These models o asynch onous compu a ion a e hus ideal o ec ea ing he com- plex disc e e and con inuous aspec s o na u al en i onmen s ha b ains e ol ed o mas e . We hus p opose Bonsai as a new ool o neu oscien - is s ying o unde s and how he b ain deals wi h eal wo ld complexi y. 2.6 Acknowledgemen s We hank João Bá olo Gomes o sugges ing he name Bonsai; Danbee Kim o ea ly discussions on c ea ing i ual en i onmen s o oden s; Joana Noguei a, Geo ge Dimi iadis and all he membe s o he In elligen Sys ems Labo a o y o help ul discussions and commen s on he manu- sc ip . We also hank all he membe s o he Champalimaud Neu oscience 82 P og amme who used Bonsai o se up hei da a analysis and acquisi ion expe imen s and in so doing p o ided aluable eedback o imp o e he amewo k. The esea ch leading o hese esul s has ecei ed unding om he Eu opean Union's Se en h F amewo k P og amme (FP7/2007- 2013) unde g an ag eemen no. 600925 and he Bial Founda ion (G an 190/12). GL is suppo ed by he PhD S uden ship SFRH/BD/51714/2011 om he Founda ion o Science and Technology. The Champalimaud Neu oscience P og amme is suppo ed by he Champalimaud Founda ion. 2.7 Au ho con ibu ions Concei ed and designed he modula box: GL, ARK; Concei ed and de- eloped he Bonsai amewo k: GL; Technical ad iso y boa d: NB, JF; Concei ed and de eloped he expe imen al applica ions: GL, NB, JF, JPN, BVA, SS, LM, SM, PMI, PAC, REM, LC, ED, JJP, ARK; Pe o med and analyzed expe imen s: GL, JF, JPN, BVA, SS, LM, SM, PMI, PAC, REM, LC, ED; W o e he Bonsai manusc ip : GL, ARK. 83 Re e ences Bainomugisha, E., Ca e on, A. L., Cu sem, T. V., Mos inckx, S. & Meu- e , W. D. (2013). A su ey on eac i e p og amming. ACM Com- pu ing Su eys , 45 (4), A icle No. 52. doi:10.1145/2501654.2501666. a Xi : 1005.3014 Banzi, M., Cua ielles, D., Igoe, T., Ma ino, G. & Mellis, D. (2014). A - duino. Cook, S., Jones, G., Ken , S. & Wills, A. C. (2007). Domain Specic De el- opmen wi h Visual S udio DSL Tools . Addison-Wesley P o essional. Da idson, T. J., Kloos e man, F. & Wilson, M. A. (2009). Hippocam- pal Replay o Ex ended Expe ience. Neu on , 63 (4), 497507. doi:10. 1016/j.neu on.2009.07.027 Ellio , C., Vijayakuma , V., Zink, W. & Hansen, R. (2007). Na ional In- s umen s LabVIEW: A P og amming En i onmen o Labo a o y Au oma ion and Measu emen . Jou nal o Labo a o y Au oma ion , 12 (1), 1724. doi:10.1016/j.jala.2006.07.012 Fos e , D. J. & Wilson, M. a. (2006). Re e se eplay o beha iou al se- quences in hippocampal place cells du ing he awake s a e. Na u e , 440 (7084), 6803. doi:10.1038/na u e04587 Ga ido-Ju ado, S., Munõz-Salinas, R., Mad id-Cue as, F. J. & Ma ín- Jiménez, M. J. (2014). Au oma ic gene a ion and de ec ion o highly eliable ducial ma ke s unde occlusion. Pa e n Recogni ion , 47 (6), 22802292. Gomez-Ma in, A., Pa on, J. J., Kamp, A. R., Cos a, R. M. & Mainen, Z. F. (2014). Big beha io al da a: psychology, e hology and he ounda ions o neu oscience. Na u e Neu oscience , 17 (11), 1455 1462. doi:10.1038/nn.3812 Gou êa, T. S., Mon ei o, T., Soa es, S., A allah, B. V. & Pa on, J. J. (2014). Ongoing beha io p edic s pe cep ual epo o in e al du - 84 a ion. F on ie s in neu o obo ics , 8 (Ma ch), 10. doi:10.3389/ nbo . 2014.00010 Han, J. (2005). Low-cos mul i- ouch sensing h ough us a ed o al in- e nal eec ion. P oceedings o he 18 h annual ACM symposium on Use in e ace so wa e and echnology (UIST '05) , 115118. I onPy hon Communi y. (2014). I onPy hon. I seez. (2014). OpenCV (Open Sou ce Compu e Vision). I sko , P. M., Mo ei a, J.-M., Vinnik, E., Lopes, G., Sa a ik, S., Dickinson, M. H. & Ribei o, C. (2014). Au oma ed moni o ing and quan i a i e analysis o eeding beha iou in D osophila. Na u e Communica ions , 5 , 4560. doi:10.1038/ncomms5560 Johns on, W. M., Hanna, J. R. P. & Milla , R. J. (2004). Ad ances in da aow p og amming languages. ACM Compu ing Su eys , 36 (1), 134. doi:10.1145/1013208.1013209 Ka o, H. & Billinghu s , M. (1999). Ma ke acking and hmd calib a ion o a ideo-based augmen ed eali y con e encing sys em. In Aug- men ed eali y, 1999.(iwa '99) p oceedings. 2nd ieee and acm in e - na ional wo kshop on (pp. 8594). IEEE. Kumu a, T., Nakamu a, Y., Ishiu a, N., Takeuchi, Y. & Imai, M. (2012). Model Based Pa alleliza ion om he Simulink Models and Thei Sequen ial C Code. In P oc. o he 17 h wo kshop on syn hesis and sys em in eg a ion o mixed in o ma ion echnologies (sasimi 2012) (pp. 186191). Lopes, G., Bonacchi, N., F azão, J., Ne o, J., A allah, B., Soa es, S., Mo - ei a, L., Ma ias, S., I sko , P., Co eia, P., Medina, R., Calca e a, L., D eos i, E., Pa on, J. & Kamp, A. (2015). Bonsai: An e en -based amewo k o p ocessing and con olling da a s eams. F on ie s in Neu oin o ma ics , 9 (7). doi:10.3389/ nin .2015.00007 Ma hWo ks. (2014). Simulink. 85 Mic oso Open Technologies. (2014). Reac i e Ex ensions o he .NET amewo k (Rx). Mosconi, M. & Po a, M. (2000). I e a ion cons uc s in da a-ow isual p og amming languages. Compu e Languages , 26 (2000), 67104. Na ional Ins umen s. (2014). LabVIEW. O'Kee e, J. & Dos o sky, J. (1971). The hippocampus as a spa ial map: P elimina y e idence om uni ac i i y in he eely mo ing a . B ain esea ch , 34 (1), 171175. Selle s, K. K., Benne , D. V., Hu , A., Williams, J. H. & F öhlich, F. (2015). Awake s. anes he ized: laye -specic senso y p ocessing in isual co ex and unc ional connec i i y be ween co ical a eas. Jou nal o Neu ophysiology , 113 (10), 37983815. doi:10.1152/jn. 00923.2014 Tecuape la, F., Ma ias, S., Dugue, G. P., Mainen, Z. F. & Cos a, R. M. (2014). Balanced ac i i y in basal ganglia p ojec ion pa hways is c i - ical o con a e si e mo emen s. Na u e communica ions , 5 , 4315. doi:10.1038/ncomms5315 Voig s, J., Siegle, J. H., Keme e, C., Moo e, C. & Wilson, M. (2013). A low-cos , open-sou ce sys em o combining high-channel coun elec ophysiology wi h closed-loop op ogene ic eedback. In Socie y o neu oscience (san diego, ca, 13 no embe ) . W igh , M., F eed, A. & Momeni, A. (2003). Open Sound Con ol: S a e o he A 2003. In P oceedings o he 2003 con e ence on new in e aces o musical exp ession (nime-03) (pp. 153159). Mon eal, Canada. 86 Chap e 3 Mo ing wi h and wi hou Mo o Co ex I  s became scep ical o he supposed pa h o he condi ioned eex when I ound ha a s, ained in a die en ial eac ion o ligh , showed no educ ion in accu acy o pe o mance when almos he en i e mo o co ex, along wi h he on al poles o he b ain, was emo ed. Ka l S. Lashley , In Sea ch o he Eng am (1950) 87 measu ed ela i e o B egma, and la e used o econs uc he p ecise placemen o all g id elec odes in he b ain. A he end o he su ge y, a i anium sc ew was inse ed pos e io ly o he c anio omy in con ac wi h he b ain in o de o be used as e e ence o he eco ding sys em. The s abili y o he implan depends c i ically on he absence o mo emen in he bony pla es o he skull du ing de elopmen , which can comp omise he mechanical xa ion o he eco ding chambe o he head (Dimi iadis e al., 2014). Fo his eason, i is ecommended ha a s unde going his p ocedu e should be olde han 7 mon hs (Dimi iadis e al., 2014). Beha iou assay: Du ing each session he animal was placed inside a beha iou box o 30 min , whe e i could collec wa e ewa ds by shu ling back and o h be ween wo nose pokes (Island Mo ion Co po a ion, USA). To do his, animals had o c oss a 48 cm obs acle cou se composed o eigh 2 cm aluminium s eps spaced by 4 cm (Figu e 3.1). The s uc u e o he assay and each s ep in he obs acle cou se was buil ou o aluminium s uc u al aming (Bosch Rex o h, DE, 20 mm se ies). The walls o he a ena we e ab ica ed wi h a lase -cu e om 5 mm hick opaque black ac ylic and xed o he s uc u al aming. A anspa en ac ylic window pa i ion was posi ioned in on o he obs acle cou se in o de o p o ide a clea iew o he animal. All expe imen s we e un in he da k by ha ing he beha iou al appa a us enclosed in a ligh igh box. A mo o ized b ake allowed us o lock o elease each s ep in he obs acle cou se (Figu e 3.2). The sha o each o he obs acles was coupled o an ac ylic piece used o con ol he o a ional s abili y o each s ep. In o de o lock a s ep in a xed posi ion, wo se o mo o s a e ac ua ed o p ess agains he ac ylic piece and hold i in place. Two o he ac ylic pieces we e used as s ops o ensu e a maximum o a ion angle o app oxima ely +/- 100◦ . Two small nu s we e a ached o he bo om o each s ep o wo k as a coun e weigh ha gi es he obs acles a endency o e u n o hei o iginal a congu a ion. In o de o ensu e ha noise om se o 94 s able uns able andom Figu e 3.1. Schema ic o he appa a us and summa y o he die en condi ions in he shu ling p o ocol. mo o ac ua ion could no be used as a cue o ell he animal abou he s a e o each s ep, he mo o s we e always se o p ess agains an ac ylic piece, ei he he piece ha keeps he s ep s abilized, o he ac ylic s ops. A he beginning o each ial, he mo o s we e un h ough a andomized sequence o posi ions in o de o mask in o ma ion abou s a e ansi ions and also o ensu e he s eps we e ese o hei o iginal congu a ion. Con ol o he mo o s was done using a Mo o uino boa d (A ica, PT) along wi h a cus om wo kow w i en in he Bonsai isual p og amming language (Lopes e al., 2015). P io o he mic o-ECoG eco dings, each s ep in he obs acle cou se was ou  ed wi h a mic o load cell (CZL616C, Phidge s, CA) secu ed be ween he s ep on holde and he base (Figu e 3.2). This allowed us 95 se o mo o s load cell (0-750g) Figu e 3.2. Schema ic o he s ep locking mechanism and load cell senso . o eco d a a ying ol age signal p opo ional o he load applied by he animal on each s ep. This load signal was acqui ed simul aneously on all eigh s eps and digi ized synch onously wi h he ECoG da a acquisi ion sys em. Da a acquisi ion: The beha iou o he animals was eco ded wi h a high-speed and high- esolu ion ideog aphy sys em (1280x680 @ 120 Hz ) using an in a ed came a (Flea3, Poin G ey, CA), supe -b igh in a ed LED on ligh s (SMD5050, 850 nm) and a a i- ocal lens (Fujinon, JP) posi ioned in on o he anspa en window pa i ion. A op iew o he assay was simul aneously eco ded wi h he same sys em a a lowe ame- a e ( 30 Hz ) o moni o ing pu poses. All ideo da a was encoded wi h MPEG-4 comp ession o subsequen oine analysis. Beha iou da a acquisi ion o he nose poke beam b eaks was done using an A duino boa d (Uno, A duino, USA) and s eamed o he compu e ia USB. All ideo and senso da a acquisi ion was eco ded in pa allel using he same Bonsai wo kow used o con ol he beha iou assay. Fo he mic o-ECoG eco dings, all elec ophysiological signals we e amplied, digi ized and mul iplexed using wo 64-channel amplie boa ds (RHD2164, In an Technologies, US) connec ed o he elec ode in e ace boa d (EIB) on he eco ding chambe . The amplie boa ds we e hen 96 connec ed h ough a dual heads age adap e (C3440, In an Technologies, US) o he main da a acquisi ion USB in e ace boa d (RHD2000-E al, In an Technologies, US). In o de o acili a e he ee mo emen o he animal in he beha iou box, he single cable connec ing he head o he an- imal o he USB in e ace boa d was passed h ough a slip ing (MMC235, Moon, CN) and hooked in o a nylon s ing c ossing he op o he assay. In his way, mo emen and o a ion o he e he ed animal we e com- pensa ed o a oid unwan ed s ain and wis ing on he cables du ing he en i e eco ding pe iod. In o de o synch onize he ideog aphy and ECoG eco ding sys ems, we connec ed he s obe ou pu o he came a o a digi al inpu in he In an USB in e ace boa d using a GPIO cable (ACC-01-3000, Poin G ey, CA). The came a s obe ou pu is elec onically coupled o indi idual ame exposu es (i.e. shu e opening and closing e en s), and can be used o sub-millisecond eadou o indi idual ame acquisi ion imes. The s obe signal was acqui ed and digi ized synch onously wi h ECoG da a acquis- i ion, and used o pos -hoc econs uc ion o p ecise ame iming. Da a acquisi ion om he USB in e ace boa d was eco ded using a Bonsai wo kow and ca e was aken ha i was always s a ed  s and e min- a ed las in o de o ensu e ha no ex e nal synch oniza ion e en s we e los . Beha iou p o ocol: The animals we e kep in a s a e o wa e dep i a ion o 20 h p io o each daily session. Fo e e y ial, a s we e deli e ed a 20 µ L d op o wa e . A he end o each day, hey we e gi en ee access o wa e o 10 min be o e ini ia ing he nex dep i a ion pe iod. Sessions las ed o six days o he week om Monday o Sa u day, wi h a day o ee access o wa e on Sunday. Be o e he s a o he wa e dep i a- ion p o ocol, animals we e un on a single habi ua ion session whe e hey we e placed in he box o a pe iod o 15 min . 97 The ollowing sequence o condi ions we e p esen ed o he animals o e he cou se o a mon h (see also Figu e 3.1): day 0, habi ua ion o he box; day 1-4, all he s eps we e xed in a s able congu a ion; day 5, 20 ials o he s able congu a ion, a e which he wo cen e s eps we e made uns able (i.e. ee o o a e); day 6-10, he cen e wo s eps emained uns able; day 11, 20 ials o he uns able congu a ion, a e which he wo cen e s eps we e again xed in a s able s a e; day 12, all he s eps we e xed in a s able congu a ion; day 13-16, he s a e o he cen e wo s eps was andomized on a ial-by- ial basis o be ei he s able o uns able. Following he end o he andom p o ocol, animals con inued o be es ed in he assay o a a iable numbe o days (up o one week) in die en condi ions. A he end o he es ing pe iod, all animals we e exposed o a nal session whe e all s eps we e made ee o o a e in o de o assay locomo ion pe o mance unde challenging condi ions. Fo he mic o-ECoG eco dings, he basic beha iou p o ocol was ad- jus ed o allow o ex a eco ding ime du ing condi ions o in e es . Fi s , all session imes we e doubled o he eco dings (e.g. 30 min o he ha- bi ua ion session, and 60 min o all o he sessions). Second, he numbe o days on each condi ion was also ex ended o allow ex ac ing mo e i- als om each animal o analysis. Finally, he condi ion whe e he cen e wo s eps we e eliably uns able was eplaced wi h a condi ion o a e in- s abili y. In his condi ion, a e he animal is exposed o an uns able congu a ion, he s eps a e e e ed back o being s able o ano he 20 ials, a e which hey become again uns able o one ial, and so on. Da a analysis: All sc ip s and cus om code used o da a analysis a e a ailable online 1 . The aw ideo da a was  s p e-p ocessed using a cus om Bonsai wo kow in o de o ex ac ea u es o in e es (Figu e 3.3). T acking o he nose was achie ed by backg ound sub ac ion and connec ed componen labelling o segmen ed image elemen s. Fi s we 1 h ps://bi bucke .o g/kamp-lab/shu ling-analysis 98 Figu e 3.3. Example ideo ame om he beha iou acking sys em. Colou ed o e lays ep esen egions o in e es and ea u e aces ex ac ed au oma ically om he ideo. compu e he ellipse bes - o he la ges objec in he image. We hen ma k he ip o he nose as he u he mos poin , in he segmen ed shape o he animal, along he majo axis o he ellipse. In o de o analyse s epping pe o mance, egions o in e es we e dened a ound he su ace o each s ep and in he gaps be ween he s eps. Backg ound sub ac ed ac i i y o e hese egions was eco ded o e e y ame o subsequen de ec ion and classica ion o s eps and slips. Analysis ou ines we e un using he NumPy scien ic compu ing pack- age ( an de Wal , Colbe & Va oquaux, 2011) and he Pandas da a analysis lib a y (McKinney, 2010) o he Py hon p og amming language. C ossings we e au oma ically ex ac ed om he nose ajec o y da a by  s de ec ing consecu i e ime poin s whe e he nose was posi i ely iden- ied in he ideo. In o de o hese pe iods o be success ully ma ked as c ossings, he s a ing posi ion o he nose mus be loca ed on he opposi e side o he ending posi ion. Inside each c ossing, he momen o s epping wi h he o elimb on he cen e s eps was ex ac ed by looking a he  s peak abo e a h eshold in he  s de i a i e o he ac i a ion signal in 99 he co esponding egion o in e es . False posi i e classica ions due o hindlimb o ail ac i a ions we e elimina ed by en o cing he cons ain ha he posi ion o he head mus be loca ed be o e he nex s ep. Visual con ma ion o he classied imepoin s showed ha spu ious ac i a ions we e all bu elimina ed by his p ocedu e as s epping wi h he hindlimb o ail equi es he head o be u he ahead in space unless he animal u ned a ound (in which case he ajec o y would no be ma ked as a c ossing anyway). The posi ion o he nose a he momen o each s ep was ex ac ed and ound o be no mally dis ibu ed, so s a is ical analysis o he s ep pos u e in he andom condi ion used an unpai ed - es o check o independence o die en measu emen g oups. In o de o e alua e he dynamics o c ossing in he andom condi ion, we  s measu ed o e e y ial he speed a which he animals we e mo ing on each spa ial segmen o he assay. To minimize o e all ial-by- ial a ia ion in indi idual animal pe o mance, we used he a e age speed a which he animal app oached he manipula ed s ep as a baseline and sub ac ed i om he speed a each indi idual segmen . To summa ize die ences in pe o mance be ween s able and uns able ials, we hen compu ed he a e age speed p ole o each condi ion, and hen sub ac ed he a e age speed p ole o uns able ials om he a e age speed p ole o s able ials. Finally, we compu ed he sum o all hese speed die ences a e e y segmen in o de o ob ain he speedup index o each animal, i.e. an index o whe he he animal ends o accele a e o decele a e ac oss he assay on s able e sus uns able ials. Fo he mic o-ECoG expe imen s, e oked po en ials we e analysed by spli ing he aw physiological ol age aces in o 750 ms windows, whe e ime ze o was aligned o he momen o s epping wi h he o elimb on one o he obs acles in he cou se (see below). Each indi idual ime se ies was low-pass l e ed a 50 Hz (4 h o de Bu e wo h l e , wo-pass) and baselined by sub ac ing he a e age o he  s 250 ms be o e e en onse 100 in o de o compensa e o cons an ol age shi s be ween he wo g ids. Some o he channels in each g id we e en i ely excluded om he ana- lysis due o po en ially damaged su ace con ac s, as e idenced by wide ampli ude, andom oscilla o y beha iou , which was o en ma ched by he p esence o high impedance measu emen s ex ac ed om he elec ode si e in i o. In one o he sessions, he cable connec ing he heads age o he in e ace boa d was acciden ally emo ed by he animal, and all he ials alling du ing his pe iod had o be excluded om analysis. Co espond- ence be ween indi idual ECoG samples and ideo ames was compu ed by ma ching he indi idual ha dwa e ame coun e wi h he sequence o all- ing edges de ec ed in he shu e s obe signal acqui ed om he in a ed came a. Video classica ion: Classica ion o paw placemen aul s (i.e. slips) was pe o med in semi-au oma ed ashion. Fi s , possible slip imepoin s we e de ec ed au oma ically using he peak de ec ion me hod ou lined abo e. All cons ain s on head posi ion we e elaxed o his analysis in o de o exclude he possibili y o alse nega i es. A human classie hen p oceeded o manually go h ough each o he slip candida es and inspec he ideo a ound ha imepoin in o de o assess whe he he ac i a ion peak was a genuine paw placemen aul . Examples o alse posi i es include ail and head ac i a ions as well as paw ac i a ions ha occu while he animal is ac i ely engaged in explo a ion, ea ing, o o he ac i i ies ha a e un ela ed o c ossing he obs acles. A simila echnique was used o de ec and classi y he e en onse s o he analysis o e oked po en ials in he mic o-ECoG expe imen s. In his case, a p elimina y classica ion o each ideo ame in o le and igh o elimb was achie ed by  s compu ing he b igh ness his og am o each ame, which was used o encode he image as a lowe -dimensional ec o . The ec o s o all s ep ames we e subsequen ly clus e ed using K-means and hen manually inspec ed o label co ec ion. 101 Classica ion o beha iou esponses ollowing  s exposu e o he un- s able condi ion was done on a ame-by- ame analysis o he high-speed ideo aligned on  s con ac wi h he manipula ed s ep. The ame o  s con ac was dened as he  s ame in which he e is no iceable mo emen o he s ep caused by animal con ac . Th ee main ca ego - ies o beha iou we e obse ed o ollow he  s con ac : compensa ion, in es iga ion and hal ing. Beha iou sequences we e  s classied as be- longing o one o hese ca ego ies and hei onse s and ose s de e mined by he ollowing c i e ia. Compensa ion beha iou is dened by a apid and adap i e pos u al co ec ion o he locomo ion pa e n in esponse o he pe u ba ion. Onse o his beha iou is dened by he  s ame in which he e is isible apid con ac ion o he body muscula u e ollowing  s con ac . In es iga ion beha iou consis s o pe iods o a ge ed in e - ac ion wi h he s eps, o en in ol ing manipula ion o he eely mo ing obs acle wi h he o epaws. The onse o his beha iou is dened by he animal o ien ing i s head down o one o he manipula ed s eps, ollowed by subsequen in e ac ion. Hal ing beha iou is cha ac e ized by a pe iod in which he animal s ops i s ongoing mo o p og am, and main ains he same body pos u e o se e al seconds, wi hou swi ching o a new beha- iou o o ien ing specically o he manipula ed s eps. This beha iou is dis inc om a eezing esponse, as occasional mo emen s o he head a e seen. Onse o his beha iou is dened by he momen whe e locomo ion and o he mo o ac i i ies besides mo emen o he head come o a s op. A human classie blind o he lesion condi ion was gi en desc ip ions o each o hese h ee main ca ego ies o beha iou and asked o no e onse s and ose s o each beha iou h oughou he ideos. These classica ions p o ide a isual summa y o he  s esponse ideos; he comple e da ase used o his classica ion is included as supplemen a y mo ies. 102 3.4 Resul s To in es iga e whe he he in ac mo o co ex is equi ed o he obus con ol o mo emen in esponse o unexpec ed pe u ba ions, we designed a econgu able dynamic obs acle cou se whe e indi idual s eps can be made s able o uns able on a ial-by- ial basis (Figu e 3.1, also see Me h- ods). In his assay, a s shu le back and o h ac oss he obs acles, in he da k, in o de o collec wa e ewa ds. We specically designed he assay such ha modica ions o he physics o he obs acles could be made co - e ly. In his way, he animal has no explici in o ma ion abou he s a e o he s eps un il i ac ually con ac s hem. Wa e dep i ed animals we e ained daily o 4 weeks, h oughou which hey encoun e ed inc easingly challenging s a es o he obs acle cou se. Ou goal was o cha ac e ize p e- cisely he condi ions unde which mo o co ex becomes necessa y o he con ol o mo emen , and his mo i a ed us o in oduce an en i onmen wi h g aded le els o unce ain y. We compa ed he pe o mance o 22 animals: 11 wi h bila e al ibo enic acid lesions o he p ima y and seconda y o elimb mo o co ex, and 11 age and gende ma ched con ols (5 sham su ge y, 6 wild- ypes). Animals we e gi en ample ime o eco e , 4 weeks pos -su ge y, in o de o specic- ally isola e beha iou s ha a e ch onically impai ed in animals lacking he unc ions enabled by mo o co ical s uc u es. His ological examina ion o se ial co onal sec ions e ealed signican a iabili y in he ex en o dam- aged a eas (Figu e 3.4), which was likely caused by mechanical blockage o he injec ion pipe e du ing lesion induc ion a some si es. Ne e he- less, olume econs uc ion o he se ial sec ions allowed us o accu a ely quan i y he size o each lesion, iden i y each animal ( om Lesion A o Lesion K; la ges o smalles ), and use hese alues o compa e obse ed beha iou al eec s as a unc ion o lesion size. 103 p og ession heigh A s able uns able s able andom 0 1 2 3 4 5 6 7 8 p og ession (cm) s ep pos u e ac oss ials (Con ol A) B Figu e 3.8. Measu ing pos u al app oach o he obs acles. ( A ) Schema ic o pos u al analysis image p ocessing. The posi ion o he animal's nose is ex ac ed whene e he paw ac i a es he ROI o he  s manipula ed s ep (see me hods). ( B ) The ho izon al posi ion, i.e. p og ession, o he nose in single ials o one o he con ol animals s epping ac oss he die en condi ions o he shu ling p o ocol. pos u e o he animals when s epping on he obs acles changed signican ly o e ime (Figu e 3.8B, 3.9A). Specically, he cen e o g a i y o he body was shi ed u he o wa d and highe du ing la e sessions, in a manne p opo ional o pe o mance. Howe e , a e he obs acles changed o he uns able s a e, we obse ed an immedia e and pe sis en adjus men o his c ossing pos u e, wi h animals assuming a lowe cen e o g a i y and educing hei speed as hey app oached he uns able obs acles (Figu e 3.9A,B). In e es ingly, we also no iced ha a g oup o animals adop ed a die en s a egy. Ins ead o lowe ing hei cen e o g a i y, hey ei he kep i unchanged o shi ed i e en mo e o wa d and pe o med a jump o e he uns able obs acles (Figu e 3.10A,B). These wo s a egies we e ema kably consis en ac oss he wo g oups, bu he e was no co ela ion be ween he s a egy used and he deg ee o mo o co ical lesion (Figu e 110 s able uns able s able andom 1.5 1.0 0.5 0.0 0.5 1.0 1.5 2.0 2.5 p og ession (cm) * * * a e age s ep pos u e con ol lesion A 4 2 0 2 4 p og ession (cm) 40 20 0 20 40 60 80 speed (cm / s) 0 200 n = 3550 ials 0 200 400 s able uns able B 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 6 heigh (cm) 0 100 200 n = 1995 ials 0 200 s able uns able con ols C 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 6 heigh (cm) 0 50 100 n = 1555 ials 0 100 200 s able uns able lesionsD Figu e 3.9. Ra s adap hei pos u al app oach o he obs acles a e a change in physics. ( A ) A e age ho izon al posi ion o he nose ac oss he die en p o ocol s ages o bo h lesion and con ol animals. As e isks indica e he a e age nose posi ion on he 20 ials immedia ely p eceding a change in p o ocol condi ions (see ex ). ( B ) Dis ibu ion o ho izon al posi ion agains speed o he las wo days o he s able (blue) and un- s able (o ange) p o ocol s ages. ( C-D ) Dis ibu ion o nose posi ions o con ol and lesion animals o e he same sessions. 111 Con ol A s able uns able Lesion B Con ol H Lesion C A 10 15 20 25 30 35 40 p og ession (cm) 0 1 2 3 4 5 6 heigh (cm) c ossing ajec o ies (n = 21) con ol lesion B 200 250 300 350 400 450 500 550 600 650 weigh (g) 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 p (skip middle s eps) co ela ion o jumping wi h weigh con ol lesion C Figu e 3.10. Animals use die en s a egies o dealing wi h he un- s able obs acles. ( A ) Example a e age p ojec ion o all pos u e images o s able (g een) and uns able ( ed) sessions o wo non-jumpe ( op) and wo jumpe (bo om) animals. ( B ) A e age nose ajec o ies o indi- idual animals c ossing he uns able condi ion. The shaded a ea a ound each line ep esen s he 95% condence in e al. ( C ) Co ela ion o he p obabili y o skipping he cen e wo s eps wi h he weigh o he animal. 3.9C,D, 3.10C). In ac , we ound ha he use o a jumping s a egy was bes p edic ed by he body weigh o he animal (Figu e 3.10C). Du ing he wo days whe e he s able s a e o he en i onmen was eins a ed, he pos u e o he animals was g adually es o ed o p e- manipula ion le els (Figu e 3.8B, 3.9A), al hough in many cases his adjus men happened a a slowe a e han he ansi ion om s able o uns able. Again, his pos u al adap a ion was independen o he p esence o absence o o epaw mo o co ex. We nex looked in de ail a he days whe e he s a e o he obs acle cou se was andomized on a ial-by- ial basis. This s age o he p o ocol is pa icula ly in e es ing as i eec s a si ua ion whe e he en i onmen has a pe sis en deg ee o unce ain y. Fo his analysis, we we e o ced o exclude he animals ha employed a jumping s a egy, as hei expe ience wi h he manipula ed obs acles was he same i espec i e o he s a e o he wo ld. Fi s , we epea ed he same pos u e analysis compa ing all 112 he s able and uns able ials in he andom p o ocol in o de o con ol o whe he he e was any sub le cue in ou mo o ized se up ha he an- imals migh be using o gain in o ma ion abou he cu en s a e o he wo ld. The e was no signican die ence be ween andomly p esen ed s able and uns able ials on he app oach pos u e o he animal (Figu e 3.11A). Howe e , classi ying he ials on he basis o pas ial his o y e- ealed a signican eec on pos u e (Figu e 3.11B). This sugges ed ha he animals we e adjus ing hei body pos u e when s epping on he a - ec ed obs acles on he basis o hei cu en expec a ion abou he s a e o he wo ld, which is upda ed by he p e iously expe ienced s a e. Su - p isingly, his eec again did no depend on he p esence o absence o on al mo o co ical s uc u es (Figu e 3.11C,D). Finally, we decided o es whe he gene al mo o pe o mance was a - ec ed by he andomized s a e o he obs acles. I he animals do no know wha s a e he wo ld will be in, hen he e will be an inc eased challenge o hei s abili y when hey c oss o e he uns able obs acles, possibly de- manding a quick change in s a egy when hey lea n whe he he wo ld is s able o uns able. In o de o e alua e he dynamics o c ossing, we compa ed he speed p ole o each animal ac oss hese die en condi ions (Figu e 3.12, see Me hods). In e es ingly, wo o he animals wi h he la ges lesions appea ed o be signican ly slowed down on uns able ials, while con ols and he animals wi h he smalles lesions ins ead ended o accele a e a e encoun e ing an uns able obs acle. Howe e , he o e all eec o lesions e sus con ols was no s a is ically signican (Figu e 3.12C). Ne e heless, we we e in igued by his obse a ion and decided o in es iga e, in de ail, he  s momen in he assay when a pe u ba ion is encoun e ed. In he andom p o ocol, e en hough he s a e o he wo ld is unp edic able, he animals know ha he obs acles migh become uns able. Howe e , he e y  s ime he en i onmen becomes uns able, 113 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 heigh (cm) 0 200 400 p = 0.296 n = 3562 ials 0 500 s able uns able cu en s a e A 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 heigh (cm) 0 100 p = 4.3e-13 n = 1717 ials 0 200 400 p e ious s able p e ious uns able p e ious s a e B 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 heigh (cm) 0 100 p = 4.87e-06 n = 1018 ials 0 100 200 p e ious s able p e ious uns able con ols C 4 2 0 2 4 p og ession (cm) 4 2 0 2 4 heigh (cm) 0 50 p = 1.12e-09 n = 699 ials 0 100 p e ious s able p e ious uns able lesions D Figu e 3.11. Animals adjus hei pos u e on a ial-by- ial basis o he expec ed s a e o he wo ld. ( A ) Dis ibu ion o nose posi ions on he andomized p o ocol when s epping on he  s manipula ed obs acle, o ials in which he cu en s a e was s able (blue) o uns able (o ange). ( B ) Dis ibu ion o nose posi ions o ials in which he p e ious wo ials we e s able (blue) o uns able (o ange). ( C-D ) Same da a as in ( B ) spli by he con ol and lesion g oups. p alues om S uden 's unpai ed - es a e indica ed. 114 15 10 5 0 5 10 15 20 25 p og ession (cm) 20 10 0 10 20 30 speed (cm/s) a e age speed (Con ol A) s able uns able 15 10 5 0 5 10 15 20 25 p og ession (cm) 20 10 0 10 20 30 speed (cm/s) a e age speed (Lesion B) s able uns able con ol lesion 100 50 0 50 100 150 200 speedup (cm/s) p = 0.18 speed p o ile di e ence A B C Figu e 3.12. Encoun e ing die en s a es o he andomized obs acles causes he animals o quickly adjus hei mo emen ajec o y. ( A ) Ex- ample a e age speed p ole ac oss he obs acles o s able (blue) and un- s able (o ange) ials in he andomized sessions o a con ol animal (see ex ). The shaded a ea a ound each line ep esen s he 95% condence in e al. ( B ) Respec i ely o one o he la ges lesions. ( C ) Summa y o he a e age die ence be ween he speed p oles o s able and uns able ials ac oss he wo g oups o animals. E o ba s show s anda d e o o he mean. p alue om S uden 's unpai ed - es is indica ed. he collapse o he obs acles is comple ely unexpec ed and demands an en i ely no el mo o esponse. A de ailed analysis o he esponses o he  s collapse o he s eps e ealed a s iking die ence in he s a egies deployed by he lesion and con ol animals. Upon he  s encoun e wi h he manipula ed s eps, we obse ed h ee ypes o beha iou al esponses om he animals (Video 3.6): in es iga ion, in which he animals immedia ely s op hei p og ession and o ien owa ds, whisk, and physically manipula e he al e ed obs acle; compensa ion, in which he animals apidly adjus hei beha iou o nego- ia e he unexpec ed ins abili y; and hal ing, in which he ongoing mo o p og am ceases and he animals' beha iou simply comes o a s op o se e al seconds. Rema kably, hese esponses depended on he p esence o absence o mo o co ex (Figu e 3.13). Animals wi h he la ges mo o co ical lesions, upon hei  s encoun e wi h he no el en i onmen al 115 0.0 0.5 1.0 1.5 2.0 2.5 3.0 im el om l i s lcon ac l(s) Lk Lj Li Lh Lg L Le Ld Lc Lb La Ck Cj Ci Ch Cg C Ce Cd Cc Cb Ca e hog am lo l i s lcon ac lwi hlm anipula edl ail Con ols Lesions Fi s lCon ac in es iga ion compensa ion hal ing no mallmo ion Δ AB Figu e 3.13. Responses o an unexpec ed change in he en i onmen . ( A ) Response ypes obse ed ac oss indi iduals upon  s encoun e ing an un- p edic ed ins abili y in he s a e o he cen e obs acles. ( B ) E hog am o beha iou al esponses classied acco ding o he h ee c i e ia desc ibed in ( A ) and aligned (0.0) on  s con ac wi h he newly manipula ed obs acle. Black dashes indica e when he animal exhibi s a p onounced ea ick. Whi e indica es ha he animal has c ossed he obs acle cou se. obs acle, hal ed o se e al seconds, whe eas animals wi h an in ac mo o co ex, and hose wi h he smalles lesions, we e able o apidly eac wi h ei he an in es iga o y o compensa o y esponse (Video 3.7,3.8). The esponse o animals wi h ex ended lesions was e en mo e s iking. In wo o hese animals, he e was a ailu e o ecognize ha a change had occu ed a all (Video 3.9). Ins ead, hey kep walking ac oss he now uns able s eps o se e al ials, ne e s opping o assess he new si u- 116 a ion. One o hem g adually no iced he manipula ion and s opped his p og ession, while he o he one only ully ealized he change a e inad- e en ly hi ing he s eps wi h i s snou (Video 3.9: Ex ended Lesion A). This was he  s ime we e e obse ed his beha iou , as all animals wi h o wi hou co ical lesions always displayed a clea swi ch in beha iou al s a e ollowing he  s encoun e wi h he manipula ion. In he emaining animals wi h ex ended lesions, wo o hem clea ly hal ed hei p og ession ollowing he collapse o he obs acles, in a way simila o he la ge mo o co ex ibo enic lesions (Video 3.10). The hi d animal (Ex ended Lesion B) ac ually collapsed upon con ac wi h he manipula ed s ep, alling o e i s paw and digi s awkwa dly and hi ing he obs acles wi h i s snou . Sho ly a e his he e was a swi ch o an explo a o y beha iou s a e, in a way simila o Ex ended Lesion A. Towa ds a neu obiological basis o obus esponses In o de o in es iga e he neu ophysiological co ela es o hese obus e- sponses in he mo o co ex, in h ee animals we implan ed exible su ace elec ode g ids abo e he du a in one hemisphe e o he in ac b ain (Figu e 3.15A, also see Me hods). Each s ep o he obs acle cou se was ou  ed wi h a load cell senso o measu e he p ecise iming o con ac and he amoun o weigh placed on each limb du ing locomo ion. The en i e elec- oco icog aphy (ECoG) sys em was synch onized on a ame-by- ame basis wi h he high-speed ideo acquisi ion so we could econs uc he de ailed beha iou o he animal a any poin o he physiological ace as well as ela e he con inuous load p ole on indi idual s eps wi h die en phases in he locomo ion cycle (Figu e 3.14). We  s asked whe he he e we e esponses in he ECoG signal o e o elimb mo o co ex ha we e modula ed by s epping beha iou . Align- ing he ECoG aces o he e en o s epping on a pe manen ly s able s ep wi h he con ala e al paw e ealed he dis inc p esence o an e oked po- 117 0.0 0.1 0.2 0.3 0.4 0.5 0.6 ime (s) 0 1 2 3 4 5 6 load (A.U.) Figu e 3.14. Example load cell ac i a ion p ole du ing s epping on a ung. en ial on he an e io g id channels ha was absen when s epping wi h he ipsila e al paw (Figu e 3.15B, op ace). On close inspec ion, i could be seen ha he beginning o he nega i e deec ion sligh ly p ecedes he ime o con ac wi h he s ep, sugges ing a non-senso y con ibu ion o he e oked esponse. Synap ic ac i i y in he long and hick apical dend- i es o py amidal cells a e hough o be one o he main con ibu o s o co ically eco ded ex acellula eld po en ials (Buzsáki, Anas assiou & Koch, 2012). In he ca , a sizeable p opo ion o py amidal ac neu - ons in he mo o co ex ha e been ound o discha ge hy hmically du ing unimpeded locomo ion (A ms ong & D ew, 1984; D ew, Jiang, Kably & La oie, 1996), a phenomenon ha is e y likely o be coupled wi h ob- se able synap ic ac i i y in he po en ial aces and could accoun o he s ep-aligned e oked esponses ha we obse ed du ing locomo ion o a s in he s able obs acle cou se. 118 Nex , we asked whe he he e was any modula ion o he e oked e- sponse when na iga ing he uns able obs acle cou se. In o de o y and maximize he numbe o ials in which he encoun e wi h he uns able s ep is unexpec ed, we adjus ed he beha iou al p o ocol a he ans- i ion be ween he s able and uns able es pe iods. This ime, ins ead o pe manen ly swi ching he cen e s eps o he uns able congu a ion, we decided o immedia ely e e he s eps back o he s able s a e a e he  s exposu e o he ins abili y. A e 20 subsequen ials in he s able s a e, he s eps we e again made uns able, and his pa e n was epea ed o se e al days. Su p isingly, when we aligned he ECoG aces o con ala e al paw s eps on he manipula ed obs acle in uns able ials, we obse ed a second e oked nega i i y, delayed in ime ela i e o he p e iously obse ed s able s ep e oked esponse, and wi h a much la ge ampli ude ac oss he channels in he an e io g id (Figu e 3.15B, middle le ace). Rema kably, e en in he p esence o such a small numbe o ials, he consis ency o he esponse in e e y ial p o ided a good enough signal- o-noise a io o he a e age esponse o be clea ly isible. In e es ingly, his nega i i y was ound o be apidly ollowed by an equally la ge posi i e deec ion in he po en ial which decayed o baseline wi h a much la ge ime cons an , a esponse ha was en i ely absen om he e oked po en ial o s epping on a s able s ep. In con as , he esponse o uns able s eps wi h he ipsila e al paw did no e eal such la ge deec ions om he baseline, al hough a consis en nega i i y could s ill be seen ac oss he g id a ound he same ime poin (Figu e 3.15B, middle igh ace). The ampli ude and iming o e oked esponses when s epping wi h he con ala e al paw on he same manipula ed s ep in s able ials was la gely iden ical o he condi ion whe e he s ep was pe manen ly s able, and again was ound o be absen when s epping wi h he ipsila e al paw (Figu e 3.15B, bo om ace). 119 McKinney, W. (2010). Da a S uc u es o S a is ical Compu ing in Py- hon. P oceedings o he 9 h Py hon in Science Con e ence , 5156. Me z, G. A. & Whishaw, I. Q. (2002). Co ical and subco ical lesions impai skilled walking in he ladde ung walking es : a new ask o e alua e o e- and hindlimb s epping, placing, and co-o dina ion. Jou nal o neu oscience me hods , 115 (2), 16979. Meye , P. M. & Meye , D. R. (1971). Neu osu gical p ocedu es wi h special e e ence o aspi a ion lesions. In R. D. Mye s (Ed.), Me hods in psychobiology, ol. i (pp. 91130). London: Academic P ess. Mille , M. W. (1987). The o igin o co icospinal p ojec ion neu ons in a . Exp B ain Res , 67 (2), 339351. doi:10.1007/BF00248554 O chy, T. M., Wol, S. B. E., Rhee, J. Y., Pehle an, C., Kawai, R., Kemp , A., Gobes, S. M. H. & Öl eczky, B. P. (2015). Acu e o- a ge eec s o neu al ci cui manipula ions. Na u e . doi:10.1038/na u e16442 Phillips, C. G. (1969). The Fe ie Lec u e, 1968: Mo o Appa a us o he Baboon's Hand. P oceedings o he Royal Socie y B: Biological Sciences , 173 (1031), 141174. doi:10.1098/ spb.1969.0044 Schindelin, J., A ganda-Ca e as, I., F ise, E., Kaynig, V., Longai , M., Pie zsch, T., P eibisch, S., Rueden, C., Saal eld, S., Schmid, B., Tine ez, J.-Y., Whi e, D. J., Ha ens ein, V., Elicei i, K., Tomancak, P. & Ca dona, A. (2012). Fiji: an open-sou ce pla o m o biological- image analysis. Na u e me hods , 9 (7), 67682. doi:10.1038/nme h. 2019 Schwa cz, R., Hök el , T., Fuxe, K., Jonsson, G., Golds ein, M. & Te enius, L. (1979). Ibo enic acid-induced neu onal degene a ion: A mo pholo- gical and neu ochemical s udy. Expe imen al B ain Resea ch , 37 (2), 199216. doi:10.1007/BF00237708 an de Wal , S., Colbe , S. C. & Va oquaux, G. (2011). The NumPy A ay: A S uc u e o Ecien Nume ical Compu a ion. Compu ing in Science & Enginee ing , 13 (2), 2230. doi:10.1109/MCSE.2011.37 126 Wa son, B. D., Die ich, W. D., Bus o, R., Wach el, M. S. & Ginsbe g, M. D. (1985). Induc ion o ep oducible b ain in a c ion by pho o- chemically ini ia ed h ombosis. Annals o Neu ology , 17 (5), 497 504. doi:10.1002/ana.410170513 Whishaw, I. Q. (2000). Loss o he inna e co ical eng am o ac ion pa - e ns used in skilled eaching and he de elopmen o beha io al com- pensa ion ollowing mo o co ex lesions in he a . Neu opha maco- logy , 39 (5), 788805. doi:10.1016/S0028-3908(99)00259-2 127 Chap e 4 Ex ended Discussion Le us ake a couple o examples om physical cul u e and spo s. Downhill skiing and slalom make high demands on a skie 's dex e i y. Wha is he die ence be ween slalom and plain c oss-coun y skiing, which does no equi e any pa icula dex e i y? I is in a conglome a e o unexpec ed, unique complica ions in he ex e nal si ua ion, in a quick succession o mo o asks ha a e all unlike each o he . Nicholai A. Be ns ein , Dex e i y and i s De elopmen (1996) 129 4.1 Chap e Summa y We p opose a new ole o mo o co ex: ex ending he obus ness o sub- co ical mo emen sys ems, specically o unexpec ed si ua ions demand- ing apid mo o esponses adap ed o en i onmen al con ex . The implic- a ions o his idea o cu en and u u e esea ch a e discussed. 130 4.2 A challenge om obo ics Is  obus con ol a p oblem wo hy o high le el co ical inpu ? Reco - e ing om a pe u ba ion, o main ain balance o minimize he impac o a all, is a ole no mally assigned o ou lowe le el pos u al con ol sys ems. The co ec i e esponses embedded in ou spinal co d (She ing- on, 1893, 1910), b ains em (A shian e al., 2014) and midb ain (G illne & Shik, 1973) a e clea ly impo an componen s o his s abilizing ne - wo k, bu a e hey sucien o main ain obus mo emen in he dynamic en i onmen s ha we encoun e on a daily basis? Some insigh in o he equi emen s o a obus con ol sys em can be gained om enginee ing a emp s o build obo s ha na iga e in na u al en i onmen s. In he eld o obo ics, ea s o p ecision and ne mo emen con ol ( he mos commonly p esc ibed ole o mo o co ex), a e no a majo sou ce o dicul y. Indus ial obo s ha e long since exceeded human pe - o mance in bo h accu acy and execu ion speed (Senoo e al., 2009). Mo e ecen ly, using ein o cemen lea ning me hods, hey a e now able o au o- ma ically lea n ecien mo emen s a egies, gi en a human-dened goal and many epea ed ials o ne- uning (Coa es, Abbeel & Ng, 2008). Wha hen a e he ha d p oblems in obo ic mo o con ol? Why a e mos obo s s ill conned o ac o ies, i.e. con olled, p edic able en i onmen s? The eason is ha as soon as a obo encoun e s na u al e ain, a as numbe o p e iously unknown si ua ions a ise. The esul ing pe u b- a ions a e deal wi h poo ly by he s a is ical machine lea ning models ha a e cu en ly used o ain obo s in con olled se ings. Le 's conside a amilia example: You a e up ea ly on a Sunday mo n- ing and head ou side o collec he newspape . I is cold ou , so you pu on a obe and some slippe s, open he on doo , and descend he s eps leading down o he s ee in on o you house. Unbeknowns o you, a hin laye o ice has o med o e nigh and you oo is now quickly sliding 131 ou om unde nea h you. You a e abou o all. Wha do you do? Well, his depends. Is he e a ailing you can g ab o ca ch you sel ? We e you ca ying a cup o coee? Did you no ice he os on he lawn and s ep cau iously, an icipa ing a slippe y su ace? A oiding a dange ous all, o eco e ing g ace ully, equi es a ich knowledge o he wo ld, knowledge ha is no immedia ely a ailable o spinal o e en b ains em ci cui s. This ich con ex ele an o obus mo emen is eadily a ailable in co ex, and co ex alone. Imagine now ha you a e asked wi h building a obo o collec you mo ning newspape . This obo , in o de o a oid a ca as ophic and cos ly ailu e, would need o ha e all o his con ex ual knowledge as well. I would need o know abou he s uc u e o he local en i onmen (e.g. hand ailings ha can suppo i s weigh ), ho liquids and hei iscosi ies, and e en he co ela ion o ozen dew wi h icy su aces. To be a uly obus mo emen machine, a obo mus unde s and he physical s uc u e o he wo ld. Mo eo e , i needs o unde s and i in abou 100 ms a e i s  oo  s a s o slip. Reaching o s op a all while holding a cup o coee is no exac ly he kind o ea o which we p aise ou a hle es and spo s champions, and his migh explain why he dicul y o such  ea s o obus ness is o en o e looked. Howe e , i would no be he  s ime ha we nd ou sel es humbled by he daun ing complexi y o a p oblem ha we nai ely assumed was  i ial. Vision, o example, has emained an imp essi ely ha d ask o a machine o sol e a human-le el pe o mance, ye i was o iginally p oposed as an unde g adua e summe p ojec (Pape , 1966). Pe haps a simila mises ima e has clouded ou designa ion o he ha d mo o con ol p oblems wo hy o co ical inpu . Inspi ed by he challenges con on ing obo icis s, as well as ou oden beha iou al esul s, we a e now in a posi ion o posi a new ole o mo o co ex. 132 4.3 A p imo dial ole o mo o co ex We a e seeking a ole o mo o co ex in non-p ima e mammals, animals ha do no equi e his s uc u e o o e mo emen p oduc ion. The s uggles o obo icis s highligh he dicul y o building mo emen sys- ems ha obus ly adap o unexpec ed pe u ba ions, and he esul s we epo in his s udy sugges ha his is, indeed, he mos conspicuous deci o a s lacking mo o co ex. So le us p opose ha , in oden s, mo o co ex is p ima ily esponsible o ex ending he obus ness o he subco ical mo emen sys ems. I is no equi ed o con ol in s able, p edic able, non-pe u bing en i onmen s, bu ins ead specically exe s i s inuence when unexpec ed challenges a ise. This, we p opose, was he o iginal selec i e p essu e o e ol ing a mo o co ex, and hus, i s p imo dial ole. This ole pe sis s in all mammals, media ed ia a modu- la ion o he subco ical mo o sys em (as is emphasized in s udies o ca locomo ion), and has e ol ed in p ima es o include di ec con ol o he skele al muscula u e. Ou p oposal o a  obus  eleology o mo o co ex has a numbe o in e es ing implica ions. 4.4 Implica ions o non-p ima e mammals One o he mos imp essi e ai s o mammals is he as ange o en i on- men al niches ha hey occupy. While mos o he animals adap o change o e e olu iona y ime scales, mammals excel in hei exibili y, quickly e alua ing and esponding o unexpec ed si ua ions, and aking isks e en when aced wi h challenges ha ha e ne e been p e iously encoun e ed (Spinka, Newbe y & Beko, 2001). This success equi es mo e han p e- cision, i equi es esou ce ulness: he abili y o quickly come up wi h a mo o solu ion o any si ua ion and unde any condi ion (Be ns ein, 1996). The Russian neu ophysiologis Be ns ein e e ed o his abili y wi h an 133 uncon en ional deni ion o dex e i y, which he conside ed o be dis inc om a simple ha mony and p ecision o mo emen s. In his wo ds, dex e - i y is equi ed only when he e is `a conglome a e o unexpec ed, unique complica ions in he ex e nal si ua ions, [such as] in a quick succession o mo o asks ha a e all unlike each o he ' (Be ns ein, 1996). I Be ns ein's  obus dex e i y is he p ima y ole o mo o co ex, hen i becomes clea why he eec s o lesions ha e hus a been so ha d o cha ac e ize: assays o mo o beha iou ypically e alua e si ua ions ha a e epea ed o e many ials in a s able en i onmen . Such epea ed asks we e use ul, as hey oe imp o ed s a is ical powe o quan ica ion and compa ison. Howe e , we p opose ha hese condi ions specically exclude he scena ios o which mo o co ex o iginally e ol ed. I is no easy o epea edly p oduce condi ions ha animals ha e no p e iously encoun e ed, and he challenges in analysing hese unique si ua ions a e conside able. The assay epo ed he e ep esen s ou  s a emp a such an ex- pe imen , and i has al eady e ealed ha such condi ions may indeed be necessa y o isola e he ole o mo o co ex in oden s. We hus p opose ha neu oscience should pu sue simila assays, emphasizing unexpec ed pe u ba ions and no el challenges, and we ha e de eloped new ha dwa e and so wa e ools o make hei design and implemen a ion much easie (Chap e 2). 4.5 Implica ions o p ima e s udies In con as o o he mammals, p ima es equi e mo o co ex o he di ec con ol o mo emen . Howe e , do hey also e ain i s ole in gene a ing obus esponses? The gene al pa esis, o e en pa alysis, ha esul s om mo o co ical lesions in hese species obscu es he in ol emen o co ex in di ec ing apid esponses o pe u ba ions. Ye he e is e idence ha a 134 ole in obus con ol is s ill p esen in p ima es, including humans. Fo example, s oke pa ien s wi h pa ial lesions o he dis ibu ed mo o co - ical sys em will o en eco e he abili y o mo e he aec ed muscula u e. Howe e , e en a e eco e ing mo emen , s oke pa ien s a e s ill p one o se e e impai men s in obus con ol: unsuppo ed alls a e one o he lead- ing causes o inju y and dea h in pa ien s su i ing mo o co ical s oke (Jacobs, 2014). We hus sugges ha s oke he apy, cu en ly ocused on egaining di ec mo emen con ol, should also conside s a egies o imp o ing obus esponses. E en i we acknowledge ha a p imo dial ole o mo o co ex is s ill appa en in p ima e mo emen con ol, i emains o be explained why he mo o co ex o hese species acqui ed di ec con ol o basic mo emen s in he  s place. This is an open ques ion. 4.6 Some specula ion on he ole o di ec co ical con ol Wha happens when co ex acqui es di ec con ol o mo emen ? Fi s , i mus lea n how o use his inuence, bypassing o modi ying lowe mo e- men con olle s. While unc ional co icospinal ac connec ions may be es ablished p ena ally (Ey e, Mille , Clow y, Conway & Wa s, 2000), he enemen o co icospinal dependen mo emen s, which mus o e ide he lowe mo o sys em, akes much longe and coincides wi h he leng hy ma - u a ion pe iod o co icospinal e mina ion pa e ns (Law ence & Hopkins, 1976). Humans equi e yea s o p ac ice o p oduce and ene basic loco- mo ion and g asping (Thelen, 1985; on Ho s en, 1989), mo o beha iou s ha a e a ailable o o he mammals almos immedia ely a e bi h. This may be he cos o gi ing co ex di ec con ol o mo emen i akes mo e ime o gu e ou how o mo e he bodybu wha is he bene ? 135