@@ -43,6 +43,24 @@ class AddLocalShapeDescriptor(BatchFilter):
43
43
to compute a weighed average of statistics inside an object.
44
44
``sphere`` accumulates values in a sphere.
45
45
46
+ components (string, optional): The components of the local shape descriptors to
47
+ compute and return. Should be a string of integers chosen from 0 through 9 (if 3D)
48
+ or 6 (if 2D), in order. Example: "0129" or "345". Defaults to all components.
49
+
50
+ Component string lookup, where example component : "3D axes", "2D axes"
51
+
52
+ mean offset (mean) : "012", "01"
53
+ orthogonal covariance (ortho) : "345", "23"
54
+ diagonal covariance (diag) : "678", "4"
55
+ size : "9", "5"
56
+
57
+ Example combinations:
58
+
59
+ diag + size : "6789", "45"
60
+ mean + diag + size : "0126789", "0145"
61
+ mean + ortho + diag : "012345678", "01234"
62
+ ortho + diag : "345678", "234"
63
+
46
64
downsample (int, optional): Downsample the segmentation mask to extract
47
65
the statistics with the given factore. Default is 1 (no
48
66
downsampling).
@@ -57,6 +75,7 @@ def __init__(
57
75
unlabelled = None ,
58
76
sigma = 5.0 ,
59
77
mode = "gaussian" ,
78
+ components = None ,
60
79
downsample = 1 ,
61
80
):
62
81
@@ -65,6 +84,7 @@ def __init__(
65
84
self .lsds_mask = lsds_mask
66
85
self .labels_mask = labels_mask
67
86
self .unlabelled = unlabelled
87
+ self .components = components
68
88
69
89
try :
70
90
self .sigma = tuple (sigma )
@@ -149,6 +169,7 @@ def process(self, batch, request):
149
169
150
170
descriptor = self .extractor .get_descriptors (
151
171
segmentation = segmentation_array .data ,
172
+ components = self .components ,
152
173
voxel_size = self .voxel_size ,
153
174
roi = voxel_roi_in_seg ,
154
175
)
0 commit comments