seq = catmask(___,'OverlapAction','prioritizeByList','PriorityList',idxlist)
specifies the order in which msk categories are prioritized when
regions with different category values overlap.
Consider a region-of-interest (ROI) table mask with four regions of interest spanning samples numbered from 2 to 30. Specify the category labels as A and B. Use the mask to create a signalMask object.
Extract a categorical mask from the object. To treat overlap between the categories, assign samples shared by the two categories to the first one in the list, A.
Example: signalMask(table([2 4;6 7],["male" "female"]')) specifies a
signal mask with a three-sample male region and a two-sample
female region.
Example: signalMask(categorical(["" "male" "male" "male" "" "female" "female"
""]',["male" "female"])) specifies a signal mask with a three-sample
male region and a two-sample female
region.
Example: signalMask([0 1 1 1 0 0 0 0;0 0 0 0 0 1 1 0]','Categories',["male"
"female"]) specifies a signal mask with a three-sample
male region and a two-sample female
region.
len — Output sequence length integer scalar
Output sequence length, specified as an integer scalar. Regions beyond
len are ignored. The output categorical sequence
seq is padded with <missing> values in
these cases:
SourceType is 'categoricalSequence' or
'binarySequences' and len is greater
than the length of the source sequence.
SourceType is 'roiTable' and
len is greater than the maximum region index.
When RightExtension is nonzero and SourceType is 'categoricalSequence' or
'binarySequences', catmask extends regions
possibly beyond the sequence length, applies all other modifications based on LeftExtension, LeftShortening, RightShortening, MergeDistance, and MinLength, and then truncates the resulting sequence to the original
sequence length, or to the specified length len.
As a last step, catmask manages overlap based on the value set
for 'OverlapAction', if that argument is specified.
action — Way to deal with overlap 'error' (default) | 'prioritizeByList'
Way to deal with overlap, specified as 'error' or
'prioritizeByList'.
'error' — catmask throws an error if
there are overlaps between regions with different categories.
'prioritizeByList' — catmask uses the
priority list specified in idxlist to deal with overlaps
between regions with different categories. The first category in the list has the
highest priority, and all its samples are kept in cases of overlap. The second
category in the list follows, and its samples are kept in overlap cases not
previously resolved.
If idxlist is not specified, catmask
prioritizes categories in the same order as they appear in the Categories property of msk.
Data Types: char | string
idxlist — Category priorities in cases of overlap mskCategories list (default) | vector of integers
Category priorities in cases of overlap, specified as a vector of integers. The
indices in idxlist correspond to entries in the Categories of msk and are ordered by the priority
with which they should be treated when regions with different category values overlap.
idxlist must contain indices for all the elements in Categories. The first category in the list has the highest priority. This
means that when regions with different categories overlap, all the values of the highest
priority are kept. Then the values with the next highest priority are kept in the
remaining nonoverlapping samples, and so on.
If idxlist is not specified, catmask
prioritizes categories in the same order as they appear in the Categories property of msk.
Categorical sequence mask, returned as a categorical array. Samples in
seq that do not belong to a region of interest and have no label
value are set to missing categorical values, displayed as
<undefined>. For more information, see categorical.
If SourceType is 'categoricalSequence' or
'binarySequences' and len is not
specified, then seqs has the same length as the source mask
sequence.
If SourceType is 'roiTable', then
len must be specified.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.