dynamicAtlas#

Example Usage#

Suppose we want to grab all the Wild-type Runt data:

>> da = dynamicAtlas.dynamicAtlas('/path/to/data/', {'WT', 'Runt'})

Then we could slice all of this data with a given timestamp range (timestamp-delta, timestamp+delta)

>> qs = da.findTime(timestamp, delta)

Then we have a queriedSample object

mapWT = da.lookup('WT') ;

Now mapWT has methods:

>> methods(mapWT)

To find embryos with a Runt stain, you can say:

>> runts = findGenotypeLabel('WT', 'Runt')

Alternatively, we can take a peek within the lookup map of da to get all Runt labels, regardless of genotype:

>> runts = mapWT.findLabel('Runt')

or even index the map stored in da’s lookup map:

>> runts = mapWT.map('Runt')

To find embryos with a t=10 +/- 2 min

>> snaps = mapWT.findTime(10, 2)

To find Runt stains with a t=10 +/- 2 min

>> runtsnaps = mapWT.findLabelTime('Runt', 10, 2)

Use dynamic datasets within the lookupMap to build master timeline. To control how this is performed, toggle da.timeLineMethod:

>> da.makeMasterTimeline('WT', 'Runt')

Timestamp other data against the master timeline. To control how this is performed, toggle da.timeStampMethod:

>> da.timeStampStripe7('WT', 'Runt')

To Do:#

handle PIV-based timeline creation

Full Contents:#

class @dynamicAtlas.dynamicAtlas(atlasPath, genotypes, Options)#

Bases: sphinxcontrib.mat_types.handle

DYNAMICATLAS Dynamic Atlas of biological images An object that handles timing datasets of dynamic 2D images

addPaths(da)#

ADDPATHS(da) Add paths needed for all routines Add paths needed for subsequent methods in dynamicAtlas

buildLookup(da, genotypes_subset, Options)#
BUILDLOOKUP(da)

Create lookup map object for each genotype in dynamicAtlas

Parameters
  • genotypes_subset (optional cell array of string specifiers) – the subset of genotypes to index in the atlas instance

  • Options (optional struct) –

dynamicAtlas(atlasPath, genotypes, Options)#
DYNAMICATLAS Construct an instance of this class

Create a dynamicAtlas instance

Parameters
  • atlasPath (str) – the path containing each genotype directory

  • genotypes (optional cell array of strings (default = all)) – the genotypes to include in the atlas object

  • Options (struct with fields) –

    labelsoptional cell of strings

    labels to include in the atlas, if only some subset of labels are desired as part of the atlas instance

    timeLineMethodoptional str (default = ‘realspace’)

    Method string specifier for building master timeLine(s)

    timeStampMethodoptional str (default = ‘stripe7’)

    Method string specifier for time stamping

    timerfnstr, default=’timematch_*_*stripe7_chisq.mat’

    name of file to use to obtain timestamp for each embryo, passed to lookupMap

    prependstr, default=’MAX_Cyl1_2_000000_c*_rot_scaled_view1’

    filename search string without extension for pullback

    extenstr, default=’.tif’

    filename extension for pullback

Returns

da

Return type

dynamicAtlas class instance

findDynamicGenotypeLabel(da, genotype, label)#
FINDDYNAMICGENOTYPELABEL(genotype, label2find) Find dynamic embryos with label

Give the times, folders, and time uncertainties of all live samples matching the supplied channel ‘label’

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

Returns

qs – queriedSample with properties meta: struct with fields

folders : Nx1 cell array of paths to label data names : Nx1 cell array of label data filenames embryoIDs : Nx1 cell array of embryoIDs times : Nx1 cell array of timestamps (each could be array) unc : Nx1 cell array of timestamp uncertainties nTimePoints : Nx1 int array of #timepoints in each dataset

datainitially empty cell of data images

can be populated via qs.getData()

gradientsinitially empty cell of gradient images

can be populated via qs.getGradients()

smoothinitially empty cell of smoothed data images

can be populated via qs.getSmooth()

PIVinitially empty cell of velocity fields

can be populated via qs.getPIV()

Return type

queriedSample class instance

findDynamicGenotypeLabelTime(da, genotype, label, time, deltaT)#
FINDDYNAMICGENOTYPELABEL(genotype, label2find) Find dynamic embryos with label

Give the times, folders, and time uncertainties of all live samples matching the supplied channel ‘label’

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

  • time (target timestamp to search for within da instance) –

  • deltaT (range of acceptable times are time+/-deltaT) –

Returns

qs – queriedSample with properties meta: struct with fields

folders : Nx1 cell array of paths to label data names : Nx1 cell array of label data filenames embryoIDs : Nx1 cell array of embryoIDs times : Nx1 cell array of timestamps (each could be array) unc : Nx1 cell array of timestamp uncertainties nTimePoints : Nx1 int array of #timepoints in each dataset

datainitially empty cell of data images

can be populated via qs.getData()

gradientsinitially empty cell of gradient images

can be populated via qs.getGradients()

smoothinitially empty cell of smoothed data images

can be populated via qs.getSmooth()

PIVinitially empty cell of velocity fields

can be populated via qs.getPIV()

Return type

queriedSample class instance

findDynamicGenotypeLabelWithPIV(da, genotype, label)#
findFlowGenotypeLabel(genotype, label2find)

Find dynamic embryos of specified genotype with specified label that have measured flowfields v(x,y,t) on embryo surface. Give the times, folders, and time uncertainties of all live samples matching the supplied channel ‘label’

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

Returns

qs

Return type

queriedSample class instance

findEmbryo(da, embryoID)#
FINDEMBRYO(embryoID) Find all instances with given embryo

Give the names, folder, times, and time uncertainties for stained samples matching the supplied embryoID. Assumes that a given embryo has only one genotype.

Parameters
  • obj (the class instance of lookup) –

  • embryoID (string, embryo identification name) – (ex ‘201904011200’)

Returns

estruct – The output structure with fields labels, folders, times, uncs

Return type

struct

findGenotypeLabel(da, genotype, label)#

FINDGENOTYPELABEL(genotype, label)

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

Returns

qs

Return type

queriedSample class instance

findGenotypeLabelTime(da, genotype, label, time, time_unc)#

FINDGENOTYPELABEL(genotype, label)

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

Returns

qs

Return type

queriedSample class instance

findStaticGenotypeLabel(da, genotype, label)#
FINDSTATICGENOTYPELABEL(genotype, label2find) Find dynamic embryos with label

Give the times, folders, and time uncertainties of all live samples matching the supplied channel ‘label’

Parameters
  • genotype (str, the genotype in which to search) –

  • label (string, label name (ex 'Eve' or 'Runt')) –

Returns

qs – queriedSample with properties meta: struct with fields

folders : Nx1 cell array of paths to label data names : Nx1 cell array of label data filenames embryoIDs : Nx1 cell array of embryoIDs times : Nx1 cell array of timestamps (each could be array) unc : Nx1 cell array of timestamp uncertainties nTimePoints : Nx1 int array of #timepoints in each dataset

datainitially empty cell of data images

can be populated via qs.getData()

gradientsinitially empty cell of gradient images

can be populated via qs.getGradients()

smoothinitially empty cell of smoothed data images

can be populated via qs.getSmooth()

PIVinitially empty cell of velocity fields

can be populated via qs.getPIV()

Return type

queriedSample class instance

findTime(da, tfind, eps)#
FINDTIME(tfind, eps) Find all instances with time near tfind

Give the labels, folders, and time uncertainties of all stained samples matching the supplied time tfind, within a value eps of that time. Returns an output struct.

Parameters
  • obj (the class instance of lookup) –

  • tfind (float or int timestamp) –

  • eps (optional, the allowed difference from tstamp) –

genotypes = None#

cell array of string specifiers

lookup = None#

containers.Map() object connecting genotype

makeMasterTimeline(da, genotype, label, Options)#
MAKEMASTERTIMELINE(genotype, label, Options)

Build a master timeline for this genotype based on the dynamic pullbacks contained in genotype/label/

Parameters
  • da (dynamicAtlas class instance) –

  • genotype (str) –

  • stain (str) –

  • Options (struct with optional fields) – preview : optional bool, view intermediate results overwrite : optional bool, overwrite previous master timeline thres : optional float, threshold intensity for binarization ssfactor : optional int, subsampling factor apCijFrac : optional float between 0-1, amount of anterior end to ignore

Returns

  • <none>

  • Saved to disk

  • ————-

  • dynamicAtlas.path/timing/genotype/label/realspace_corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/stripe7corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/timeline_ss%02d_<corr_method>corr/

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<method>_dynamic.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<method>_dynamic.txt

path = None#

path to the atlas parent directory

timeLineMethod = None#

string specifiers to lookupMap instances

timeStamp(da, genotype, label, Options)#
TIMESTAMP(da, genotype, label, Options)

Find appropriate timestamp for data stained by ‘label’ for all fixed pullbacks compared to master timeline

Parameters
  • da (dynamicAtlas class instance) – the dynamicAtlas for which we find timestamps

  • genotype (str) –

  • stain (str) –

  • Options (struct with optional fields) –

    methodoptional char, default=’stripe7’

    method by which we timestamp this embryo

    save_fancy : optional bool, default=true overwrite : optional bool, default=false

    overwrite previous results

    hands_onoptional bool, default=true

    use interactive domain selection for chisquare fitting

    cdf_minoptional float, default=0.01

    intensity cumulative distribution function minimum cutoff

    cdf_maxoptional float, default=0.999

    intensity cumulative distribution function maximum cutoff

    sigmaoptional float, default=20

    smoothing used in the stripe ID in iLastik

    optimize_transoptional bool, default=true

    allow translation of the stripe7 curve in fitting to reference curves

    timeLineLabeloptional str, default=<same as label>

    allows the <label> fixed data to be compared to For ex, label=Runt (fixed data is Runt), but masterTimeLineLabel=Eve (live data is Eve).

    timeLineLeadingTrailingoptional str, default=’leading’

    whether to use leading edge of timeLine stripe7 data or trailing edge

Returns

  • <none>

  • Saves to disk

  • ————-

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_chisq.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_chisq.txt

timeStampMethod = None#
@dynamicAtlas.makeGradientImages(da, selectedLabels, sigmas, steps, cdf_minmax, overwrite)#
MAKEGRADIENTIMAGES(da, selectedLabels, sigmas, steps,…

cdf_minmax, overwrite)

Compute gradients of image intensities averaged over different

scales and store them on disk

Parameters
  • da (dynamicAtlas class instance) – dynamic atlas class for all genotypes

  • selectedLabels (cell of strings or empty (optional, default=[])) – the labels to consider, if nonempty

  • sigmas (int array (optional, default=[5, 10, 20, 30, 50])) – the widths for smoothing to be applied on gradients and intensity data

  • steps (int array (optional, default=[1])) –

  • cdf_minmax (length 2 float array (optional, default=[0.01, 0.999])) – intensity cumulative distribution function limits for intensity clipping each image

  • overwrite (bool (otpional, default=false)) – overwrite currently existing TIFF images

Returns

  • <nothing returned>

  • Outputs

  • ——-

NPMitchell 2020

@dynamicAtlas.makeMasterTimeLinePIV(da, genotype, label, Options)#
MAKEMASTERTIMELINEPIV(genotype, label, Options)

Build a master timeline for this genotype based on the dynamic pullbacks contained in genotype/label/ using PIV correlation

Parameters
  • da (dynamicAtlas class instance) –

  • genotype (str) –

  • stain (str) –

  • Options (struct with optional fields) – preview overwrite thres ssfactor

Returns

  • Outputs

  • ——-

  • dynamicAtlas.path/timing/genotype/label/<method>corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/stripe7corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/timeline_ss%02d_<method>corr/

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_dynamic.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_dynamic.txt

  • NPMitchell, Vishank Jain-Sharma 2020

@dynamicAtlas.makeMasterTimeLineRealspace(da, genotype, label, Options)#
MAKEMASTERTIMELINEREALSPACE(genotype, label, Options)

Build a master timeline for this genotype based on the dynamic pullbacks contained in genotype/label/ using realspace correlation (cross correlation between raw intensity of image sequence against each other image sequence)

Parameters
  • da (dynamicAtlas class instance) –

  • genotype (str) –

  • stain (str) –

  • Options (struct with optional fields) – preview overwrite thres ssfactor

Returns

  • Outputs

  • ——-

  • dynamicAtlas.path/timing/genotype/label/<method>corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/stripe7corr_ss%02d/

  • dynamicAtlas.path/timing/genotype/label/timeline_ss%02d_<method>corr/

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_dynamic.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_curve7_dynamic.txt

  • NPMitchell 2020

@dynamicAtlas.timeStampStripe7(da, genotype, label, Options)#
TIMESTAMPSTRIPE7(da, genotype, label, Options)

Find appropriate timestamp for data stained by ‘label’ for all fixed pullbacks compared to master timeline using leading edge of stripe7. This is basically a wrapper for queriedSample’s method timeStamp.m

Parameters
  • da (dynamicAtlas class instance) – the dynamicAtlas for which we find timestamps

  • genotype (str) –

  • stain (str) –

  • Options (struct with optional fields) –

    save_fancy : optional bool, default=true overwrite : optional bool, default=false

    overwrite previous results

    hands_onoptional bool, default=true

    use interactive domain selection for chisquare fitting

    cdf_minoptional float, default=0.01

    intensity cumulative distribution function minimum cutoff

    cdf_maxoptional float, default=0.999

    intensity cumulative distribution function maximum cutoff

    sigmaoptional float, default=20

    smoothing used in the stripe ID in iLastik

    optimize_transoptional bool, default=true

    allow translation of the stripe7 curve in fitting to reference curves

    timelineLabeloptional str, default=<same as label>

    allows the <label> fixed data to be compared to For ex, label=Runt (fixed data is Runt), but masterTimeLineLabel=Eve (live data is Eve).

    timelineLeadingTrailingoptional str, default=’leading’

    whether to use leading edge of timeLine stripe7 data or trailing edge

Returns

  • Outputs

  • ——-

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<label>_<timelineLabel>stripe7_chisq.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<label>_<timelineLabel>stripe7_chisq.txt

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<label>_<timelineLabel>stripe7_ssr.mat

  • dynamicAtlas.path/genotype/label/embryoID/timematch_<label>_<timelineLabel>stripe7_ssr.txt

  • NPMitchell 2020

Indices and tables#