Parameters overviewο
This page provides an overview of all parameters used in single-file processing, batch processing and batch collection in MotilA. These parameters control image preprocessing, segmentation, motility quantification and output settings, and allow customization of the pipeline for different imaging datasets and experimental designs.
Input/output parameters for single-file processingο
Input pathsο
Parameter |
Values |
Description |
|---|---|---|
|
string |
Identifier of the mouse or animal |
|
string |
Experimental group of the animal |
|
string |
Full file path to the image stack |
Results output settingsο
Parameter |
Values |
Description |
|---|---|---|
|
string |
Output directory for results; absolute or relative to the current script |
|
bool |
If |
|
|
Table export formats. Defaults to |
Input/output parameters for batch processingο
Parameter |
Values |
Description |
|---|---|---|
|
string or |
Root directory that contains all subject folders |
|
list of strings or |
Explicit subject folders to process. If |
|
string |
Prefix used for automatic subject discovery when |
|
list of tag tuples |
Flexible folder-tag levels below each subject, for example |
|
list of glob patterns or |
File patterns to process. |
|
tuple of strings |
Exclude files or folders whose names contain one of these strings |
|
bool |
If |
|
string |
Name of the folder where MotilA writes per-image processing results |
|
dictionary |
Options forwarded to |
|
dictionary |
Optional preflight-load settings. Set |
|
dictionary |
Optional output validation/report settings, for example |
|
string or |
Optional Excel metadata file in the output-scope folder that can override selected processing options |
|
|
Set inside |
Expected project folder structureο
The v1.2.0 batch process expects a flexible BIDS-like project folder structure:
project_root
βββ ID000001
β βββ TP000
β β βββ image_01.ome.tif
β β βββ image_02.czi
β βββ TP001
β βββ registered
β βββ image_03.raw
βββ ID000002
βββ DC000_FOV01
βββ TL_000
βββ image_01.tif
This hierarchy follows a BIDS-inspired organization by subject ID and project-specific subfolders. It is not fully BIDS-compliant, but it supports automated batch processing and robust association of metadata.
tag_folder_levels tells MotilA how to walk the folder tree below each
subject. For example, [("DC000_FOV", "DA000_FOV"), ("TL_000",)] first
matches DC000_FOV* or DA000_FOV* folders and then searches for
TL_000* folders below them. Empty levels, None, () and [] are
ignored.
The batch processor writes persistent reports in project_root:
motila_batch_run_report.txtrecords the discovered files, current status, output folders and run history.motila_batch_run_report.yamlstores the same history in a machine-readable format so later runs can append to it.motila_batch_error_report_<timestamp>.txtis written only when failures occur. Per-file error reports are also written next to affected image files.
Metadata override file (metadata.xls)ο
If an Excel metadata file (for example metadata.xls) is present in
each project_tag folder, selected parameters from the execution script
or notebook are overridden on a per-dataset basis.
The following parameters can be set via metadata:
two_channel_defaultMG_channel_defaultN_channel_defaultspectral_unmixingprojection_center_default
This allows for individual settings for each dataset.
Example table structure for metadata.xls:
Two Channel |
Registration Channel |
Registration Co-Channel |
Microglia Channel |
Neuron Channel |
Spectral Unmixing |
Projection Center 1 |
|---|---|---|---|---|---|---|
True |
1 |
0 |
0 |
1 |
False |
28 |
Columns Registration Channel and Registration Co-Channel are currently not used by MotilA and can be ignored.
Additional projection centers (for example Projection Center 2) can be added as extra columns. MotilA will then generate projections and motility analyses for each defined center.
A template for this excel file is provided in the templates folder of the
repository.
General processing settingsο
Projection settingsο
Parameter |
Values |
Description |
|---|---|---|
|
integer |
Number of z-layers included in the projection subvolume |
|
integer |
Central z-slice around which the projection subvolume is defined |
In case of image volumes densely packed with microglia, we recommend to subdivide the volume into several subvolumes with different projection centers. This will help to avoid overlapping microglia in the projection and thus ensure a more accurate capturing of the microglial processesβ motility.
Avoid including blood vessels in the projection center. Blood vessels can lead to false-positive motility results, as the pipeline cannot distinguish between microglial processes and blood vessels.
MotilA performs a sanity check of the desired subvolume defined by the
input parameters projection_center_default and projection_layers_default.
If the subvolume exceeds the image dimensions, the pipeline will automatically
adjust the subvolume to fit within the image dimensions. However, this may
lead to a smaller subvolume than initially defined. To avoid this, ensure
that the subvolume fits within the image dimensions. The final chosen parameters will be saved in a log Excel file into the results folder.
Thresholding settingsο
Parameter |
Values |
Description |
|---|---|---|
|
string |
Thresholding method; one of |
|
integer |
Minimum area (in pixels) for segmented objects; a value of 100 is a reasonable starting point |
|
bool |
If |
Image enhancement settingsο
Parameter |
Values |
Description |
|---|---|---|
|
bool |
Apply contrast-limited adaptive histogram equalization (CLAHE) within each 3D stack |
|
float |
Clip limit for CLAHE (for example 0.05); higher values increase contrast but may amplify noise |
|
None or tuple |
Kernel size for CLAHE; |
|
bool |
Match histograms across stacks to compensate for bleaching and intensity drift |
|
integer |
Index of the reference stack used for histogram matching |
Histogram equalization enhances the contrast of the image by stretching the
intensity range. This can be particularly useful for images with low contrast
or uneven illumination. The hist_equalization_clip_limit parameter controls
the intensity clipping limit for the histogram equalization. A higher value
increases the intensity range but may also amplify noise.
The hist_equalization_kernel_size parameter defines the kernel size for the
histogram equalization. The default is None which lets the function choose
the kernel size automatically. In cases of occurring block artifacts, you can set
a fixed kernel size (e.g., (8,8), (16,16), (24,24), β¦).
Histogram matching aligns the intensity distributions of different
image stacks, ensuring consistent brightness and contrast across time
points. The histogram_ref_stack parameter defines the reference stack for
histogram matching. This reference stack serves as the basis for matching the
intensity distributions of all other stacks. Both, the output plot Normalized
average brightness drop rel. to t0.pdf and Excel file Normalized average
brightness of each stack.xlsx show the average brightness of each stack relative
to the reference stack. This can help to assess the quality of each time point
stack and which time points might be excluded from further analysis.
Filter settingsο
Parameter |
Values |
Description |
|---|---|---|
|
string or bool |
Median filter on individual z-slices before projection; |
|
int or float |
Kernel size for slice-wise filtering; integers for square kernels, floating point radii for circular kernels |
|
string or bool |
Median filter on projected images; |
|
int or float |
Kernel size for filtering of projections |
|
int |
Standard deviation of the Gaussian blur applied to projections; 0 disables Gaussian filtering |
Regarding median filtering, you have the option to filter on the single slices
BEFORE the projection (median_filter_slices) and/or on the projected images
(median_filter_projections). For both options, you can choose from:
False(no filtering)square(square kernel): integer numbers (3, 5, 9)circular(disk-shaped kernel; analogous to the median filter in ImageJ/Fiji): only values >= 0.5 allowed/have an effect
When you apply median filtering, you need to additionally provide the kernel size
(median_filter_window_slices for single slices and median_filter_window_projections
for projections). Depending on the chosen filtering kernel method, you can choose
a kernel size as listed above.
Gaussian smoothing further enhances the contrast and reduces noise. Set
gaussian_sigma_projto 0: no smoothing, orgaussian_sigma_projto a value > 0: the standard deviation of the Gaussian kernel.
Channel settingsο
Parameter |
Values |
Description |
|---|---|---|
|
bool |
Indicates whether the input stack contains two channels |
|
integer |
Channel index that contains the microglia signal |
|
integer |
Channel index that contains the second signal (for example neurons or THG) |
If your stack contains only one channel, set two_channel_default = False;
any value set in N_channel_default will be ignored.
If metadata.xls is present in project_tag folder, the above defined values
(two_channel_default, MG_channel_default, N_channel_default) are
ignored and values from the metadata.xls are used instead (in batch processing only!)
Registration settingsο
Parameter |
Values |
Description |
|---|---|---|
|
bool |
Register slices within each 3D stack across time |
|
bool |
Register 2D projections across time |
|
bool |
If |
|
string |
Template mode for 3D registration; one of |
|
integer |
Maximum allowed shift in x and y direction during registration |
MotilA provides the option to register the image stacks. Two registration options are available:
regStack3d: register slices WITHIN each 3D time-stack; True or FalseregStack2d: register projections on each other; True or False
With template_mode you can define the template mode for the registration.
Choose between mean (default), median, max, min, std, and var.
With max_xy_shift_correction, you can define the maximum allowed shift in x and y
(and z) direction for the registration. This is useful to avoid overcorrection.
Spectral unmixing settingsο
Parameter |
Values |
Description |
|---|---|---|
|
bool |
Enable simple spectral unmixing by subtracting the non-microglia channel from the microglia channel |
|
integer |
Amplification factor for the microglia channel before subtraction; 1 disables amplification |
|
integer |
Median filter kernel for the second channel before subtraction; typical values are 1 (off), 3, 5, 7 |
MotilA provides the option to perform spectral unmixing on two-channel data.
At the moment, only a simple method is implemented, which subtracts the N-channel
from the MG-channel. Set spectral_unmixing to True to enable this feature.
With spectral_unmixing_amplifyer you can define the amplification
factor for the MG-channel before subtraction. This can be useful to preserve
more information in the MG-channel.
spectral_unmixing_median_filter_window defines the kernel size for
median filtering of N-channel before subtraction. This can be useful to
reduce noise in the N-channel and, thus, achieve a better unmixing result.
Allowed are odd integer numbers (3, 5, 9, β¦).
Debug settingsο
Parameter |
Values |
Description |
|---|---|---|
|
bool |
Enable additional debug output (for example memory usage and processing stages) |
|
bool |
Generate additional statistics plots for the motility analysis (for example histograms of binarized pixels) |
Input/output parameters for batch collectionο
Parameter |
Values |
Description |
|---|---|---|
|
string or |
Root directory that contains all subject folders |
|
string |
Path to the folder where aggregated batch-collection results are saved |
|
list of strings or |
Explicit subject folders to collect. If |
|
string |
Prefix used for automatic subject discovery when |
|
list of tag tuples |
Same folder-tag levels used for |
|
list of glob patterns or |
Same image filters used for |
|
tuple of strings |
Exclude files or folders whose names contain one of these strings |
|
string |
Name of the MotilA results folder to collect from |
|
bool |
Must match the setting used during |
|
|
Export formats for aggregated result tables. Defaults to |
The batch collection function now uses the same discovery settings as
batch_process_stacks. It derives MotilA output folders from the discovered
input files and aggregates per-dataset results into cohort-level Excel files.
If table_export_formats includes "csv" or "yaml", matching
plain-text sidecar files are written with the same base names.