You can give it a custom name that will be used for saving data
%%%% Output: display_data
%%%% Output: display_data
**Crop a region**
%%%% Output: display_data
You can draw it on the image or select it with the slider (values in pixels).If you do both, only the drawn region will be kept. If you select several regions on the image, they will be divided into several subsets
%%%% Output: display_data
Draw using the rectangle shape, hit ENTER while you're done.If you want more details about the email viewer please visit https://napari.org/
%%%% Output: display_data
%%%% Output: display_data
**Select data based on trajectories duration or frame subset**
printmd("You can select specific sets of trajectories. "
"This tool can be useful to perform fate mapping or retrospective mapping. "
"If you selected several subsets before, this specific set will be applied to all of the subsets."
)
printmd("How many sets of trajectories do you want to select?")
set_num_wid=widgets.BoundedIntText(value=0,min=0,max=10,description='Number of sets:',style={'description_width':'initial'})
display(set_num_wid)
#or by selecting trajectories in a specific region at a specific frame. "
#just by giving a list of ids,
```
%%%% Output: display_data
**Select specific trajectories**
%%%% Output: display_data
You can select specific sets of trajectories. This tool can be useful to perform fate mapping or retrospective mapping. If you selected several subsets before, this specific set will be applied to all of the subsets.
%%%% Output: display_data
How many sets of trajectories do you want to select?
%%%% Output: display_data
%% Cell type:code id: tags:
``` python
printmd("**Don't forget to run this cell!**")# no output cell, make it visible
# select specific trajectories
# track selection widget lists
track_name_wid_list=[]
track_xlim_wid_list=[]
track_ylim_wid_list=[]
track_zlim_wid_list=[]
track_drawer_wid_list=[]
track_frame_subset_wid_list=[]
track_list_wid_list=[]
foriinrange(set_num_wid.value):
printmd("""### Set #{}""".format(i+1))
# subset name
printmd("""You can give it a custom name that will be used for saving data""")
printmd("*Two kinds of parameters can be plotted: instantaneous parameters (measured at each time point), and parameters calculated over a whole track.*")
printmd("*You can plot histograms or boxplots of single parameters or scatter plots of a couple of parameters (e.g. v vs y)*")
printmd(
"How many instantaneous parameters do you want to plot? (enter 0 if you don't want to plot parameters)")
param_hist_num_wid=widgets.BoundedIntText(value=1,min=0,max=20,description='Number of histograms:',
style={'description_width':'initial'})
param_box_num_wid=widgets.BoundedIntText(value=1,min=0,max=20,description='Number of boxplots:',
style={'description_width':'initial'})
param_couple_num_wid=widgets.BoundedIntText(value=1,min=0,max=20,description='Number of scatter plots:',
description='Maximum lag time ({})'.format(info['time_unit']),
style={'description_width':'initial'})
printmd("Perform MSD analysis in 2D (along the xy dimensions) or 3D")
display(dim_wid)
printmd(
"Fitting MSDs can be difficult (at long lag times the calculation is very noisy because of the poor statistics). It is often necessary to restrict the fit to short lag times. ")
*Two kinds of parameters can be plotted: instantaneous parameters (measured at each time point), and parameters calculated over a whole track.*
%%%% Output: display_data
*You can plot histograms or boxplots of single parameters or scatter plots of a couple of parameters (e.g. v vs y)*
%%%% Output: display_data
How many instantaneous parameters do you want to plot? (enter 0 if you don't want to plot parameters)
%%%% Output: display_data
%%%% Output: display_data
How many whole-trajectory parameters do you want to plot? (enter 0 if you don't want to plot parameters)
%%%% Output: display_data
%%%% Output: display_data
**3. Mean Squared Displacement (MSD) analysis**
%%%% Output: display_data
%%%% Output: display_data
You can either plot the MSD, or/and fit it with a random walk model
%%%% Output: display_data
%%%% Output: display_data
***
%%%% Output: display_data
*Plotting section*
%%%% Output: display_data
Plot MSD altogether or as single plots. For a large number of tracks, plotting single MSDs can be long... Consider not plotting them.
%%%% Output: display_data
%%%% Output: display_data
%%%% Output: display_data
%%%% Output: display_data
***
%%%% Output: display_data
*Fitting section*
%%%% Output: display_data
The MSD can be fitted with three different random walk models
%%%% Output: display_data
%%%% Output: display_data
Perform MSD analysis in 2D (along the xy dimensions) or 3D
%%%% Output: display_data
%%%% Output: display_data
Fitting MSDs can be difficult (at long lag times the calculation is very noisy because of the poor statistics). It is often necessary to restrict the fit to short lag times.
%%%% Output: display_data
%%%% Output: display_data
**4. Voronoi analysis**
%%%% Output: display_data
%%%% Output: display_data
%%%% Output: display_data
%%%% Output: display_data
Optional: set custom plotting limits to area color code (in squared unit)
%%%% Output: display_data
%% Cell type:code id: tags:
``` python
printmd("**Don't forget to run this cell!**")# no output cell, make it visible
## Get additional information about parameters plotting
# get MSD parameters
ifnotMSD_module_wid.value:
MSD_fit=False
else:
ifMSD_mode_wid.value=='only plot MSD':
MSD_fit=None
else:
MSD_model_dict={'random walk':'pure_diff','biased random walk':'biased_diff',