queriedSample#
Example Usage#
Full Contents:#
- class @queriedSample.queriedSample(sampleStruct)#
Bases:
sphinxcontrib.mat_types.handle- QUERIEDSAMPLE Object for manipulating subset of atlas
Class for manipulating a queried subset of the dynamicAtlas Holds a subset of embryos in the atlas and offers methods for interrogating the properties of those embryos, such as loading the data, smoothed data, gradients, flow fields.
Note that a queriedSample can slice across embryos, labels, genotypes, or timestamps. There are few restrictions about what kinds of embryos can be contained in the queried sample. For example, da.findTime() will return a queriedSample of all embryos of any genotype in the da (dynamicAtlas instance) that match a timestamp range.
- 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()
Example
a = dynamicAtlas(‘./’, {‘WT’}) qs = a.findLabel(‘Eve’) qs.getData() qs.getGradients(‘dx’, 10) qs.getSmooth()
NPMitchell 2020
- buildPIVStack(da, genotype, labels, deltaTime)#
Build a stack of PIV flow fields over time
- data = None#
embryoIDs, times, uncs, tiffpages, nTimePoints
- dynamicAtlas = None#
dynamicAtlas object from which qs is made
- ensurePIV(options)#
Make sure each embryo in the queriedSample has PIV and PIV_filtered measurements: one .mat per timepoint
- getData()#
GETDATA(obj) Load the TIFFs for all data in this queriedSample
- Returns
dataCell – The requested raw data images
- Return type
N x 1 cell of 2d uint16 arrays
- getGradients(xymag, sigma, step)#
- GETGRADIENTS(obj)
Load the gradient TIFFs for all data in this queriedSample
- Parameters
xymag (
optional str ('x', 'y', 'mag'), default='mag') – whether to grab AP gradient (x), DV gradient (y), or normed magnitude of gradientsigma (
optional int, default=10) – length scale over which data is smoothed before gradient computedstep (
optional int, default=1) – length scale over which gradient is computed
- Returns
dataCell – The requested gradient images
- Return type
N x 1 cell of 2d uint16 arrays
- getMaxTime()#
Measure the largest timestamp value in the queried sample
- getMeanData(normalizeEach, preview)#
Load all data and take the mean of all data in the sampling
- Parameters
obj (
queriedSample instance (self)) –normalizeEach (
bool (default = true)) – normalize the intensity of each frame as we sum them (recommended)preview (
bool (default = false)) – preview the averaging of all members of the queriedSample, element by element as we sum them
- Returns
meanIm – mean image intensity for all samples in queriedSample instance
- Return type
2D double array
- getMeanPIV(options)#
meanPIV = getMeanPIV(obj, options) Load PIV results for all entries in queriedSample collection
- Parameters
options (
struct with fields) – method : ‘default’ or ‘pivlab’- Returns
mean flow across all samples in the queriedSample
- Return type
meanPIV
- getMinTime()#
Measure the samllest timestamp value in the queried sample
- getPIV(options)#
piv = getPIV(obj, options)
- Parameters
options (
optional struct with optional fields) –- methodstring specifier (‘default’ or ‘pivlab’)
how the piv was computed.
- Returns
piv – vx vy
- Return type
struct with fields
- getSmooth(sigma, step)#
- GETGRADIENTS(obj)
Load the smoothed TIFFs for all data in this queriedSample
- Parameters
sigma (
optional int, default=10) – length scale over which data is smoothed before gradient computedstep (
optional int, default=1) – length scale over which gradient is computed
- Returns
dataCell – The requested gradient images
- Return type
N x 1 cell of 2d uint16 arrays
- gradients = 'struct()'#
struct with fields dx, dy, mag
- meanPIV = "struct('vx', [], \n'vy', [])"#
cell array of average velocity field across sample
- meta = None#
struct with fields labels, folders, names, …
- piv = "struct('vx', [], \n'vy', [], \n'rescaleFactor', 0.4)"#
cell array of velocity fields
- queriedSample(sampleStruct)#
sampleStruct: struct with fields labels, folders, names, … embryoIDs, times, uncs, tiffpages, nTimePoints
- smooth = None#
cell array of images
- @queriedSample.timeStamp(qs, label, options)#
Assign a timestamp to each member of the queriedSample qs.
This method applies only to queriedSamples of identical genotype, which is doubly enforced by passing the argument ‘genotype’.
- Parameters
da (
dynamicAtlas instance) – The collection of data for which timing of each embryo in genotype/label/ is applied.genotype (
char) – The genotype of the timing label (for ex, “WT” to timestamp embryos in WT/<label>/)label (
char) – The label used for timestamping (for ex, “Runt” to timestamp embryos in <genotype>/Runt/Options (
struct with fields) –- method’stripe7’ or <new method string specifier>
how to timestamp the embryo
- save_fancybool
save a png image of the stripe extraction overlaid against data
- hands_onbool
if true, use gui-based timing
- cdf_min0-1 float
minimim in cumulative distribution function at which we threshold the image to extract a stripe/feature
- cdf_max0-1 float
maximum in cumulative distribution function at which we threshold the image to extract a stripe/feature
- optimize_transbool
allow translations (but not rotations) of the stripe in optimization
timelineLabel : optional char, default=Runt timelineLeadingTrailing : ‘leading’ or ‘trailing’, default=leading sigmastep : optional char refDir : optional char
- Returns
Saves to disk
————-
NPMitchell 2020-2022