AI in neuroscience research

The field of neuroscience is rapidly evolving, and with the help of artificial intelligence (AI), it has the potential to grow even faster. The use of AI in neuroscience research, particularly in preclinical academic research, can help researchers gain new insights into the complex workings of the brain, ultimately leading to new treatments and cures for neurological disorders. In this blog post, we will explore some of the potential uses of AI in neuroscience research.

1. Data Analysis and Interpretation

One of the biggest challenges in neuroscience research is the analysis and interpretation of large and complex datasets. With the help of AI, researchers can automate data analysis, allowing them to quickly identify patterns, make predictions, and draw conclusions. This can save researchers significant amounts of time and help them to identify potential areas of interest.

2. Disease Modeling

AI can be used to create models of neurological disorders, allowing researchers to better understand the mechanisms behind the diseases. This can help in the development of new treatments and therapies for conditions such as Alzheimer’s disease, Parkinson’s disease, and multiple sclerosis. By modeling these diseases, researchers can also identify potential targets for drug development and test the efficacy of new treatments.

3. Brain-Computer Interfaces

Brain-computer interfaces (BCIs) are devices that allow humans to control computers and other devices using only their thoughts. AI can be used to analyze brain signals and improve the accuracy and reliability of BCIs. This can have significant applications in the medical field, allowing individuals with neurological disorders or injuries to regain control of their limbs or communicate with others.

4. Drug Discovery

AI can help accelerate drug discovery by predicting the efficacy of potential drug candidates and identifying new targets for drug development. This can help reduce the time and cost of drug development, ultimately leading to faster and more effective treatments for neurological disorders.

5. Personalized Medicine

Finally, AI can help to personalize medicine by identifying the most effective treatments for individual patients based on their unique genetics and physiology. This can help reduce the risk of adverse reactions and improve patient outcomes.

In conclusion, AI has the potential to revolutionize neuroscience research by providing new tools and insights into the complex workings of the brain. While there are still challenges to overcome, such as the need for high-quality datasets and ethical considerations, the use of AI in preclinical academic research can lead to new treatments and cures for neurological disorders, ultimately improving the lives of millions of people worldwide.

Ok, now let me tell you a secret: that wasn’t written by me, but by AI. Specifically ChatGPT. If you haven’t heard of it, ChatGPT is an AI chatbot. It has advanced natural language processing (NLP) abilities, which means that you can write a question and it will answer.

For the above example, I prompted ChatGPT to “Write a blog post about the potential uses of AI in neuroscience research, particularly preclinical academic research.” You can really ask it to do anything, with whatever restrictions, and it will do it. It’s really quite impressive.

There are some caveats, though. It isn’t always factually correct. And in fact, if you ask it to write something scientific, it might invent (plausible-sounding) citations. So, beware of copying the output indiscriminately.

Other developers have used the GPT framework to build AI chatbot tools. There are loads coming out all the time, so I won’t list them. But I will mention one that I found interesting, called VenturusAI, which analyses a business idea.

I’ll just wrap up by saying that I am not an AI expert, hence I won’t be doing a deep analysis on it. But it is a fascinating field of technology that I’m sure will play an ever increasing role in research, as well as in other aspects of our lives.

I also promise not to use AI to write any more of my blog posts for me. It’s cheating.

Practical uses of 3D printing in an electrophysiology lab

I have mentioned before about my 3D printer, and how useful I have found it. Today, I’ll explain some of the practical uses I’ve found for 3D printing for electrophysiology. The point is that electrophysiology equipment is both extortionately expensive and annoyingly non-compatible. So, it is often quicker, cheaper and easier to design and print a “thing” than try to buy something to fit your particular need.

Build-a-bath workshop

A year or two ago, I was setting up our third (at the time unused) rig for calcium imaging. We had various bits of baths, but no complete set. And it would cost a (relatively) large sum of money to buy a replacement. I found that what I was missing was the “bath” bit (I had the holder). So I measured up one of our existing ones and designed a reasonable copy in Autocad:

3D design for an electrophysiology bath insert.

My printer was able to make it with a very smooth base, which is the crucial aspect for obtaining a watertight seal. I installed it on the calcium imaging rig, it worked well, and is still in use there to this day. Oh, and for anyone who’s interested, I have made the 3D design available on Thingiverse.

Moving an LED

My loyal readers will know that it was around this time that the light source for the calcium rig died. A replacement LED source would cost anywhere from £3k to £15k, depending on how many colours I wanted access to. However, we had animals ready for experiments at the time, and even if we had the money, it could take weeks for new kit to arrive.

Luckily, we had a blue LED of the correct wavelength attached to one other rigs, that was no longer needed there. I had purchased it to do optogenetic stimulation, but we had switched opto’s to the third rig.

Anyway, this seemed like an easy fix, just swap it over. But of course, it’s never that easy. Because, I wanted to move the LED from an Olympus microscope to a Zeiss. And the manufacturers do not make it easy on the consumer by having common fittings.

So, I measured up the fitting on the LED and the back of the Ziess fluorescence port. I then designed a 2-part “sleeve” that would modify the Zeiss port to resemble the back of an Olympus:

3D design for an Olympus-to-Zeiss microscope fluorescence adapter.

I used cable ties to hold it on tight to the Zeiss fluorescence port. The benefit of cable ties over something more permanent like glue is that they can just be cut off if/when the LED wants changing. The LED now fitted snugly onto the back of the microscope, and, after some fiddling with the data and control connections, was now fully functional for calcium imaging.

A “lab things” service

The main point I want readers to take away from this post is the usefulness of 3D printing for electrophysiology labs. I would strongly recommend anyone reading this who performs a practical skill in the lab like electrophysiology to consider investing in a 3D printer. They are actually quite cheap nowadays (mine was about £250 a few years ago), and I’m sure they’ll save you a lot of time and money in the long run.

In fact, the biggest investment to 3D printing things yourself is the time it takes to learn 3D CAD software and optimising the 3D print process itself. So, if you want something custom making, but would prefer not to have to figure it out yourself, just head over to the Services page and send a request. You never know, I might well be able to save you a lot of time, effort and money.

Validating in vivo optogenetics LED systems

One of the most challenging aspects of starting in vivo optogenetics is the equipment. In particular, how do you know which optogenetics stimulation systems will work for your purpose? I’m a big fan of LED’s, because of how cheap and easy they are to use compared with lasers. However, the high degree of scattering can make it challenging to obtain sufficient brightness for in vivo optogenetics.

Today, I will be investigating the most common commercially available in vivo optogenetics LED systems. Specifically, predicting the effective stimulation depth of their LED’s against the most commonly used opsins.

See below the opsins I’m investigating, along with the peak wavelengths and typical activation thresholds. Included are the papers I referenced for the irradiance thresholds.

Stimulation wavelength and irradiance threshold for common opsins.

Now I have the reference values to aim for. Next step is to check the manufacturers’ websites for light power output from their in vivo optogenetics LED systems, find the most appropriate LED for each opsin, and run it through the Depth calculator.

A brief note on my analysis: I use the published fibre characteristics from each vendor and estimate effective stimulation depth in “mixed” brain matter. In each case, I have picked the nearest/brightest LED to the opsin. I have also colour coded the reported stimulation depths to give an easy indication of experimental effectiveness.

Plexon

I purchased the Plexbright system back in 2016, and it has worked well for activation of blue-responsive opsins. They also sell a wide range of colours to target different opsins. I have picked out their reported light power output from a 200 µm 0.66 NA fibre:

Effective stimulation depth for Plexon Plexbright LED's for a range of common opsins.

Really only the blue 465 nm LED is bright enough to have a stimulation depth approaching 1 mm for classic opsins. stGtACR2 and ChRmine are so super sensitive you can easily stimulate them even with relatively dim LED’s. Hence why they are the favourites for people wanting to do bidirectional optogenetics or with wireless opto’s7.

Prizmatix

The Prizmatix UHP LED is the other in vivo optogenetics LED system that I have used (purchased by a collaborator). Again, I’ve only used the blue LED, which worked well. I have picked out their reported light power output from a 200 µm 0.66 NA fibre:

Effective stimulation depth for Prizmatix UHP LED's for a range of common opsins.

Same as Plexon, the blue LED is the best. Although, in this case the green 520 nm LED provides decent activation of inhibitory eOPN3.

Doric

Doric are well known for their photometry system, maybe not so much for in vivo optogenetics. They only sell a high powered in vivo optogenetics LED in blue. This time, the reported power values are from a 0.63 NA fibre:

Effective stimulation depth for Doric optogenetics LED's for a range of common opsins.

Mightex

Mightex make a wide array of optogenetics equipment. Their in vivo LED’s are reported from a 400 µm 0.22 NA fibre:

Effective stimulation depth for Mightex optogenetics LED's for a range of common opsins.

A caveat for these Mightex figures: their published power output figures weren’t explicitly clear that the power is from the end of an optic fibre cannula. It’s possible they are reporting the output from the optic cable, which means the experimentally usable value will be lower.

So which system should you buy?

I think it’s clear from my analysis here that most of the optogenetics LED systems you can buy for in vivo optogenetics are, quite simply, not fit for purpose. And I have only selected the most relevant wavelengths for my analysis; most of the vendors sell a much wider range of colours.

Effective stimulation depth for optogenetics LED's for a range of common opsins.

Looking at the effective stimulation depth, I can understand if people would want to use stGtACR2 and ChRmine, and forget about any other opsins. However, those come with their own limitations: stGtACR2 is soma targeted, so you can’t investigate circuits, while ChRmine has super slow kinetics which makes it unusable for many optogenetic applications. My point here is to be careful with your selection of equipment and opsins to match your experimental requirements.

I will happily recommend Plexon’s Plexbright LED’s and Prizmatix UHP LED’s for in vivo optogenetic stimulation for blue wavelengths. If you get those and use ChR2(h134r) for activating and stGtACR2 for inhibiting neurones, you should be fine. For other colours or other opsins? It’s not so clear cut. Currently, the best option is probably to buy a laser. In fact, Doric sell an interesting thing called a Liser, which is kind of like a hybrid between and LED and a laser, and I would definitely investigate it for non-blue opto’s.

1. Mattis et al. Nat Methods 9(2), 159-172 (2012) Principles for applying optogenetic tools derived from direct comparative analysis of microbial opsins

2. Mahn et al. Nat Comms 9, 4125 (2018) High-efficiency optogenetic silencing with soma-targeted anion-conducting channelrhodopsins

3. Mahn et al. Neuron 109, 1621-1635 (2021) Efficient optogenetic silencing of neurotransmitter release with a mosquito rhodopsin

4. Marshel et al. Science 365, eaaw5202 (2019) Cortical layer–specific critical dynamics triggering perception

5. Klapoetke et al. Nat Methods 11(3), 338-346 (2014) Independent optical excitation of distinct neural populations

6. Chuong et al. Nat Neurosci 17(8), 1123-1129 (2014) Noninvasive optical inhibition with a red-shifted microbial rhodopsin

7. Li et al. Nat Comms 13, 839 (2022) Colocalized, bidirectional optogenetic modulations in freely behaving mice with a wireless dual-color optoelectronic probe

A Lamplight in dark places

Since its discovery over 15 years ago, optogenetics has exploded in popularity in research. Along with this increase in interest and use has been a coincident profusion of optogenetic tools. This includes excitatory and inhibitory opsins across a wide range of timescales and light sensitivities.

Optogenetics publications have been increasing for the past 15 years.

However, one type of opsin that has consistently failed to present itself is a long-term super-sensitive optogenetic silencer. All the *good* inhibitory opsins have very fast kinetics and low sensitivity in the 3-5 mW/mm2 range.

A recent paper by Rodgers et al. changes all that1. They have discovered a novel opsin from the lamprey, which they have named “Lamplight”. It’s a Gi-coupled receptor (unlike most opsins which are light-responsive channels), which means that it is slower to signal but orders of magnitude more sensitive. In fact, its EC50 of 2.4 µW/mm2 is 1000-fold more sensitive than the classic inhibitory opsins like Arch and eNphR3.0.

However, as always, the sensitivity of an opsin is inversely correlated to its kinetics. Therefore, and as expected, Rodgers et al. show that Lamplight has a long and slow activation time (little to no diminishing of effect after 90 seconds). In addition to its extremely high sensitivity, Lamplight also has some other interesting qualities (Figure 1):

  • Scalable response – increasing light levels will produce a higher (stable) response from the opsin.
  • Switchable – the opsin is activated by 405 nm light and inhibited by 525 nm light. This has the added benefit that it won’t be accidentally activated by ambient light, which has much more green than UV

It should also be noted that Lamplight will limit neuronal damage, both by phototoxicity and electrophysiological. Normal opsins can stress (and potentially damage) neurones following chronic activation. This is not an issue with Gi signalling, you really can’t overactivate it.

Based on these unique characteristics, I can imagine Lamplight being a useful opsin for specific uses:

  • Extremely sensitive and longterm inhibition would be useful for use with lower power output wireless optogenetics, or for a single-stim inhibition that could work similarly to injecting CNO with inhibitory DREADDs.
  • Scalable inhibition for probing relative importance of a neurone population to mediate different behaviours/physiology. For example, we had an experiment where increasing the ChR2 stimulation frequency would shift the response from increasing glucose levels to aggressive/escape behaviour.
  • Using 2-colour opto stimulation to turn neurone populations on/off over medium-long term time scales.

Overall, I think this is an interesting opsin with potentially important applications for in vivo research. It is not yet available on Addgene, so anyone who is interested in this opsin should contact the lead author Rob Lucas.

1. Rodgers et al. EMBO Rep 22, e51866 (2021) Using a bistable animal opsin for switchable and scalable optogenetic inhibition of neurons

Optogenetic Stimulation Frequencies

Today I’ll be talking about the importance of optimising in vivo optogenetics frequency, having previously looked at the pulse on-times. All too often, I will see papers or talk to colleagues who use an unfeasible stimulation frequency for their in vivo optogenetics. For example, where I work in the hypothalamus, you often see stimulation at 20 Hz. And from my experience of patch clamping multiple neurone types in the hypothalamus, they just don’t fire that fast.

If you’re not an electrophysiologist, it might not be obvious, but action potentials are energetically expensive. So, neurones will only fire quickly if they need to. In fact, they will only be able to fire quickly if it is required for their function. Which it is for cognitive processing, but not for the much simpler processing required in many other brain regions.

Back to the beginning

As usual, first thing we do is go back to the early optogenetics publications from Karl Diesseroth. In their 2012 Nature Methods paper, Mattis et al. performed a thorough investigation of the opsins available at the time1. And, despite being a decade later, the data still stand, and are still very useful. I strongly recommend reading this paper for anyone who plans to perform optogenetic studies. It’s a huge paper with bags of useful info.

Mattis et al. measured spike fidelity, ie. the success rate of the cell to produce an action potential in response to a flash of light. They used a high light intensity, so there is no issue of there being not enough light to activate the opsin. Instead, the loss of fidelity comes from the neurone being unable to keep up. As I’ve mentioned before, the neurone needs to recover its membrane potential below a certain threshold or it won’t be able to trigger another action potential, so if you chronically overstimulate a neurone they become silenced.

I’ve shown here a comparison of ChR2h134r (also called ChR2R) and ChIEF (Figure 1A). The black lines show the spike fidelity to light pulses, and the grey lines show the fidelity to electrical pulses. Essentially, the grey lines show what the cell is intrinsically capable of, whereas the black lines show how it fares under optogenetic control. Notice how the ChR2h134r loses fidelity at 20 Hz, whereas ChIEF only loses it at 40 Hz. This is largely because of the “off kinetics”, which means that ChR2h134r takes a lot longer to close than ChIEF (Figure 1B). And it’s only after the opsin has closed that the cell can recover its membrane potential.

Optogenetic spike fidelity of ChR2 and ChIEF, from Mattis et al.

A self test

Luckily I have access to an electrophysiology rig, so I was able to test spiking fidelity my target neurones. Namely, AgRP neurones of the arcuate nucleus of the hypothalamus (Arc). I transfected AgRP neurones with ChR2h134r, cut ex vivo slices and patched using current clamp. I then flashed the neurone with increasing frequencies of 470 nm light at a high intensity (Figure 2).

Optogenetic spike fidelity in an AgRP neurone

As you can see, the cell responds nicely with big action potentials at low frequency stimulation. But the action potentials disappear even at 10 Hz. Remember that you really need the action potential to get the response you want, whether you are stimulating the soma or the terminal. Otherwise, you really don’t know what you’re doing to the neurone, although I strongly suspect you’ll be silencing the cells. Either way, I don’t recommend flashing faster than you are able to produce action potentials.

In fact, to demonstrate why you need to limit your flashing frequency, I’ve zoomed in on the 5 Hz flashing and aligned the electrical recording with a visual representation of the likely open/closed state of the ChR2 in those cells (Figure 3). I’ve drawn the light pulses and used the published τOFF to estimate the ChR2 channel close time1.

Now imagine that you have additional pulses in between the ones shown (1 extra for 10 Hz or 3 extra for 20 Hz). Between the slow closing of the ChR2 and the slow recovery of the neurone’s membrane potential, it’s easy to see why the neurone loses firing fidelity above 5 Hz.

An important message

One of the other tests done by Mattis et al. was to simply turn the blue light on continuously for 1 second in two different neurone types. A “regular-spiking” neurone fires one action potential before being silenced, whereas a “fast-spiking” neurone fires continuously through the illumination. The point here is that some neurones can fire at 200 Hz under optogenetic stimulation (mainly cortical neurones). And if your research involves them, you probably know that.

But every neurone I’ve ever investigated wasn’t capable of anything close to that rate. So please check the firing rate your neurone is actually capable of before deciding your in vivo optogenetics frequency. Or, if you are not able to do it or get a friend to, be very careful with your stimulation paradigm. And feel free to ask someone, it never hurts to ask for help.

1. Mattis et al. Nat Methods 9(2), 159-172 (2012) Principles for applying optogenetic tools derived from direct comparative analysis of microbial opsins

Effective Stimulation Depth

The effective stimulation depth is one of the critical factors in determining the success of an optogenetics study. But it is routinely ignored, particularly by the vendors of optogenetic LED systems. Be wary of any vendor of optogenetic LED’s that loudly proclaims the mW power they can achieve. Particularly if that fibre has a high NA or diameter.

A dose of light

Quoting the power at the fibre tip is all well and good, but it doesn’t take into account the spread and scatter of light in the brain. So, unless you intend to have your optic fibre literally touching your neurone population of interest, you must consider how the irradiance (light power over area, mW/mm2) drops relative to distance from the fibre tip.

Irradiance loss in the mouse brain

Now that we have plotted the irradiance loss as we move further from the fibre tip, what next? We need to know at what point the light ceases to be effective in activating our optogenetics. If you are used to pharmacology, you can think of it as a drug dilution, but one that occurs spatially through the tissue. So in that case, we need to find the EC50 of the opsin. Then, we can determine an irradiance “dose” to aim for, below which we lose efficacy.

Opsin characterisation

Fortunately, the early pioneers of optogenetics went through a lot of effort to validate and characterise everything. A 2012 paper from Karl Diesseroth’s lab characterised a range of opsins in exhaustive detail1.

The important info for this post is the determination of irradiance needed for activation. Mattis et al. determined photocurrent at a range of irradiances, firstly for a selection of stimulatory opsins (Figure 1A). From this they were able to calculate the irradiance needed for half activation, or the effective power density for 50% activation (EPD50; Figure 1B). This is analogous to the EC50 for pharmacology.

The EPD50 is helpful in that it provides a measure of the sensitivity of the opsins regardless of the expression level in the cell. Having said that, I don’t think we should disregard the magnitude of the photocurrent. Particularly when measured in a directly comparable system as we see here. My takeaway here is that these ChR2-based opsins have an EPD50 around 0.8 – 1.5 mw/mm2; the exception is the CatCh and C1V1 variants which all have very slow (>50 ms) off kinetics.

Inhibitory opsins

Mattis et al. also investigated a number of inhibitory opsins in the same way (Figure 2). These universally have a much higher EPD50 than the excitatory ChR2-based opsin. My takeaway from this figure is that the eArchT3 seems to be the best of these. It has a comparable EPD50 to eNpHR3.0, but a much higher photocurrent. Also, Arch opsins have peak excitation at 520 nm, which is technically easier to obtain than the ~590 nm peak of eNpHR3.0.

Right, so now we have a good idea of the threshold irradiance needed to activate our opsin of choice. Ideally, you would back this up by validating in vitro, using patch-clamp electrophysiology of your neurone system.

Predicting effective stimulation depth

So now I can replot the predicted irradiance loss from the tip of the fibre. Only this time, if I add the threshold irradiance of 1 mW/mm2 (as tested for ChR2h134r in vitro) it will highlight how deep I can expect to activate my opsin. This gives us a predicted effective stimulation depth.

Based on this graph, it appears that I will produce effective stimulation of my neurones for just over 1.2 mm. This is good, as it will allow me to aim the fibre 0.5 mm away from my population of interest, while still having plenty of leeway for experimental variability and still expect to activate the entire population.

In order to simplify this process, I have put this effective stimulation depth calculation into a handy (and free) online tool. Please do try it out, as it should inform you about your experimental design.

1. Mattis et al., Nat Methods 9(2), 159-172 (2012) Principles for applying optogenetic tools derived from direct comparative analysis of microbial opsins

Light Penetrance in Different Brain Regions

This post explains a further addition to my depth calculator. In this update, I’ve added options to predict optogenetics stimulation depth in different brain regions. I’ve mentioned before about the irrelevance of visible light wavelength compared to the density of brain matter, when calculating depth of light penetrance.

Light scattering measurements

Anyway, I went back to an early paper calculating light scattering in different types of brain tissue (Figure 1)1. As you can see, absorption of light is irrelevant compared to scattering (note the logarithmic scale). Also, the scattering doesn’t change much across visible wavelengths for grey matter, and not at all for white matter.

Visible light scattering in different types of brain matter.

So what I’ve done is to take the following estimates for scattering values for each type of brain region:

  • Grey matter (blue light): 11.2 (taken from Aravanis et al.2)
  • Grey matter (red light): 9
  • Thalamus (intermediate scattering): 20
  • White matter: 40

Predicting light penetrance

I’ve then plotted the light penetrance using the calculations from Aravanis et al. (also used by Karl Diesseroth) with these different scattering coefficients (Figure 2). Note the logarithmic scale. As I mentioned, shifting to red light makes very little difference to the light penetrance compared with changing the density of brain matter.

Light penetrance in different types of brain matter for optogenetics stimulation.

In order to make the light scattering relevant to optogenetics stimulation depth for in vivo experiments, I have updated my optogenetics depth calculator to include scattering in different types of brain tissue. Using the new calculator, I have predicted the following effective depths in different brain tissue using my standard parameters:

  • Grey matter: 1.57 mm
  • Intermediate: 1.24 mm
  • White matter: 0.92 mm

As you can see, changing the scattering level of the tissue has a dramatic effect on the effectiveness of your in vivo optogenetic stimulation depth. My suggestion for experiment planning is to use the “intermediate” value as default, and pick one of the others if you have a good idea of your target brain regions.

For example, if you’re working in the cortex, which is heavily “grey”, pick the low scattering value. On the other hand, if you are targeting the brain stem, which is densely “white”, pick the high scattering value. If you want a more accurate predictor of light spread, you need to do more complex modelling.

1. Yaroslavsky et al. Phys Med Biol 47, 2059 (2002) Optical properties of selected native and coagulated human brain tissues in vitro in the visible and near infrared spectral range

2. Aravanis et al. J Neural Eng 4, S143-S156 (2007) An optical neural interface: in vivo control of rodent motor cortex with integrated fiberoptic and optogenetic technology

Amy’s Microtome Counter

Yesterday something awesome happened: Amy (one of the other postdocs in the lab) came to me with an idea for a piece of kit that would help her in the lab. She found that when she was cutting brain sections on the microtome, she would sometimes zone out and forget which plate she was up to. Her request was for a microtome section counter.

The idea was to have something that would light up an indicator of which plate she needed to put the next section into. It would also require a sensor of some kind that would be activated each time she placed a section. We quickly came up with a workable idea that would use an IR sensor, and the user would sweep their hand close to the sensor after each brain section was added.

This project is just asking for an Arduino, so first thing I did was sketch out some code:

// Specify pin connections
int IR = 2;
int LED1 = 3;
int LED2 = 4;
int LED3 = 5;
int LED4 = 6;
int toggle = 7;

// Specify other variables
int count = 0;            // Counter
int maxcount = 4;         // Number of plates to count
long delayTime = 500;     // Delay time to prevent multiple activations
long lastTime = 0;        // Time stamp from last activation

void setup() {

// Specify pin setup
pinMode(IR, INPUT_PULLUP);
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(toggle, INPUT_PULLUP);

}

void loop() {

// Toggle to select number of plates being used
if(digitalRead(toggle) == LOW){
  maxcount = 3;
}
else{
  maxcount = 4;
}

// Detection by IR sensor 
if (digitalRead(IR) == LOW){
  if(millis() - delayTime > lastTime){    // Have you exceeded time since last activation?
    count++;                              // Add to counter
    lastTime = millis();                  // Specify timestamp of IR activation
  }
}

// Overflow counter back to start
if (count >= maxcount){              
  count = 0;
}

// Switch on each LED in turn depending on counter
if(count == 0){
  digitalWrite(LED1,HIGH);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,LOW);
  digitalWrite(LED4,LOW);
}

if(count == 1){
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,HIGH);
  digitalWrite(LED3,LOW);
  digitalWrite(LED4,LOW);
}

if(count == 2){
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,HIGH);
  digitalWrite(LED4,LOW);
}

if(count == 3){
  digitalWrite(LED1,LOW);
  digitalWrite(LED2,LOW);
  digitalWrite(LED3,LOW);
  digitalWrite(LED4,HIGH);
}

// Reset timer overflow
if(millis() - lastTime < 0){
  lastTime = millis() - lastTime;
}

}

The electronics is fairly straightforward:

Amy's microtome section counter schematic.

A small amount of assembly later, and we had a working prototype:

Microtome sectioning counter
Amy’s microtome counter

Amy has promised to test it. I’ll let you guys know how it goes.

A Powerful Issue

This will be a short post building off a previous blog post about my depth calculator tool. The principle is also based on Karl Deisseroth’s irradiance calculator, only this time the calculation is reversed. The goal is to predict the in vivo optogenetics power required for your experiment.

So, instead of predicting effective opsin stimulation depth, you input the effective depth you want for you study, and the calculator with predict an estimate of the light power you need out the end of your optic cannula:

In vivo optogenetics power calculator input values.

As with my depth calculator, I have got some recommended starting values for fibre core, NA and irradiance threshold. Then press “Calculate” and it will estimate the power you need to achieve effective stimulation at your desired depth:

In vivo optogenetics power calculator output.

That’s it for today, and I hope some people use my free tool to gain insight into their in vivo optogenetics power requirements.

Who’s Behind the Curtain?

Calculating irradiance depth

My previous blog post was about my newly developed optogenetics irradiance depth calculator. The goal was to produce a simplified version of Karl Diesseroth’s more famous irradiance calculator.

Irradiance decreases with depth from fibre tip.
Typical irradiance dropoff values

After some sleuthing, I found that Diesseroth based his calculator off a paper from 2007 by Aravanis1. It predicts the spread of light through tissue based on two major factors:

  1. Geometric spread – how much the light spreads out the end of the fibre, which for the multimode fibres used for in vivo opto’s will be mainly determined by the NA
  2. Tissue scatter – light absorption and scatter by the (brain) tissue the light is penetrating

Here is the relevant section from the paper:

Optogenetics irradiance depth calculations from Aravanis et al.

The important equation is the bottom one, which calculates the irradiance (I) at distance (z), relative to the starting irradiance. The user can therefore input optical power (I at z=0), threshold irradiance (I at z), fibre radius (r) and numerical aperture (NA).

Apart from that, there are two more variables that are determined by experiment: the index of refraction of the tissue (n) and the scatter coefficient (S). I have used the same values as Aravanis, which are based on mouse brain grey matter.

And then we solve for distance (z). The tricky bit here is that solving for z produces a cubic equation, but fortunately cleverer people than me have written scripts for solving cubics. After that, it was fairly straightforward to write the script in Javascript and attach to the webpage.

Scattering of different wavelengths

A quick note on wavelengths of light. The astute among you will likely have noticed that my depth calculator does not allow you to pick the wavelength of light to use in the calculator, whereas Diesseroth’s does. The reason for this is that wavelength has little impact on the scattering of light in the visible range (Figure 1).

Scattering and absorption coefficients in brain grey matter.

In fact, by far the biggest impact on predicted scattering comes from the difference between white and grey matter, or even who did the measurements! Which bring me to the caveats for using my depth calculator:

  1. It is an estimate predictor of optogenetics irradiance depth, so take the output values as a guide rather than absolute truth
  2. The calculator assumes you are targeting grey matter, so if you place your fibres in denser white matter regions (such as the brainstem), the predictions will no longer be accurate.

Despite the caveats, I do believe my depth calculator tool is useful, and hopefully people will find it easier to decipher than Karl Diesseroth’s.

1. Aravanis et al. J Neural Eng 4, S143-S156 (2007) An optical neural interface: in vivo control of rodent motor cortex with integrated fiberoptic and optogenetic technology

2. Yaroslavsky et al. Phys Med Biol 47, 2059 (2002) Optical properties of selected native and coagulated human brain tissues in vitro in the visible and near infrared spectral range