Custom method for importing segmentation data for a slice object.
This is a flexible method for importing channels aside from cfos
and eyfp
that use the same ImageJ segmentation macros provided
in the SMARTTR pipeline. This method works best when following
saving segmentation data with the same naming conventions using the
3D Roi Manager within the
3D ImageJ Suite.
Segmentation data is saved in two'.txt' files which output the results of the Measure 3D and Quantif 3D options of the 3D Roi Manager plugin,respectively.
A description of what each of those these options measure
is provided in the online documentation.
The naming conventions for the ".txt" file storing the Quantif3D results are Q_*_{channel}_*_{channel}.txt
,
where the *
indicates a wildcard character(s) and {channel}
is the channel name without brackets.
E.g. "Q_G_eYFP_258_1_1_eYFP.txt"
The naming conventions for the ".txt" file storing the Measure 3D are M_*_{channel}_*.txt
where
the *
indicates a wildcard character(s) and {channel}
is the channel name without brackets.
E.g "M_G_eYFP_258_1_1.txt".
The wildcards characters may be used to store things like date or slice naming information.
The locations of these files must be specified in the slice_directory
attribute of the slice_object.
Otherwise, the root folder containing the registration image is searched.
This attribute can be stored when initializing the slice object or can be edited afterwards.
Method for custom importation of segmentation data for a mouse object
Usage
import_segmentation_custom(x, ...)
# S3 method for slice
import_segmentation_custom(
x,
channel,
x_col = NULL,
y_col = NULL,
meas_path = NULL,
quant_path = NULL,
...
)
# S3 method for mouse
import_segmentation_custom(
x,
channel,
slice_ID = NA,
hemisphere = NULL,
x_col = NULL,
y_col = NULL,
meas_path = NULL,
quant_path = NULL,
...
)
Arguments
- x
a mouse or slice object
- ...
further arguments passed to or from other methods.
- channel
(str) channel to import.
- x_col
(int, optional) The column index of the x pixel location in the txt file result from Measure 3D.
- y_col
(int, optional) The column index of the y pixel location in the txt file result from Measure 3D.
- meas_path
(chr, optional, default = NULL). Relative path to file from current directory or absolute path. If NULL, will automatically search for the custom files in the slice directory based on the slice_ID and channel parameters.
- quant_path
(chr, optional, default = NULL).Relative path to file from current directory or absolute path. If NULL, will automatically search for the custom files in the slice directory based on the slice_ID and channel parameters.
- slice_ID
(str) ID of slice
- hemisphere
(str)'left', 'right' or NULL
Examples
if (FALSE) {
s <- import_segmentation_custom(s, mouse_ID = "255", channel = "cfos")
}
if (FALSE) {
m <- import_segmentation(m, slice_ID = "1_10", channels = c("PV"), replace = FALSE)
}