Skip to main content
. 2021 Mar 11;15:657361. doi: 10.3389/fnins.2021.657361

TABLE 1.

Algorithm outline for automatic detection of GCaMP6f signals.

Algorithm outline
Input: Aligned time sequence images I_j (j=1,2,⋯,J)
Output: GCaMP6f signals’ profile S_m (m=1,2,⋯,M) from activated
DRG neurons

1 Calculate the variance map V of the image stack I_j (j=1,2,⋯,J) along
the time dimension
2 Initialize the global threshold HG, the active neuron number P and neuron size
rang Rmin, Rmax
3 for n = 1: N (different iterations) with condition if identified neurons p <
estimation number P
4   Variance map VGlobalthresholdHG⇒ Binary image BWglobal
  Variance map VAdaptivethresholdHA⇒ Binary image BWadaptive
5   BWcombined=BWglobalBWadpative, where ‘⋅’ stands for point-wise
  multiplication
6   Morphological closing operation: BWclose=(BWcombinedSE)⊖SE
  where structuring element SE=[0,1,0;1,1,1;0,1,0]
7   Morphological opening operation: BWopen=(BWcloseSE)⊕SE
  where use the same structuring element SE as above
8   BWopenRemovethesmallfeaturesBWopen_updated
9   BWopen_updatedClearthefeaturesatimageborderBWupdated
10   BWupdatedCalculatethedistancematrixMdistance
11   MdistanceWatershedtransformLwatershed
12   LwatershedSelectneuronsizebetweenRminRmaxLselected
13   Update the global threshold HG_updated=HG*α,where step size
  α=0.75
14 end
15 for m = 1:M (different neuron regions)
16  for j = 1: J (different captured images)
17   Sm_j= Mean (Lselect_mIj) Calculate the average intensity profile
  of the neuron
18  end
19 end