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=BWglobal⋅BWadpative, where ‘⋅’ stands for point-wise |
multiplication |
6 Morphological closing operation: BWclose=(BWcombined⊕SE)⊖SE
|
where structuring element SE=[0,1,0;1,1,1;0,1,0] |
7 Morphological opening operation: BWopen=(BWclose⊖SE)⊕SE
|
where use the same structuring element SE as above |
8 BWopenRemovethesmallfeatures⇒BWopen_updated
|
9 BWopen_updatedClearthefeaturesatimageborder⇒BWupdated
|
10 BWupdatedCalculatethedistancematrix⇒Mdistance
|
11 MdistanceWatershedtransform⇒Lwatershed
|
12 LwatershedSelectneuronsizebetweenRminRmax⇒Lselected
|
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_m⋅Ij) Calculate the average intensity profile |
of the neuron |
18 end
|
19 end
|