ABSTRACT (original article): Shaping the animal body plan is a complex process that involves the spatial organization and patterning of the different germ layers. Recent advances in live imaging have started to unravel the cellular choreography underlying this process in mammals, however, the sequence of events transforming an unpatterned cell ensemble into structured territories is largely unknown. Here, using gastruloids –3D aggregates of mouse embryonic stem cells- we study the formation of one of the three germ layers, the endoderm. We show that the endoderm is generated from an epiblast-like homogeneous state by a three-step mechanism: (i) a loss of E-cadherin mediated contacts in parts of the aggregate leading to the appearance of islands of E-cadherin expressing cells surrounded by cells devoid of E-cadherin, (ii) a separation of these two populations with islands of E-cadherin expressing cells flowing toward the aggregate tip, and (iii) their differentiation into an endoderm population. During the flow, the islands of E-cadherin expressing cells are surrounded by cells expressing T-Brachyury, reminiscent of the process occurring at the primitive streak. Consistent with recent in vivo observations, the endoderm formation in the gastruloids does not require an epithelial-to-mesenchymal transition, but rather a maintenance of an epithelial state for a subset of cells coupled with fragmentation of E-cadherin contacts in the vicinity, and a sorting process. Our data emphasize the role of signaling and tissue flows in the establishment of the body plan. CITATION (original article): Ali Hashmi, Sham Tlili, Pierre Perrin, Molly Lowndes, Hanna Peradziryi, Joshua M Brickman, Alfonso Martínez Arias, Pierre-François Lenne (2022) Cell-state transitions and collective cell movement generate an endoderm-like region in gastruloids eLife 11:e59371. DOI: https://doi.org/10.7554/eLife.59371
Gastruloid 2: spatial organization of cell population at 72 hours of development
Gastruloid 3: tracking bulk motion of cells
Gastruloid 2: spatial organization of cell population at 72 hours of development
Gastruloid 3: tracking bulk motion of cells
I am using embryonic stem cells that self-organize to form spheroids (balls of cells) to study gastrulation events. In order to not bog down the readers with technical jargon, gastrulation is a process where the stem cells start to form the different layers; each layer then goes onto form the various tissues/organs, in the process unraveling the developmental plan of the entire organism. I am using experimental techniques and quantitative principles from biophysics and engineering to understand some aspects of this crucial process.
The gastruloids (image below) are quite rough in their appearance and not as beautiful as one would like them to be (only a mother can love such an image). Any means of quantifying these gastruloids requires me to initially segment them. When you see a time-lapse images of gastruloids it becomes apparent that they shed a lot of cells (for reasons I do not know yet). This adds considerable noise to the system; oftentimes to the point that, as a human, my eyes are fooled and run into the difficulty of finding the right contours for the spheroids.
1. Training UNET
1. Training UNET
Conventional image processing techniques fail at segmenting gastruloid; I proceeded with utilizing a convolutional neural network (UNET) instead to create more faithful segmentations from images despite the inherent noise - coming primarily from the dead cells lying around the gastruloid. To this end, I created a dataset (training set) and augment it to train the network. Below I import the training set (images plus corresponding masks) and use a substantial chunk of it to train UNET, with the remainder portion acting as a test set.
In[]:=
<<"C:\\Users\\hashmial\\Downloads\\notebook1\\UNET.m";dirimg="C:\\Users\\hashmial\\Downloads\\notebook1\\train_images_8bit";dirmasks="C:\\Users\\hashmial\\Downloads\\notebook1\\train_masks";
In[]:=
{X,Y}=dataPrep[dirimg,dirmasks];
In[]:=
nNet=UNET
In[]:=
saveInputs[X,Y,"data"];
In[]:=
{traindata,trainlabels}={X[[;;300]],Y[[;;300]]};
training the neural network
In[]:=
nNetInfo=trainNet[nNet,traindata,trainlabels]
Out[]=
NetTrainResultsObject
In[]:=
nNetInfo["LossEvolutionPlot"]
Out[]=
| rounds |
loss |
In[]:=
nNetTrained=nNetInfo["TrainedNet"]
saving the trained neural network in the directory
In[]:=
saveNeuralNet[nNetTrained]
Out[]=
C:\Users\hashmial\Downloads\notebook1\unet.wlnet
2. Importing trained UNET and applying on test images
2. Importing trained UNET and applying on test images
Now we import the neural net and apply it on a random image from the test-set.
All files imported in the following code are available upon request. Please leave a comment if needed.
All files imported in the following code are available upon request. Please leave a comment if needed.
In[]:=
nNetTrained=Import["C:\\Users\\hashmial\\Downloads\\notebook1\\unet.wlnet"]
Out[]=
NetGraph
In[]:=
<<"C:\\Users\\hashmial\\Downloads\\notebook1\\UNET.m";dirimg="C:\\Users\\hashmial\\Downloads\\notebook1\\train_images_8bit";dirmasks="C:\\Users\\hashmial\\Downloads\\notebook1\\train_masks";
In[]:=
{X,Y}=dataPrep[dirimg,dirmasks];
In[]:=
{testimages,testmasks}={X[[301;;]],Y[[301;;]]};
In[]:=
generateImage[]:=With[{imgs=Thread[{testimages,testmasks}]},MapAt[NetDecoder[{"Image"}],RandomChoice@imgs,2]];
In[]:=
{img,ground}=generateImage[]
Out[]=
,
{img,#,ground,HighlightImage[img,MorphologicalPerimeter@Binarize@#]}&[NetDecoder[{"Image"}]@nNetTrained[img,TargetDevice{"GPU",1}]]
Out[]=
,
,
,
We further test the neural network by applying it over a set of test images which the network has not seen before
Hamming distance can be used to “crudely” determine the model accuracy using a pixel wise comparison
3. Quantifying morphology (Elliptical Fourier Descriptor)
3. Quantifying morphology (Elliptical Fourier Descriptor)
Some segmentation masks above may require a bit of manual correction. However, a significant portion of the segmentation masks generated from the trained network are already correct for further quantifying gastruloid morphologies.
Elliptical Fourier Descriptors is a mathematical technique which utilizes a sum of ellipses over contours to quantify the contours and silhouettes in an image. Broadly speaking the technique is widely used in Computer Vision and visual Pattern Matching. The first mode is by default an ellipse. Even the second or higher harmonics are all ellipses. However when the modes are accumulated we get closer and closer to describing the shape of a given contour. More details here: https://community.wolfram.com/groups/-/m/t/1028978
We can use Elliptical Fourier Descriptors to find quantitative metrics for the shape of the segmented masks (gastruloids). Higher number of harmonics are needed to describe the shape of the deformed object compared to the earlier time point.
Elliptical Fourier Descriptors is a mathematical technique which utilizes a sum of ellipses over contours to quantify the contours and silhouettes in an image. Broadly speaking the technique is widely used in Computer Vision and visual Pattern Matching. The first mode is by default an ellipse. Even the second or higher harmonics are all ellipses. However when the modes are accumulated we get closer and closer to describing the shape of a given contour. More details here: https://community.wolfram.com/groups/-/m/t/1028978
We can use Elliptical Fourier Descriptors to find quantitative metrics for the shape of the segmented masks (gastruloids). Higher number of harmonics are needed to describe the shape of the deformed object compared to the earlier time point.
We can visualize the contour of the gastruloid changing shape over time, where the different hues represent a pseudo-time for the gastruloid development.
A higher number of harmonics (n = 3, shown as blue contour) are needed to describe the gastruloid shape (black contour) at the final timepoint whereas only the first harmonic can describe the gastruloid shape in the beginning
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Gastruloid 1: segmenting and quantifying morphology
by Ali Hashmi
Wolfram Community, STAFF PICKS, October 11, 2023
https://community.wolfram.com/groups/-/m/t/3033001
by Ali Hashmi
Wolfram Community, STAFF PICKS, October 11, 2023
https://community.wolfram.com/groups/-/m/t/3033001