op=Cell_Staining_Artifacts();
set(op,'fraction_bleached',1);
set(op,'fraction_unstained',2);
subpop{1}.add_cell_artifact(op);
op=Out_Of_Focus_Cells();
set(op,'fraction_blurred',1);
set(op,'blur_radius',2);
subpop{1}.add_cell_artifact(op);
subpop{2}.compositing=Default_Compositing();
set(subpop{2}.compositing,'container_weight',0.3);
op=Add_Basal_Brightness();
set(op,'basal_level',0.1);
op=Linear_Image_Gradient();
set(op,'falloff_coefficient',0.1);
set(op,'max_multiplier',1);
set(op,'min_multiplier',0);
set(op,'falloff_type','Linear');
op=Radial_Image_Gradient();
set(op,'falloff_radius',100);
set(op,'max_multiplier',1);
set(op,'min_multiplier',0);
set(op,'falloff_type','Linear');
add_marker(subpop{2},'Myosin','Green');
op=Angular_Marker_Gradient();
set(op,'center','Furthest From Edge');
set(op,'angular_width',30);
set(op,'falloff_type','Exponential');
set(op,'min_multiplier',0);
subpop{2}.markers.Myosin.cytoplasm.AddOperation(op);
add_marker(subpop{2},'Density_Marker','Blue');
op=Cell_Density_Dependant_Marker_Level();
set(op,'max_level',2);
set(op,'falloff_radius',200);
set(op,'falloff_type','Gaussian');
set(op,'increasing_or_decreasing','Decreasing');
subpop{2}.markers.Density_Marker.nucleus.AddOperation(op);
%The level of this marker in a cell is inversely correlated with the %presence of the Red 'menv' marker. This is achieved using the %'Constant_Dependant_Marker_Level' plugin. %It sets the marker level in to a constant, with the value of this %constant being varying with the mean level of another marker. op=Constant_Dependant_Marker_Level(); %If x_(m,r) is the mean level in of marker m in region r, then %this plugin sets the intensity of chosen marker in chosen region to %be: slope*x_(m,r) + intercept %slope in the equation above, negative sign means inverse relation set(op,'slope',-2.5); %Intercept in equation above. This is the level the marker will have %if the other marker x_(m,r) is zero set(op,'intercept',0.9); %The other marker i.e. m on which this marker depends set(op,'marker',subpop{1}.markers.menv.cytoplasm); %The region on which m is calculated i.e. r set(op,'region',subpop{1}.objects.cytoplasm); set(op,'func','Mean'); %The last three lines specify that the mean level of the menv marker %measured on the cytoplasmic region will be used to determine the %level of GFP. subpop{1}.markers.GFP.cytoplasm.AddOperation(op);
%Set a constant marker level (uniform across entire object, but varying
%from cell to cell)
op=Constant_Marker_Level();
%The marker level for a cell is sampled from a normal distribution with
%this mean
set(op,'mean_level',0.7);
%This standard deviation
set(op,'sd_level',0.1);
%Once the operation is defined, we add it to the queue
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Add Radial Gradient
%Have the intensity fall off rapidly with the distance to the edge
op=Distance_To_Edge_Marker_Gradient();
%pixels over which intensity falls off by 1/e
set(op,'falloff_radius',10);
%the intensity fall off functional form
set(op,'falloff_type','Gaussian');
%Intensity decreases with distance to the edge
set(op,'increasing_or_decreasing','Decreasing');
subpop{1}.markers.Myosin.cytoplasm.AddOperation(op);
%We want the first marker to essentially cluster near the center of the
%cell, and die out before the edge of the cell. Since the cells in this
%subpopulation are spherical, this can be
%parametrized in terms of the distance to the nucleus.
%Add Radial Gradient (scaling of intensity at a pixel decreases with
%distance of that pixel to the nucleus)
op=Distance_To_Shape_Marker_Gradient();
%The number of pixels over which intensity falls by 1/e
set(op,'falloff_radius',10);
%The intensity fall off functional form
set(op,'falloff_type','Gaussian');
%Whether intensity increases or decreases based on the distance
set(op,'increasing_or_decreasing','Decreasing');
%Distance is measure wrt the nucleus
set(op,'distance_to',subpop{1}.objects.nucleus);
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Add Linear Gradient
op=Linear_Marker_Gradient();
%Set how quickly intensity falls off (0 slow, 1 immediately)
set(op,'falloff_coefficient',0.1);
%Max value multiplying the input intensities
set(op,'max_multiplier','1');
%Distance is measure wrt the nucleus
set(op,falloff_type,'Linear');
%Add the operation to the object marker
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Marker 1
add_marker(subpop{2},'Myosin','Red');
(...)
%Marker 2
add_marker(subpop{2},'Actin','Green');
%In this case we have the green marker depend on the the red one, and
%avoid it. This is done at a pixel level. If I is the intensity of the
%red marker at a pixel then the intensity of the green marker is:
%slope*I+intercept (where slope and intercept are specified below). A
%negative value of the slope implies supression.
op=Locally_Dependant_Marker_Level();
%The red marker strongly supresses the green one.
set(op,'slope',-100);
set(op,'intercept',0.8);
set(op,'marker',subpop{2}.markers.Myosin.cytoplasm);
subpop{2}.markers.Actin.cytoplasm.AddOperation(op);
op=Microenvironmental_Marker_Level();
%This plugin first generates a semi-random (with some spatial
%correlations) 'micro-environment' intensity over the image.
%Then, the level of the the marker is proportional to the intensity
%of the micro-environment at the location of the cell.
%The length scale over which spatial correlation exists for the
%microenvironment. (2 means variations at the length of image, 6 is high
%frequency variation)
set(op,'length_scale',3);
%Each higher frequency component amplitude is smaller by this scaling
%factor
set(op,'frequency_falloff',0.8);
%The type of variation in micro-environment. Turbulent causes sharper
%transitions
set(op,'noise_type','Turbulent');
%Once the operation is defined, we add it to the queue
subpop{1}.markers.menv.cytoplasm.AddOperation(op);
%Perlin Texture (scale the intensity from the last step by a noisy
%texture, to make it look more realistic)
op=Perlin_Texture();
%The amplitude of the noise (0 is not noise, and you probably don't
%want to go much beyond 1, since intensities are in the [0-1] range)
set(op,'amplitude',0.3);
%This describes the length scale over which intensity varies. 2 is low
%wave-length (coarse variation) and 6 is very fine high frequency
%(fine variation)
set(op,'length_scale',5);
%Each higher frequency component amplitude is smaller by this scaling
%factor
set(op,'frequency_falloff',0.5);
%The type of noise. Turbulent causes sharper transitions
set(op,'noise_type','Turbulent');
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Rescale Marker Level
op=Rescale_Marker_Levels();
%Minimum Intensity After Rescaling
set(op,'min_intensity',0.5);
%Maximum Intensity After Rescaling
set(op,'max_intensity',0.9);
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Create the impression of turbulence using the turbulent
%texture which semi-randomly moves pixels around locally, as might
%happen in a turbulent fluid.
op=Turbulent_Texture();
%This is the max distance in pixels that a pixel can be moved
set(op,'max_displacement',7);
%This describes the length scale over which intensity varies. 2 is low
%wave-length (coarse variation) and 6 is very fine high frequency
%(fine variation)
set(op,'length_scale',5);
%Each higher frequency component amplitude is smaller by this scaling
%factor
set(op,'frequency_falloff',0.8);
subpop{1}.markers.Actin.cytoplasm.AddOperation(op);
%Set the Model Placement %Placement refers to the position of cell in an image. %Cells in different subpopulations can display different patterns of %placement (e.g, one type of cells may be clustered or placed randomly) %Placement for cells in a subpopulation are specified through the %placement property in subpopulation, which you need to set the the %appropriate placement model. %Models for placments are classes of type SimuCell_Placement_Model, and %are implemented via plugins (usually placed in the 'plugins/placement/' %directory). %Here we choose to have cells placed close to form cluster, and so choose %the 'Clustered_Placement' model. subpop{1}.placement=Clustered_Placement(); %Number of clusters of cells in image set(subpop{1}.placement,'number_of_clusters',10); %Positions are selected with gaussian probability %distributions of this width (in pixels) centered at the clusters. set(subpop{1}.placement,'cluster_width',200); %The boundary is the number of pixels around the edge of the image where %no cells are placed. set(subpop{1}.placement,'boundary',100); %Probability that the cell is part of the cluster, non-clustered cells are %placed randomly. set(subpop{1}.placement,'clustering_probability',0.8);
%Set the Model Placement %Placement refers to the position of cell in an image. %Cells in different subpopulations can display different patterns of %placement (e.g, one type of cells may be clustered or placed randomly) %Placement for cells in a subpopulation are specified through the %placement property in subpopulation, which you need to set the the %appropriate placement model. %Models for placements are classes of type SimuCell_Placement_Model, %and are implemented via plugins (usually placed in the %'plugins/placement/' directory). %Here we choose to have cells placed close to existing cells, and so %choose the 'Nearby_Placement' model. subpop{1}.placement=Nearby_Placement(); %The placement models follow the typical model specification %(see SimuCell_Model, Parameter), and the user settable parameters %can be found in the plugin file. These parameters follow the standard %set framework. %For this model, probability of a pixel being picked is dependent on %its distance to the nearest existing cell. The functional form of this %dependence is the probability density function of a poisson %distribution with mean specified by the 'distance_to_existing' below set(subpop{1}.placement,'distance_to_existing',15); %The boundary is the number of pixels around the edge of the image %where no cells are placed. set(subpop{1}.placement,'boundary',100); %Probability that the cell is part of the cluster, non-clustered %cells are placed randomly. set(subpop{1}.placement,'clustering_probability',0.8);
%Set the Model Placement %Placement refers to the position of cell in an image. %Cells in different subpopulations can display different patterns of %placement (e.g, one type of cells may be clustered or placed randomly) %Placement for cells in a subpopulation are specified through the %placement property in subpopulation, which you need to set the the %appropriate placement model. %Models for placements are classes of type SimuCell_Placement_Model, and %are implemented via plugins (usually placed in the 'plugins/placement/' %directory). %Here we choose to have cells placed close to existing cells, and so %choose the 'Random_Placement' model. subpop{1}.placement=Random_Placement(); %The boundary is the number of pixels around the edge of the image where %no cells are placed. set(subpop{1}.placement,'boundary',100);
%Create a new Object 'cytoplasm' add_object(subpop{2},'cytoplasm'); %Set the Centered_Cytoplasm_Model model subpop{2}.objects.cytoplasm.model=Centered_Cytoplasm_Model; Set the parameters set(subpop{2}.objects.cytoplasm.model,'radius',60); set(subpop{2}.objects.cytoplasm.model,'eccentricity',0.6); set(subpop{2}.objects.cytoplasm.model,'randomness',0.2); %The cytoplasm is drawn around the nucleus set(subpop{2}.objects.cytoplasm.model,'centered_around',... subpop{2}.objects.nucleus);
%Create a new Object 'cytoplasm' add_object(subpop{2},'cytoplasm'); %Set the Cytoplasm_Model model subpop{2}.objects.cytoplasm.model=Cytoplasm_Model; Set the parameters set(subpop{2}.objects.cytoplasm.model,'radius',60); set(subpop{2}.objects.cytoplasm.model,'eccentricity',0.6); set(subpop{2}.objects.cytoplasm.model,'randomness',0.2);
%Create a new Object 'cytoplasm' add_object(subpop{2},'cytoplasm'); %Set the Fluid_Shape model subpop{2}.objects.cytoplasm.model=Fluid_Shape; Set the parameters set(subpop{2}.objects.cytoplasm.model,'radius',60); set(subpop{2}.objects.cytoplasm.model,'eccentricity',0.6); set(subpop{2}.objects.cytoplasm.model,'randomness',0.2);
%Create a new Object 'nucleus' add_object(subpop{2},'nucleus'); %Set the Centered_Nucleus_Model model subpop{2}.objects.nucleus.model=Centered_Nucleus_Model; Set the parameters set(subpop{2}.objects.nucleus.model,'radius',60); set(subpop{2}.objects.nucleus.model,'eccentricity',0.6); set(subpop{2}.objects.nucleus.model,'randomness',0.2); %The nucleus is drawn at the center of the cytoplasm set(subpop{2}.objects.nucleus.model,'centered_around',... subpop{2}.objects.cytoplasm);
%Create a new Object 'nucleus' add_object(subpop{2},'nucleus'); %Set the Nucleus_Model model subpop{2}.objects.nucleus.model=Nucleus_Model; Set the parameters set(subpop{2}.objects.nucleus.model,'radius',60); set(subpop{2}.objects.nucleus.model,'eccentricity',0.6); set(subpop{2}.objects.nucleus.model,'randomness',0.2);
%Create a new Object 'nucleus'
add_object(subpop{2},'nucleus');
%Set the Nucleus_Model model
subpop{2}.objects.nucleus.model=SLML_Nucleus_Model;
Set the parameters
set(subpop{2}.objects.nucleus.model,'radius',60);
set(subpop{2}.objects.nucleus.model,'filename','data/slml/nucleolus.mat');
add_object(subpop{1},'fiber');
subpop{1}.objects.fiber.model=Microtubule_Fibre_Model;
set(subpop{1}.objects.fiber.model,'nucleus',subpop{1}.objects.nucleus,...
'cytoplasm',subpop{1}.objects.cytoplasm