BACKGROUND
the mouse, due its genetic similarity to humans, the existence of sophisticated genetic tools to manipulate its genome, rapid reproduction time and comparatively low housing costs, has become an increasingly important model organism in mammalian biology.
more recently, magnetic resonance imaging  has emerged as tool for capturing three-dimensional anatomy to aid in phenotyping mice  <cit> .
there is, however, a resolution to time trade-off in mri which impacts its application to the mouse, where high resolution is essential due to the small size of the animal but is achieved with very long scan time.
parallelization of mri experiments is one technique to compensate for the long imaging time.
this encompasses either separate transmit/receive coils for each mouse  <cit> , or packing multiple specimen into the same field of view while using a single coil.
the latter strategy was chosen by schneider et al.
for phenotyping mouse embryos, placing  <dig> fixed specimen embedded in gel into a single tube which was then imaged using high-resolution mri at  <dig>  tesla  <cit> .
a complication of the multiple specimens within one field of view strategy, however, is the need to segment the image to isolate the individual specimens.
most available published segmentation algorithms, moreover, fail this task.
the two primary reasons are:  inhomogeneities of intensity values within the gel and overlap between embryo and gel intensities, ruling out simple thresholding algorithms; and  multiple specimens within the imaging tube are touching, ruling out region growing or snake algorithms as they leak into adjacent touching embryos .
analysis of these datasets thus requires an algorithm which is not only capable of segmenting multiple embryos at the same time but can also separate adjacent touching embryos during segmentation.
in this paper, we demonstrate a semi-automatic multiple embryo segmentation technique which allows us to create individual masks for all embryos starting from identical spheres.
these masks can then be used to separate each embryo from the rest of the embryos in the tube for further analysis.
our method is a modified version of the simplex mesh deformable algorithm of delingette  <cit>  with additional balloon and collision forces which allow for segmentation of each embryo as well as its satisfactory separation from neighbouring embryos.
<dig> methods
<dig>  algorithm
<dig> .
<dig> related work
the deformable simplex mesh algorithm is a general shape reconstruction technique which attempts to build a geometric model from a three-dimensional dataset.
its surface representation is a simplex mesh with topology dual to that of triangulation  <cit> .
in addition, each vertex of a simplex mesh has a fixed number of neighbouring vertices directly connected to it.
because of this geometry, simplex meshes defined discrete concepts at each vertex such as mean curvature and normal vectors which are used for the calculation of forces of deformation.
this differs with triangle meshes in that each vertex of a triangle mesh can have many neighbours and concepts such as normal vectors are usually defined for each surface of the triangle rather than each vertex.
for these reasons, simplex meshes are more preferable as deformable models rather than triangle meshes  <cit> .
on a three-dimensional simplex mesh, each vertex has three neighbouring vertices which define its tangent plane and normal vector.
further, the angle between adjacent edges can be defined as a simplex angle which defines the local shape around each vertex.
this angle can then be used for the computation of mean curvature, a measure of surface bending.
finally, the position of a simplex vertex can be defined as a function of its neighbouring vertices and the shape parameters.
due to the large extent of shape control, simplex meshes are better suited for deformation and smoothing than triangulation  <cit> .
just like most other deformable model schemes, each vertex of a simplex mesh is considered as a physical mass subject to equations of motion.
to compute the evolution of each vertex p of the simplex mesh in a discrete time step t, we used the equation of motion
both forces are calculated at time t, fint is the internal force which enforces geometric continuity of the mesh whereas fext constrains the distance between the mesh and a three-dimensional dataset.
internal forces are calculated based on the geometry of simplex meshes and can be decomposed into a tangential force ftangent and a normal force fnormal.
the tangent force controls the position of each vertex with respect to its three neighbours in the tangent plane.
the normal force constrains the mean curvature of the surface through the simplex angle of each vertex.
for details of how these forces are calculated see  <cit> .
the external force is dependent on the three dimensional dataset and is always directed along the normal  direction at the vertex p. this not only guarantees a smooth deformation of mesh over time but ensures a non-self-intersecting mesh, which result should the displacement occur in the tangential direction  <cit> .
most deformable model algorithms base the external force on the image gradient  <cit> .
in the original paper, the external force is defined as follows
the gradient force is determined from a search within a certain radius in the neighbourhood of each vertex for a voxel with the highest gradient intensity.
the edge force is calculated by searching for the voxel with the highest intensity in the direction of the normal line of each vertex.
despite their many intrinsic advantages, deformable model algorithms suffer from three main limitations  <cit> :  they are sensitive to initialization problems, which necessitates that they begin their deformation in close vicinity to the final desired solution in order to avoid becoming trapped in local minima;  they are often unable to adapt to boundary concavities due to internal forces which keep the model smooth and minimize curvature; and  they are prone to self-intersection unless adequately constrained by internal and external forces.
we have modified the deformable model algorithm of delingette by adding four components to the original model to adequately segment mri scans of multiple embryos acquired within the same field of view.
first, we have added a balloon force component to the definition of external forces.
this allows us to start segmenting all embryos from identical spheres without having to worry about model getting trapped in close by local minima at stated in the above.
second, a collision force component was also added to the definition of external forces.
third, we have implemented the concept of a tube mask to exclude the plaster walls of the sample tube.
the latter two concepts help solve the problem of touching embryos.
finally, instead of segmenting one embryo at a time, we have designed and implemented a deformable model program which segments up to n embryos simultaneously.
in the sections to follow, we explain the modifications to the original deformable model algorithm of delingette.
the solution proposed herein, while designed with a particular application in mind, should be generally applicable for using deformable models to segment multiple similar and potentially touching objects within one image.
<dig> .
<dig> modified deformable model with balloon force
initialization is one of the most challenging issues with deformable models.
the success of most deformable model segmentation algorithms is determined by how closely the edges of the initial model follow that of the final result.
if the initial model is much smaller than the object which is being segmented then the model will get stuck in local minima resulting in unsuccessful segmentation.
in our case, since we start with identical initial models for all embryos, there is a need for a method to allow for local inflation of all models until they lie within a region of the image where they are close to the boundary of the embryos.
to solve the multiple embryo initialization problem we implemented a two step solution wherein the image is fist coarsely classified into embryo versus gel, and secondly a balloon force is added to the deformable model to drive it towards the correct boundary.
as mentioned in the previous section, due to non-uniform mri intensity values across the gel and similar intensities between gel and embryo in the image, thresholding algorithms are unsuccessful at separating embryos from gel .
therefore, there is a need for an algorithm which is capable of labeling each voxel in the image as embryo versus non-embryo.
here we employ a multispectral bayesian supervised classification algorithm previously implemented to separate human brain images in grey matter, white matter, spinal fluid, and lesions  <cit> .
the bayesian algorithm is based on using a training set determined by the user to initialize the voxel classification - either based on a probability map or manually selected.
the training set refers to a list of 3d coordinates voxel intensities for each class type in our case  <dig> points for class embryo and another  <dig> points for class gel.
the bayesian algorithm also uses statistical measures such as standard deviation  from the data to further aid the classification of voxels in the image .
the algorithm then estimates the probability density function on the basis of centroid and covariance matrix evaluated for each class which is defined in the training set.
thus given an unknown sample, it is assigned to a class if a posteriori probability is maximized over the bayes' theorem.
to create our classified image, we first create a training set from the image with labels embryo or gel.
we then use this set of points to calculate the probability density function for each of the two classes and further determine the maximum likelihood of any sample point belonging to each of our classes on the basis of bayesian theorem.
this will allow us to classify all voxels in image as explained above .
it is important to mention that although the classification algorithm is capable of labeling the image with sufficient accuracy for initializing the deformable models, it has a tendency to label a few more voxels belonging to embryos than the actual embryos.
as the problem of touching embryos already exist in the original mr images and is addressed by our algorithm, this does not create a problem for our technique.
once the image is classified into embryo versus gel, a balloon force was designed to drive the mesh towards boundaries of the embryo while avoiding bad local minima using the classified image as a guide.
it allows for the expansion of the initial spherical models until the edges of the model get close  to the edges of the embryos.
once the model edges are close to the embryo edges, the original deformable model strategy can be used to recover the edges of the embryos.
we modify the external force of equation  <dig> as follows
where the balloon force is defined as
where the b is the binary threshold operator on the classified image and n is the normal force at each vertex .
where tlow and thigh are the lower and upper thresholds for desired intensity values of the objects of interest and in our case were chosen as tlow = -  <dig>  and thigh =  <dig> .
together, the balloon force and the classified image expand the initial models towards the correct boundaries of the embryos; this alone is, however, not sufficient for the final segmentation results.
as explained before, the embryos are larger in the classified image than their actual size and without the gradient forces to stop the expansion of models at the correct embryo edges, the balloon force expands the models past the edges of embryos and segments the gel right around embryos as part of the embryos.
further, a look at the classified image reveals that even if the embryos are not touching each other in the original image, they do intersect in the classified image, and hence without any intervention models will leak into each other as there are no barriers in between the embryos.
<dig> .
<dig> modified deformable model with collision force
to solve the problem of segmenting multiple embryos touching each other, there is a need for a collision detection algorithm.
we have designed a simple collision detection algorithm which allows us to check for collision after every few stages of the deformation.
our approach is different than the traditional collision detection algorithms mainly because it checks the binary masks created from meshes using a simple rasterization algorithm instead of checking the meshes themselves  <cit> .
in our algorithm, every mesh will have a unique collision energy image c hence n collision energy images for n meshes.
each collision energy image is created by "xor"ing all binary masks m except the one being deformed.
for example, to create c <dig>  we "xor" all binary masks m except m <dig>  we create n collision energy images c <dig> to cn for n meshes as follows
the collision energy image for each mesh can then be used to direct the deformation for that mesh away from all other meshes, hence creating collision detection.
we have added another component to the external forces of equation  <dig> as follows
where the collision force is defined as
where the collision image acts as a binary thresholding operator for the image intensity i
after every  <dig> iterations we check the vertices of each mesh for points of collision.
we have picked  <dig> since it allows the meshes to deform but not so much that there is a chance of collision before detection.
at each collision point a small neighbourhood of the voxels  are searched for the voxel with the highest gradient intensity hence fgradient.
our collision energy is designed based on the assumption that the true boundary of the embryos is close by where the collision takes place between two meshes since they are expanding simultaneously.
therefore, a gradient search around the neighbourhood of the collision point reveals the correct boundary of the embryos.
the modified deformable model algorithm together with our collision detection method goes through the following steps to start deformation from identical spherical meshes and segment the embryos while avoiding collision between adjacent ones.
<dig>  use seed points determined by the user as the centers of identical spherical simplex meshes to initialize all embryos .
<dig>  simultaneously inflate all meshes on the classified image to avoid any local minima using the balloon force.
this will help the models get close to the boundary of interest, in our case the edges of the embryos .
<dig>  while expanding the models, use the collision detection algorithm after every  <dig> iterations to detect any collision between the models.
if collision occurs, stop the inflation for models in collision and continue inflation for the rest of the models.
continue until all models have stopped inflating.
<dig>  at this point, all models are within the vicinity of their corresponding embryos, use the gradient search algorithm to find close by edges of embryos .
<dig>  once the deformation have stopped for all the models, use a rasterization algorithm to create a binary mask for each embryo from the corresponding simplex deformable model.
<dig> .
<dig> modified deformable model with tube mask
the collision image energy described in the previous section is capable of taking care of embryos touching each other but is unable to deal with cases where embryos are touching the walls of the sample tube .
in these cases, there is no clear distinction between the embryo boundary and the edges of the tube, hence making it difficult for the deformable model to stop at the correct edge.
to ensure that models will not leak into the outside of the tube we need to create a mask for the entire tube in the image and ensure the vertices of the models do not cross beyond the tube mask boundary.
thus there is a need for an algorithm which is capable of labeling the image to background versus the rest of the image  in our case.
we adapted the bet brain segmentation algorithm  <cit>  for this purpose.
this algorithm uses the intensity histogram of the image to find a robust lower and upper intensity values, while ignoring small number of voxels which have widely different values, to label brain versus background voxels as the basis of its segmentation.
in our case, designed for labeling tube versus background voxels, a tube mask image is created from the original image.
the lower intensity is found by calculating the mean value of the bin which holds the local minimum after the first highest peak .
the maximum intensity is simply taken from the data range of the image.
using these two values, thresholds are calculated which attempt to distinguish between the tube and background in the image.
a binary threshold filter is then applied to the original image with the calculated high and low threshold values to create the final tube mask .
at each iteration the final displacement of the model points are created and checked to make sure the displacement lands every point within the tube mask.
if it happens that any point is displaced outside the tube, the displacement for that point is set to zero and the previous coordinate is assigned to the point ensuring that no point leaves the tube mask area.
we have modified the original definition of the deformable simplex model algorithm with balloon force, collision force and tube mask to simultaneously deform up to n models while ensuring that they do not leak into each other or outside of the tube.
<dig> .
<dig> multi-resolution approach
the gradient forces which attract the model towards the correct boundaries of the target are computed around each model point within a local region in the image and often gets the model stuck to spurious image features or non-true boundaries of the object.
therefore, deformable models must be initialized close to the boundaries of the object to avoid unsuccessful segmentation.
this feature of deformable model algorithms is also present in our modified version of the deformable model as it too searches the image within a local region of model points and can get the model stuck to non-true boundaries of the object.
the multi-resolution approach allows the deformable model to pass over non-true boundaries of the object and to quickly find a rough boundary approximation in the early stages of deformation  <cit> .
another important reason for starting the deformation with low resolution models is that because our deformable model algorithm does not have any explicit checking for self-intersection, starting the deformation with high resolution models will likely result in self-intersecting models due to having too many points at the first stage of deformation at which the models are expanding by the balloon force.
self-intersecting models result in binary masks with holes in them and since our collision detection algorithm relies on the binary masks created from the models, having non self-intersecting models is essential to the success of our algorithm.
our deformable model algorithm starts with low resolution models.
after the first stage of the deformation, the models go through major expansions with minimal or no self-intersection.
however, low resolution models only recover approximate edges of the target boundaries.
to recover finer boundary features of the embryos high resolution models are needed.
we increase the resolution of the models by a two fold after every stage of the deformation and continue until achieving satisfactory results and the algorithm has reached the convergence criteria.
<dig>  implementation
initialization is one of the main problems with most deformable model algorithms.
the deformable model algorithms usually can only find the close by edges once the model is placed within the close vicinity of the shape of interest.
although we use the balloon force  to locally inflate the initial meshes and get close to the boundaries of interest, we still need a starting point for each individual mesh.
thus, there is a need for a separate method to determine the initial location of the models before segmentation can take place  <cit> .
delingette has proposed automatic methods for initialization, however, these algorithms have very limited range of application and are sensitive to image noise and most importantly are not designed for multiple object initialization which is required in our case since we are deforming multiple models simultaneously  <cit> .
our deformable model algorithm uses manual initialization.
a user must determine n seed points from the image before attempting to segment n embryos for each dataset.
we define the seed point as any 3d point which lies within the boundaries of an embryo, preferably in the centre.
the seed points are then used as the centres of n equal size spherical simplex meshes.
once the seeds are determined and the meshes are initialized, the algorithm starts deformation.
the location of a seed point for initialization of any deformable model algorithm is defined as a point within the boundaries close to the center of the object of segmentation.
in our case, we have tested our algorithm with seed points within  <dig> voxels of each other and had successful results while keeping all parameters identical .
however, seed points which are very close to the embryo edges resulted in unsuccessful segmentation .
an overlaid view of masks created for segmenting the embryos with set  <dig> of seed points of  <dig> embryos is shown in .
these masks are also overlaid with masks created from segmenting the embryos using set  <dig> of seed points .
to determine the sensitivity of our algorithm to initialization, we have segmented one set of  <dig> embryos with three different sets of seed points and determined the mean and standard deviation of the overlapped masks to be  <dig>  ±  <dig> .
our algorithm is designed for simultaneous multiple object segmentation.
this means that once the seed points are determined by the user, the algorithm initializes as many identical spherical deformable simplex meshes as the number of seed points and start the deformation on all initial models simultaneously.
four initial models are shown as masks  overlaid on their corresponding embryos .
all forces that are governing our algorithm are strengthened or weakened through the use of weight factors .
every parameter ranges from zero  to one .
we have determined the particular values for each of our parameters through experimentation.
at the start of the deformation, edge forces are kept at zero as it is not being used.
balloon forces and internal forces are kept high at  <dig>  and  <dig>  respectively, this is to ensure that the meshes are expanding rapidly while being kept smooth and hence free of self-intersection.
the gradient and collision forces are kept at a middle range at  <dig>  and  <dig>  respectively to make sure mesh expansion is possible to the maximum limit but not beyond the embryo boundaries.
simplex meshes also benefit from having control over the scale of smoothness which is defined as the size of the neighborhood around each point used for smoothing of the mesh.
to avoid self-intersection to the maximum level, the scale of the smoothness is also kept very high at  <dig> at the early stages of deformation.
after the first stage of deformation, the meshes are expanded dramatically and are close to the true edges of the embryos .
at this stage, the resolution of the mesh is increased by two fold, balloon and internal forces are decreased to  <dig>  and  <dig>  respectively.
the balloon force is decreased because there is no need for further expansion of the meshes as they are already close to the edges of the embryos.
the internal forces which keep the meshes smooth is also decreased so as to allow the meshes to recover finer edges of the embryos.
the gradient force is increased to  <dig>  to make sure the meshes are attracted to the edges of the embryos and the collision force is decreased to  <dig>  to avoid collision between touching embryos while further deformation is still taking place.
the smoothness scale is also decreased to  <dig>  since self-intersecting meshes mostly occur during the first stage of deformation when meshes go through major expansion.
it has been observed that if the collision detection force is kept at a very high level of  <dig> - <dig>  to keep the segmentation of touching neighbouring embryos free of any intersection, the embryos will not be fully segmented.
to overcome this problem, the collision detection force is reduced to mid range of  <dig> - <dig>  to allow slight touching of embryos so they can be fully segmented.
the stage of deformation with high resolution models can take place between  <dig> to  <dig> times in order to recover all fine feature of the embryos or when convergence is reached .
however, convergence does not imply that the modified deformable model algorithm is capable of recovering fine features such as paws or tails of the embryos.
to recover such fine features using the simplex model deformable algorithm either the features have to be present in the initial model  or there is a need for an algorithm which is capable of refining the model locally i.e., increase the resolution of the mesh only around areas with fine features.
the deformation continues until the models are stabilized.
to determine the stability of each mesh, each point of the simplex mesh is classified as "active" or "inactive".
a point is considered "inactive" if the magnitude of its displacement  is less than a user defined threshold of  <dig>  in our case.
the activity of each simplex mesh during the last n iterations is defined as the ratio of its inactive points over the total number of points.
any mesh with activity ratio of higher than a user determined threshold value of  <dig>  is considered stabilized hence converged  <cit> .
the deformation continues for meshes which are not converged while disabling the meshes which are converged until all the meshes are stabilized.
figure  <dig> gives an overview of our modified deformable model algorithm with collision detection.
<dig>
RESULTS
using identical parameters, we have segmented 3d images of six tubes of multiple embryos provided by oxford university.
figure  <dig> shows the results of the segmentation at different stages of the deformation of one of the datasets.
figure  <dig> shows the closeup view of one embryo with manual and automatic segmentation.
we validated the deformable model algorithm against manual segmentations of  <dig> embryos originating from two tubes of  <dig> and  <dig> embryos respectively.
examples of manual and automated segmentation are shown in figure  <dig>  a quantitative summary is shown in table  <dig>  in order to assess the source of error in the deformable model algorithm, we used non-linear image registration to bring all embryos and their corresponding segmentations into alignment  <cit> .
as can be seen in figure  <dig>  the maximum error occurs around the tail and paws of the embryos.
given that the primary error was in the tail and paws, we next checked whether organs were included in the automatically generated mask.
to do this, all the organs were first manually segmented on the two average embryo images created in the previous section.
using the inverse transformations, the segmented organs were then registered to each individual mask created by our program and the results were compared.
table  <dig> reports the mean and standard deviation of four different organs for the two tubes.
the liver, lung, and ventricle of the heart were fully included in the embryo masks in every single case.
minor errors were found in the brain.
<dig>
CONCLUSIONS
we have developed a novel multi-resolution segmentation technique for semi-automatically segmenting multiple embryos simultaneously.
our multiple embryo segmentation technique can also be applied to other multiple object segmentation problems with possible touching of objects.
our algorithm was found to be highly accurate in capturing the whole embryo as well as its organs.
our deformation scheme follows a low to high resolution approach at which we start the deformation with low resolution meshes and continue increasing the resolution of the meshes through higher stages of deformation.
the meshes are then deformed using a combination of internal and modified external forces .
the multi-resolution approach allows us to use identical initial models for all embryos while quickly and efficiently recovering the rough overall anatomical structure of the embryos at the first stage of deformation.
the final shape of the embryo is then recovered by subsequently capturing the finer details of the embryos with higher resolution meshes at every stage of the deformation.
we have designed and implemented the concept of balloon force to allow us to start the deformation with small spheres and successfully reach the boundaries of the embryos.
using small initial models is a major issues with most deformable models as they can get trapped in local minima.
however, our algorithm has overcome this problem by introducing the concept of balloon force.
to solve the problem of touching embryos, a novel collision detection algorithm was introduced.
the collision detection method allows us to segment multiple embryos while avoiding major leaks into adjacent neighboring embryos.
to our knowledge, most collision detection algorithms work on triangle meshes only whereas in our case binary masks created from the meshes are used.
in order to recover the complete shape of all embryos, collision forces were kept in such a way that a small collision between the embryos was allowed.
our multi-resolution deformable model algorithm with collision detection and balloon forces has overcome some of the difficulties of deformable model algorithms while allowing us to segment multiple embryos simultaneously.
it has also enabled us to segment as many embryos without having to worry about the touching embryos.
our algorithm is written entirely in c++ as part of the insight toolkit itk.org-insightapplications/deformablemodelsimplexmesh open source software.
it takes about half an hour to make the initial preparations including determining the seed points, creating the classified image and creating a single text file which holds all the information such as the location of the images and all parameters for the deformable model application.
after the initial preparation, it takes approximately  <dig> hours to complete the deformation of  <dig> initial spheres, creating  <dig> individual masks on a 64-bit pc with  <dig> mhz intel xeon cpu where each tube dataset is about  <dig>  gb in size with  <dig> ×  <dig> ×  <dig> μm resolution.
this is computer time in comparison to segmenting embryos manually on high resolution datasets which are labour intensive with roughly  <dig> hours of operator time for segmenting one embryo.
while we were unable to find alternate solutions to the problem of segmenting multiple similar and touching objects in the literature, we acknowledge that there are other advanced segmentation methods, such as level sets, graph cuts, or similar region growing algorithms, that could have been used instead.
the most likely alternate solution, level sets, involve numerical methods for tracking the evolution of contours and surfaces which uses image-based features such as mean, gradient and edges in the governing differential equations to segment the image  <cit> .
the same issues of preprocessing that we addressed with the pro-posed deformable model approach would likely have to be solved for a level-sets based implementation.
although our multi-resolution deformable model algorithm is capable of successful segmentation of multiple embryos while avoiding major leaks into neigh-boring embryos, it is still not considered fully automatic as it requires user's input for seed points at the beginning.
we would like to explore methods at which the initialization of multiple seed points can be done automatically and without any user intervention.
further, our algorithm does not use any methods to avoid self-intersecting meshes during the deformation.
currently, we have solved this issue by carefully choosing a high scale of the deformation at the first stage of deformation.
although successful most of the time, this stage of our algorithm is rather slow comparing to other stages of the deformation.
for this reason, we would like to investigate algorithms which can be added to our program for automatically avoiding self-intersecting meshes.
finally, we would like to be able to recover finer details of embryos by using a local refinement technique.
this implies that the meshes are not consistently refined everywhere but are locally refined at places of high curvature similar to -subdivision algorithm  <cit> .
competing interests
the authors declare that they have no competing interests.
authors' contributions
lb has modified the original deformable simplex mesh algorithm with different forces specifically the collision force to create simultaneous multiple mouse embryo segmentation.
mz has manually segmented  <dig> embryos and registered them together, her results is used to validate the results of the automatic segmentation.
jes and sb have designed and implemented the protocol for multiple mouse embryo mr imaging and provided the images used in this paper.
jgs, rmh and jpl assisted with the design and development of the algorithm and the drafting of the manuscript.
all authors read and approved the final version of the manuscript.
acknowledgements and funding
this project was funded by genome canada through the ontario genomics institute.
we acknowledge the helpful insights of dr hervé delingette of inria, france and dr david gobbi of atamai inc, london, canada.

 the mouse, due its genetic similarity to humans, the existence of sophisticated genetic tools to manipulate its genome, rapid reproduction time and comparatively low housing costs, has become an increasingly important model organism in mammalian biology. more recently, magnetic resonance imaging has emerged as tool for capturing three-dimensional anatomy to aid in phenotyping mice. there is, however, a resolution to time trade-off in mri which impacts its application to the mouse, where high resolution is essential due to the small size of the animal but is achieved with very long scan time. parallelization of mri experiments is one technique to compensate for the long imaging time. this encompasses either separate transmit/receive coils for each mouse, or packing multiple specimen into the same field of view while using a single coil. the latter strategy was chosen by schneider et al. for phenotyping mouse embryos, placing fixed specimen embedded in gel into a single tube which was then imaged using high-resolution mri at tesla. a complication of the multiple specimens within one field of view strategy, however, is the need to segment the image to isolate the individual specimens. most available published segmentation algorithms, moreover, fail this task. the two primary reasons are: inhomogeneities of intensity values within the gel and overlap between embryo and gel intensities, ruling out simple thresholding algorithms; and multiple specimens within the imaging tube are touching, ruling out region growing or snake algorithms as they leak into adjacent touching embryos. analysis of these datasets thus requires an algorithm which is not only capable of segmenting multiple embryos at the same time but can also separate adjacent touching embryos during segmentation. in this paper, we demonstrate a semi-automatic multiple embryo segmentation technique which allows us to create individual masks for all embryos starting from identical spheres. these masks can then be used to separate each embryo from the rest of the embryos in the tube for further analysis. our method is a modified version of the simplex mesh deformable algorithm of delingette with additional balloon and collision forces which allow for segmentation of each embryo as well as its satisfactory separation from neighbouring embryos. methods algorithm. related work the deformable simplex mesh algorithm is a general shape reconstruction technique which attempts to build a geometric model from a three-dimensional dataset. its surface representation is a simplex mesh with topology dual to that of triangulation. in addition, each vertex of a simplex mesh has a fixed number of neighbouring vertices directly connected to it. because of this geometry, simplex meshes defined discrete concepts at each vertex such as mean curvature and normal vectors which are used for the calculation of forces of deformation. this differs with triangle meshes in that each vertex of a triangle mesh can have many neighbours and concepts such as normal vectors are usually defined for each surface of the triangle rather than each vertex. for these reasons, simplex meshes are more preferable as deformable models rather than triangle meshes. on a three-dimensional simplex mesh, each vertex has three neighbouring vertices which define its tangent plane and normal vector. further, the angle between adjacent edges can be defined as a simplex angle which defines the local shape around each vertex. this angle can then be used for the computation of mean curvature, a measure of surface bending. finally, the position of a simplex vertex can be defined as a function of its neighbouring vertices and the shape parameters. due to the large extent of shape control, simplex meshes are better suited for deformation and smoothing than triangulation. just like most other deformable model schemes, each vertex of a simplex mesh is considered as a physical mass subject to equations of motion. to compute the evolution of each vertex p of the simplex mesh in a discrete time step t, we used the equation of motion both forces are calculated at time t, fint is the internal force which enforces geometric continuity of the mesh whereas fext constrains the distance between the mesh and a three-dimensional dataset. internal forces are calculated based on the geometry of simplex meshes and can be decomposed into a tangential force ftangent and a normal force fnormal. the tangent force controls the position of each vertex with respect to its three neighbours in the tangent plane. the normal force constrains the mean curvature of the surface through the simplex angle of each vertex. for details of how these forces are calculated see. the external force is dependent on the three dimensional dataset and is always directed along the normal direction at the vertex p. this not only guarantees a smooth deformation of mesh over time but ensures a non-self-intersecting mesh, which result should the displacement occur in the tangential direction. most deformable model algorithms base the external force on the image gradient. in the original paper, the external force is defined as follows the gradient force is determined from a search within a certain radius in the neighbourhood of each vertex for a voxel with the highest gradient intensity. the edge force is calculated by searching for the voxel with the highest intensity in the direction of the normal line of each vertex. despite their many intrinsic advantages, deformable model algorithms suffer from three main limitations: they are sensitive to initialization problems, which necessitates that they begin their deformation in close vicinity to the final desired solution in order to avoid becoming trapped in local minima; they are often unable to adapt to boundary concavities due to internal forces which keep the model smooth and minimize curvature; and they are prone to self-intersection unless adequately constrained by internal and external forces. we have modified the deformable model algorithm of delingette by adding four components to the original model to adequately segment mri scans of multiple embryos acquired within the same field of view. first, we have added a balloon force component to the definition of external forces. this allows us to start segmenting all embryos from identical spheres without having to worry about model getting trapped in close by local minima at stated in the above. second, a collision force component was also added to the definition of external forces. third, we have implemented the concept of a tube mask to exclude the plaster walls of the sample tube. the latter two concepts help solve the problem of touching embryos. finally, instead of segmenting one embryo at a time, we have designed and implemented a deformable model program which segments up to n embryos simultaneously. in the sections to follow, we explain the modifications to the original deformable model algorithm of delingette. the solution proposed herein, while designed with a particular application in mind, should be generally applicable for using deformable models to segment multiple similar and potentially touching objects within one image.. modified deformable model with balloon force initialization is one of the most challenging issues with deformable models. the success of most deformable model segmentation algorithms is determined by how closely the edges of the initial model follow that of the final result. if the initial model is much smaller than the object which is being segmented then the model will get stuck in local minima resulting in unsuccessful segmentation. in our case, since we start with identical initial models for all embryos, there is a need for a method to allow for local inflation of all models until they lie within a region of the image where they are close to the boundary of the embryos. to solve the multiple embryo initialization problem we implemented a two step solution wherein the image is fist coarsely classified into embryo versus gel, and secondly a balloon force is added to the deformable model to drive it towards the correct boundary. as mentioned in the previous section, due to non-uniform mri intensity values across the gel and similar intensities between gel and embryo in the image, thresholding algorithms are unsuccessful at separating embryos from gel. therefore, there is a need for an algorithm which is capable of labeling each voxel in the image as embryo versus non-embryo. here we employ a multispectral bayesian supervised classification algorithm previously implemented to separate human brain images in grey matter, white matter, spinal fluid, and lesions. the bayesian algorithm is based on using a training set determined by the user to initialize the voxel classification - either based on a probability map or manually selected. the training set refers to a list of 3d coordinates voxel intensities for each class type in our case points for class embryo and another points for class gel. the bayesian algorithm also uses statistical measures such as standard deviation from the data to further aid the classification of voxels in the image. the algorithm then estimates the probability density function on the basis of centroid and covariance matrix evaluated for each class which is defined in the training set. thus given an unknown sample, it is assigned to a class if a posteriori probability is maximized over the bayes' theorem. to create our classified image, we first create a training set from the image with labels embryo or gel. we then use this set of points to calculate the probability density function for each of the two classes and further determine the maximum likelihood of any sample point belonging to each of our classes on the basis of bayesian theorem. this will allow us to classify all voxels in image as explained above. it is important to mention that although the classification algorithm is capable of labeling the image with sufficient accuracy for initializing the deformable models, it has a tendency to label a few more voxels belonging to embryos than the actual embryos. as the problem of touching embryos already exist in the original mr images and is addressed by our algorithm, this does not create a problem for our technique. once the image is classified into embryo versus gel, a balloon force was designed to drive the mesh towards boundaries of the embryo while avoiding bad local minima using the classified image as a guide. it allows for the expansion of the initial spherical models until the edges of the model get close to the edges of the embryos. once the model edges are close to the embryo edges, the original deformable model strategy can be used to recover the edges of the embryos. we modify the external force of equation as follows where the balloon force is defined as where the b is the binary threshold operator on the classified image and n is the normal force at each vertex. where tlow and thigh are the lower and upper thresholds for desired intensity values of the objects of interest and in our case were chosen as tlow = - and thigh =. together, the balloon force and the classified image expand the initial models towards the correct boundaries of the embryos; this alone is, however, not sufficient for the final segmentation results. as explained before, the embryos are larger in the classified image than their actual size and without the gradient forces to stop the expansion of models at the correct embryo edges, the balloon force expands the models past the edges of embryos and segments the gel right around embryos as part of the embryos. further, a look at the classified image reveals that even if the embryos are not touching each other in the original image, they do intersect in the classified image, and hence without any intervention models will leak into each other as there are no barriers in between the embryos.. modified deformable model with collision force to solve the problem of segmenting multiple embryos touching each other, there is a need for a collision detection algorithm. we have designed a simple collision detection algorithm which allows us to check for collision after every few stages of the deformation. our approach is different than the traditional collision detection algorithms mainly because it checks the binary masks created from meshes using a simple rasterization algorithm instead of checking the meshes themselves. in our algorithm, every mesh will have a unique collision energy image c hence n collision energy images for n meshes. each collision energy image is created by "xor"ing all binary masks m except the one being deformed. for example, to create c we "xor" all binary masks m except m we create n collision energy images c to cn for n meshes as follows the collision energy image for each mesh can then be used to direct the deformation for that mesh away from all other meshes, hence creating collision detection. we have added another component to the external forces of equation as follows where the collision force is defined as where the collision image acts as a binary thresholding operator for the image intensity i after every iterations we check the vertices of each mesh for points of collision. we have picked since it allows the meshes to deform but not so much that there is a chance of collision before detection. at each collision point a small neighbourhood of the voxels are searched for the voxel with the highest gradient intensity hence fgradient. our collision energy is designed based on the assumption that the true boundary of the embryos is close by where the collision takes place between two meshes since they are expanding simultaneously. therefore, a gradient search around the neighbourhood of the collision point reveals the correct boundary of the embryos. the modified deformable model algorithm together with our collision detection method goes through the following steps to start deformation from identical spherical meshes and segment the embryos while avoiding collision between adjacent ones. use seed points determined by the user as the centers of identical spherical simplex meshes to initialize all embryos. simultaneously inflate all meshes on the classified image to avoid any local minima using the balloon force. this will help the models get close to the boundary of interest, in our case the edges of the embryos. while expanding the models, use the collision detection algorithm after every iterations to detect any collision between the models. if collision occurs, stop the inflation for models in collision and continue inflation for the rest of the models. continue until all models have stopped inflating. at this point, all models are within the vicinity of their corresponding embryos, use the gradient search algorithm to find close by edges of embryos. once the deformation have stopped for all the models, use a rasterization algorithm to create a binary mask for each embryo from the corresponding simplex deformable model.. modified deformable model with tube mask the collision image energy described in the previous section is capable of taking care of embryos touching each other but is unable to deal with cases where embryos are touching the walls of the sample tube. in these cases, there is no clear distinction between the embryo boundary and the edges of the tube, hence making it difficult for the deformable model to stop at the correct edge. to ensure that models will not leak into the outside of the tube we need to create a mask for the entire tube in the image and ensure the vertices of the models do not cross beyond the tube mask boundary. thus there is a need for an algorithm which is capable of labeling the image to background versus the rest of the image in our case. we adapted the bet brain segmentation algorithm for this purpose. this algorithm uses the intensity histogram of the image to find a robust lower and upper intensity values, while ignoring small number of voxels which have widely different values, to label brain versus background voxels as the basis of its segmentation. in our case, designed for labeling tube versus background voxels, a tube mask image is created from the original image. the lower intensity is found by calculating the mean value of the bin which holds the local minimum after the first highest peak. the maximum intensity is simply taken from the data range of the image. using these two values, thresholds are calculated which attempt to distinguish between the tube and background in the image. a binary threshold filter is then applied to the original image with the calculated high and low threshold values to create the final tube mask. at each iteration the final displacement of the model points are created and checked to make sure the displacement lands every point within the tube mask. if it happens that any point is displaced outside the tube, the displacement for that point is set to zero and the previous coordinate is assigned to the point ensuring that no point leaves the tube mask area. we have modified the original definition of the deformable simplex model algorithm with balloon force, collision force and tube mask to simultaneously deform up to n models while ensuring that they do not leak into each other or outside of the tube.. multi-resolution approach the gradient forces which attract the model towards the correct boundaries of the target are computed around each model point within a local region in the image and often gets the model stuck to spurious image features or non-true boundaries of the object. therefore, deformable models must be initialized close to the boundaries of the object to avoid unsuccessful segmentation. this feature of deformable model algorithms is also present in our modified version of the deformable model as it too searches the image within a local region of model points and can get the model stuck to non-true boundaries of the object. the multi-resolution approach allows the deformable model to pass over non-true boundaries of the object and to quickly find a rough boundary approximation in the early stages of deformation. another important reason for starting the deformation with low resolution models is that because our deformable model algorithm does not have any explicit checking for self-intersection, starting the deformation with high resolution models will likely result in self-intersecting models due to having too many points at the first stage of deformation at which the models are expanding by the balloon force. self-intersecting models result in binary masks with holes in them and since our collision detection algorithm relies on the binary masks created from the models, having non self-intersecting models is essential to the success of our algorithm. our deformable model algorithm starts with low resolution models. after the first stage of the deformation, the models go through major expansions with minimal or no self-intersection. however, low resolution models only recover approximate edges of the target boundaries. to recover finer boundary features of the embryos high resolution models are needed. we increase the resolution of the models by a two fold after every stage of the deformation and continue until achieving satisfactory results and the algorithm has reached the convergence criteria. implementation initialization is one of the main problems with most deformable model algorithms. the deformable model algorithms usually can only find the close by edges once the model is placed within the close vicinity of the shape of interest. although we use the balloon force to locally inflate the initial meshes and get close to the boundaries of interest, we still need a starting point for each individual mesh. thus, there is a need for a separate method to determine the initial location of the models before segmentation can take place. delingette has proposed automatic methods for initialization, however, these algorithms have very limited range of application and are sensitive to image noise and most importantly are not designed for multiple object initialization which is required in our case since we are deforming multiple models simultaneously. our deformable model algorithm uses manual initialization. a user must determine n seed points from the image before attempting to segment n embryos for each dataset. we define the seed point as any 3d point which lies within the boundaries of an embryo, preferably in the centre. the seed points are then used as the centres of n equal size spherical simplex meshes. once the seeds are determined and the meshes are initialized, the algorithm starts deformation. the location of a seed point for initialization of any deformable model algorithm is defined as a point within the boundaries close to the center of the object of segmentation. in our case, we have tested our algorithm with seed points within voxels of each other and had successful results while keeping all parameters identical. however, seed points which are very close to the embryo edges resulted in unsuccessful segmentation. an overlaid view of masks created for segmenting the embryos with set of seed points of embryos is shown in. these masks are also overlaid with masks created from segmenting the embryos using set of seed points. to determine the sensitivity of our algorithm to initialization, we have segmented one set of embryos with three different sets of seed points and determined the mean and standard deviation of the overlapped masks to be ±. our algorithm is designed for simultaneous multiple object segmentation. this means that once the seed points are determined by the user, the algorithm initializes as many identical spherical deformable simplex meshes as the number of seed points and start the deformation on all initial models simultaneously. four initial models are shown as masks overlaid on their corresponding embryos. all forces that are governing our algorithm are strengthened or weakened through the use of weight factors. every parameter ranges from zero to one. we have determined the particular values for each of our parameters through experimentation. at the start of the deformation, edge forces are kept at zero as it is not being used. balloon forces and internal forces are kept high at and respectively, this is to ensure that the meshes are expanding rapidly while being kept smooth and hence free of self-intersection. the gradient and collision forces are kept at a middle range at and respectively to make sure mesh expansion is possible to the maximum limit but not beyond the embryo boundaries. simplex meshes also benefit from having control over the scale of smoothness which is defined as the size of the neighborhood around each point used for smoothing of the mesh. to avoid self-intersection to the maximum level, the scale of the smoothness is also kept very high at at the early stages of deformation. after the first stage of deformation, the meshes are expanded dramatically and are close to the true edges of the embryos. at this stage, the resolution of the mesh is increased by two fold, balloon and internal forces are decreased to and respectively. the balloon force is decreased because there is no need for further expansion of the meshes as they are already close to the edges of the embryos. the internal forces which keep the meshes smooth is also decreased so as to allow the meshes to recover finer edges of the embryos. the gradient force is increased to to make sure the meshes are attracted to the edges of the embryos and the collision force is decreased to to avoid collision between touching embryos while further deformation is still taking place. the smoothness scale is also decreased to since self-intersecting meshes mostly occur during the first stage of deformation when meshes go through major expansion. it has been observed that if the collision detection force is kept at a very high level of - to keep the segmentation of touching neighbouring embryos free of any intersection, the embryos will not be fully segmented. to overcome this problem, the collision detection force is reduced to mid range of - to allow slight touching of embryos so they can be fully segmented. the stage of deformation with high resolution models can take place between to times in order to recover all fine feature of the embryos or when convergence is reached. however, convergence does not imply that the modified deformable model algorithm is capable of recovering fine features such as paws or tails of the embryos. to recover such fine features using the simplex model deformable algorithm either the features have to be present in the initial model or there is a need for an algorithm which is capable of refining the model locally i.e., increase the resolution of the mesh only around areas with fine features. the deformation continues until the models are stabilized. to determine the stability of each mesh, each point of the simplex mesh is classified as "active" or "inactive". a point is considered "inactive" if the magnitude of its displacement is less than a user defined threshold of in our case. the activity of each simplex mesh during the last n iterations is defined as the ratio of its inactive points over the total number of points. any mesh with activity ratio of higher than a user determined threshold value of is considered stabilized hence converged. the deformation continues for meshes which are not converged while disabling the meshes which are converged until all the meshes are stabilized. figure gives an overview of our modified deformable model algorithm with collision detection.  using identical parameters, we have segmented 3d images of six tubes of multiple embryos provided by oxford university. figure shows the results of the segmentation at different stages of the deformation of one of the datasets. figure shows the closeup view of one embryo with manual and automatic segmentation. we validated the deformable model algorithm against manual segmentations of embryos originating from two tubes of and embryos respectively. examples of manual and automated segmentation are shown in figure a quantitative summary is shown in table in order to assess the source of error in the deformable model algorithm, we used non-linear image registration to bring all embryos and their corresponding segmentations into alignment. as can be seen in figure the maximum error occurs around the tail and paws of the embryos. given that the primary error was in the tail and paws, we next checked whether organs were included in the automatically generated mask. to do this, all the organs were first manually segmented on the two average embryo images created in the previous section. using the inverse transformations, the segmented organs were then registered to each individual mask created by our program and the results were compared. table reports the mean and standard deviation of four different organs for the two tubes. the liver, lung, and ventricle of the heart were fully included in the embryo masks in every single case. minor errors were found in the brain.  we have developed a novel multi-resolution segmentation technique for semi-automatically segmenting multiple embryos simultaneously. our multiple embryo segmentation technique can also be applied to other multiple object segmentation problems with possible touching of objects. our algorithm was found to be highly accurate in capturing the whole embryo as well as its organs. our deformation scheme follows a low to high resolution approach at which we start the deformation with low resolution meshes and continue increasing the resolution of the meshes through higher stages of deformation. the meshes are then deformed using a combination of internal and modified external forces. the multi-resolution approach allows us to use identical initial models for all embryos while quickly and efficiently recovering the rough overall anatomical structure of the embryos at the first stage of deformation. the final shape of the embryo is then recovered by subsequently capturing the finer details of the embryos with higher resolution meshes at every stage of the deformation. we have designed and implemented the concept of balloon force to allow us to start the deformation with small spheres and successfully reach the boundaries of the embryos. using small initial models is a major issues with most deformable models as they can get trapped in local minima. however, our algorithm has overcome this problem by introducing the concept of balloon force. to solve the problem of touching embryos, a novel collision detection algorithm was introduced. the collision detection method allows us to segment multiple embryos while avoiding major leaks into adjacent neighboring embryos. to our knowledge, most collision detection algorithms work on triangle meshes only whereas in our case binary masks created from the meshes are used. in order to recover the complete shape of all embryos, collision forces were kept in such a way that a small collision between the embryos was allowed. our multi-resolution deformable model algorithm with collision detection and balloon forces has overcome some of the difficulties of deformable model algorithms while allowing us to segment multiple embryos simultaneously. it has also enabled us to segment as many embryos without having to worry about the touching embryos. our algorithm is written entirely in c++ as part of the insight toolkit itk.org-insightapplications/deformablemodelsimplexmesh open source software. it takes about half an hour to make the initial preparations including determining the seed points, creating the classified image and creating a single text file which holds all the information such as the location of the images and all parameters for the deformable model application. after the initial preparation, it takes approximately hours to complete the deformation of initial spheres, creating individual masks on a 64-bit pc with mhz intel xeon cpu where each tube dataset is about gb in size with × × μm resolution. this is computer time in comparison to segmenting embryos manually on high resolution datasets which are labour intensive with roughly hours of operator time for segmenting one embryo. while we were unable to find alternate solutions to the problem of segmenting multiple similar and touching objects in the literature, we acknowledge that there are other advanced segmentation methods, such as level sets, graph cuts, or similar region growing algorithms, that could have been used instead. the most likely alternate solution, level sets, involve numerical methods for tracking the evolution of contours and surfaces which uses image-based features such as mean, gradient and edges in the governing differential equations to segment the image. the same issues of preprocessing that we addressed with the pro-posed deformable model approach would likely have to be solved for a level-sets based implementation. although our multi-resolution deformable model algorithm is capable of successful segmentation of multiple embryos while avoiding major leaks into neigh-boring embryos, it is still not considered fully automatic as it requires user's input for seed points at the beginning. we would like to explore methods at which the initialization of multiple seed points can be done automatically and without any user intervention. further, our algorithm does not use any methods to avoid self-intersecting meshes during the deformation. currently, we have solved this issue by carefully choosing a high scale of the deformation at the first stage of deformation. although successful most of the time, this stage of our algorithm is rather slow comparing to other stages of the deformation. for this reason, we would like to investigate algorithms which can be added to our program for automatically avoiding self-intersecting meshes. finally, we would like to be able to recover finer details of embryos by using a local refinement technique. this implies that the meshes are not consistently refined everywhere but are locally refined at places of high curvature similar to -subdivision algorithm. competing interests the authors declare that they have no competing interests. authors' contributions lb has modified the original deformable simplex mesh algorithm with different forces specifically the collision force to create simultaneous multiple mouse embryo segmentation. mz has manually segmented embryos and registered them together, her results is used to validate the results of the automatic segmentation. jes and sb have designed and implemented the protocol for multiple mouse embryo mr imaging and provided the images used in this paper. jgs, rmh and jpl assisted with the design and development of the algorithm and the drafting of the manuscript. all authors read and approved the final version of the manuscript. acknowledgements and funding this project was funded by genome canada through the ontario genomics institute. we acknowledge the helpful insights of dr hervé delingette of inria, france and dr david gobbi of atamai inc, london, canada.
to determine collision during segmentation, our unique collision detection algorithm finds the intersection between binary masks created from the deformed models after every few iterations of the deformation and modifies the segmentation parameters accordingly hence avoiding collision. the motivation behind this paper is to aid the automatic phenotyping of mouse embryos, wherein multiple embryos embedded within a single tube were scanned using magnetic resonance imaging. further, it presents the results of segmenting magnetic resonance images of up to mouse embryos stacked in one gel filled test tube and creating individual masks. in addition, it proposes a novel technique for automatic collision detection of multiple objects which are being segmented simultaneously, hence avoiding major leaks into adjacent neighbouring structures. we address the initialization problem by introducing balloon forces which expand the initial spherical models close to the true boundaries of the embryos. this results in models which are less sensitive to initial minimum of two fold after each stage of deformation. we have then validated the results of the our semi-automatic segmentation versus manual segmentation of the same embryos. we have segmented six tubes of three dimensional mr images of multiple mouse embryos using our modified deformable model algorithm. our validation shows that except paws and tails we have been able to segment the mouse embryos with minor error. our algorithm, a modified version of the simplex deformable model of delingette, addresses various issues with deformable models including initialization and inability to adapt to boundary concavities. this paper describes our novel multiple object segmentation technique with collision detection using a modified deformable model algorithm.
 the motivation behind this paper is to aid the automatic phenotyping of mouse embryos, wherein multiple embryos embedded within a single tube were scanned using magnetic resonance imaging.  our algorithm, a modified version of the simplex deformable model of delingette, addresses various issues with deformable models including initialization and inability to adapt to boundary concavities. in addition, it proposes a novel technique for automatic collision detection of multiple objects which are being segmented simultaneously, hence avoiding major leaks into adjacent neighbouring structures. we address the initialization problem by introducing balloon forces which expand the initial spherical models close to the true boundaries of the embryos. this results in models which are less sensitive to initial minimum of two fold after each stage of deformation. to determine collision during segmentation, our unique collision detection algorithm finds the intersection between binary masks created from the deformed models after every few iterations of the deformation and modifies the segmentation parameters accordingly hence avoiding collision. we have segmented six tubes of three dimensional mr images of multiple mouse embryos using our modified deformable model algorithm. we have then validated the results of the our semi-automatic segmentation versus manual segmentation of the same embryos. our validation shows that except paws and tails we have been able to segment the mouse embryos with minor error.  this paper describes our novel multiple object segmentation technique with collision detection using a modified deformable model algorithm. further, it presents the results of segmenting magnetic resonance images of up to mouse embryos stacked in one gel filled test tube and creating individual masks. 