ritk-python 0.12.79__cp39-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ritk/_ritk/filter.pyi ADDED
@@ -0,0 +1,1207 @@
1
+ """Type stubs for the ``_ritk.filter`` submodule (compiled by PyO3/maturin)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from ritk._ritk.image import ColorImage, Image
6
+
7
+ def gaussian_filter(image: Image, sigma: float) -> Image: ...
8
+ def discrete_gaussian(
9
+ image: Image,
10
+ variance: float,
11
+ maximum_error: float = 0.01,
12
+ use_image_spacing: bool = True,
13
+ ) -> Image: ...
14
+ def median_filter(image: Image, radius: int = 1) -> Image: ...
15
+ def discrete_gaussian_derivative(
16
+ image: Image,
17
+ order_x: int,
18
+ order_y: int,
19
+ order_z: int,
20
+ variance: float,
21
+ maximum_error: float = 0.01,
22
+ use_image_spacing: bool = False,
23
+ ) -> Image:
24
+ """Discrete Gaussian derivative (per-axis order, sitk x/y/z). ITK Parity: DiscreteGaussianDerivativeImageFilter."""
25
+ ...
26
+
27
+ def normalize_image(image: Image) -> Image: ...
28
+ def normalize_to_constant(image: Image, constant: float = 1.0) -> Image:
29
+ """Scale so the sum of voxels equals `constant`. ITK Parity: NormalizeToConstantImageFilter."""
30
+ ...
31
+
32
+ def derivative(
33
+ image: Image, direction: int = 0, order: int = 1, use_image_spacing: bool = True
34
+ ) -> Image:
35
+ """Directional central-difference derivative (direction sitk x/y/z; order 1 or 2). ITK Parity: DerivativeImageFilter."""
36
+ ...
37
+
38
+ def bilateral_filter(
39
+ image: Image, spatial_sigma: float, range_sigma: float
40
+ ) -> Image: ...
41
+ def n4_bias_correction(
42
+ image: Image,
43
+ num_fitting_levels: int = 4,
44
+ num_iterations: int = 50,
45
+ noise_estimate: float = 0.01,
46
+ shrink_factor: int = 4,
47
+ ) -> Image: ...
48
+ def anisotropic_diffusion(
49
+ image: Image,
50
+ iterations: int = 20,
51
+ conductance: float = 3.0,
52
+ time_step: float = 0.0625,
53
+ exponential: bool = True,
54
+ ) -> Image: ...
55
+ def gradient_magnitude(image: Image) -> Image: ...
56
+ def laplacian(image: Image) -> Image: ...
57
+ def frangi_vesselness(
58
+ image: Image,
59
+ scales: list[float] | None = None,
60
+ alpha: float = 0.5,
61
+ beta: float = 0.5,
62
+ gamma: float = 15.0,
63
+ bright_vessels: bool = True,
64
+ ) -> Image: ...
65
+ def canny_edge_detect(
66
+ image: Image,
67
+ sigma: float = 1.0,
68
+ low_threshold: float = 0.1,
69
+ high_threshold: float = 0.2,
70
+ ) -> Image: ...
71
+ def canny_edge_detection(
72
+ image: Image,
73
+ lower_threshold: float = 0.0,
74
+ upper_threshold: float = 0.0,
75
+ variance: float = 0.0,
76
+ maximum_error: float = 0.01,
77
+ ) -> Image: ...
78
+ def laplacian_of_gaussian(image: Image, sigma: float = 1.0) -> Image: ...
79
+ def recursive_gaussian(image: Image, sigma: float = 1.0, order: int = 0) -> Image: ...
80
+ def recursive_gaussian_directional(
81
+ image: Image, sigma: float = 1.0, order: int = 0, direction: int = 2
82
+ ) -> Image: ...
83
+ def sobel_gradient(image: Image) -> Image: ...
84
+ def unsharp_mask(
85
+ image: Image,
86
+ sigma: float = 1.0,
87
+ amount: float = 0.5,
88
+ threshold: float = 0.0,
89
+ clamp: bool = False,
90
+ ) -> Image: ...
91
+ def grayscale_erosion(image: Image, radius: int = 1) -> Image: ...
92
+ def grayscale_dilation(image: Image, radius: int = 1) -> Image: ...
93
+ def curvature_anisotropic_diffusion(
94
+ image: Image,
95
+ iterations: int = 20,
96
+ time_step: float = 0.0625,
97
+ ) -> Image: ...
98
+ def curvature_flow(
99
+ image: Image, time_step: float = 0.0625, iterations: int = 5
100
+ ) -> Image:
101
+ """Pure mean-curvature flow (dI/dt = kappa). ITK Parity: CurvatureFlowImageFilter."""
102
+ ...
103
+
104
+ def min_max_curvature_flow(
105
+ image: Image, time_step: float = 0.05, iterations: int = 5, stencil_radius: int = 2
106
+ ) -> Image:
107
+ """Min/max curvature flow (curvature flow gated by a stencil min/max threshold). ITK Parity: MinMaxCurvatureFlowImageFilter (sitk.MinMaxCurvatureFlow)."""
108
+ ...
109
+
110
+ def binary_min_max_curvature_flow(
111
+ image: Image,
112
+ time_step: float = 0.05,
113
+ iterations: int = 5,
114
+ stencil_radius: int = 2,
115
+ threshold: float = 0.0,
116
+ ) -> Image:
117
+ """Binary min/max curvature flow (curvature flow gated by sphere-average vs scalar threshold). ITK Parity: BinaryMinMaxCurvatureFlowImageFilter (sitk.BinaryMinMaxCurvatureFlow)."""
118
+ ...
119
+
120
+ def sato_line_filter(
121
+ image: Image,
122
+ scales: list[float] | None = None,
123
+ alpha: float = 0.5,
124
+ bright_tubes: bool = True,
125
+ ) -> Image: ...
126
+ def rescale_intensity(
127
+ image: Image,
128
+ out_min: float = 0.0,
129
+ out_max: float = 1.0,
130
+ ) -> Image: ...
131
+ def shift_scale(image: Image, shift: float = ..., scale: float = ...) -> Image: ...
132
+ def adaptive_histogram_equalization(
133
+ image: Image,
134
+ radius: tuple[int, int, int] = (5, 5, 5),
135
+ alpha: float = 0.3,
136
+ beta: float = 0.3,
137
+ ) -> Image:
138
+ """Adaptive histogram equalization (Stark alpha/beta). ITK Parity: AdaptiveHistogramEqualizationImageFilter."""
139
+ ...
140
+
141
+ def intensity_windowing(
142
+ image: Image,
143
+ window_min: float,
144
+ window_max: float,
145
+ out_min: float = 0.0,
146
+ out_max: float = 1.0,
147
+ ) -> Image: ...
148
+ def threshold_below(
149
+ image: Image,
150
+ threshold: float,
151
+ outside_value: float = 0.0,
152
+ ) -> Image: ...
153
+ def threshold_above(
154
+ image: Image,
155
+ threshold: float,
156
+ outside_value: float = 0.0,
157
+ ) -> Image: ...
158
+ def threshold_outside(
159
+ image: Image,
160
+ lower: float,
161
+ upper: float,
162
+ outside_value: float = 0.0,
163
+ ) -> Image: ...
164
+ def sigmoid_filter(
165
+ image: Image,
166
+ alpha: float,
167
+ beta: float,
168
+ min_output: float = 0.0,
169
+ max_output: float = 1.0,
170
+ ) -> Image: ...
171
+ def binary_threshold(
172
+ image: Image,
173
+ lower_threshold: float,
174
+ upper_threshold: float,
175
+ foreground: float = 1.0,
176
+ background: float = 0.0,
177
+ ) -> Image: ...
178
+ def double_threshold(
179
+ image: Image,
180
+ threshold1: float = 0.0,
181
+ threshold2: float = 1.0,
182
+ threshold3: float = 254.0,
183
+ threshold4: float = 255.0,
184
+ inside_value: float = 1.0,
185
+ outside_value: float = 0.0,
186
+ ) -> Image:
187
+ """Hysteresis double-threshold (inner band reconstructed under outer band). ITK Parity: DoubleThresholdImageFilter."""
188
+ ...
189
+
190
+ def zero_crossing_image(
191
+ image: Image,
192
+ foreground_value: float = 1.0,
193
+ background_value: float = 0.0,
194
+ ) -> Image: ...
195
+ def blend_images(a: Image, b: Image, alpha: float = 0.5) -> Image:
196
+ """Linearly blend two co-registered images.
197
+
198
+ out(x) = (1 - alpha) * a(x) + alpha * b(x)
199
+
200
+ alpha=0 returns a; alpha=1 returns b. Both images must have identical shapes.
201
+ Spatial metadata is preserved from a. ITK Parity: BlendImageFilter.
202
+ """
203
+ ...
204
+
205
+ def add_images(a: Image, b: Image) -> Image:
206
+ """Pixelwise addition: out(x) = a(x) + b(x). ITK Parity: AddImageFilter."""
207
+ ...
208
+
209
+ def subtract_images(a: Image, b: Image) -> Image:
210
+ """Pixelwise subtraction: out(x) = a(x) - b(x). ITK Parity: SubtractImageFilter."""
211
+ ...
212
+
213
+ def multiply_images(a: Image, b: Image) -> Image:
214
+ """Pixelwise multiplication: out(x) = a(x) * b(x). ITK Parity: MultiplyImageFilter."""
215
+ ...
216
+
217
+ def divide_images(a: Image, b: Image) -> Image:
218
+ """Pixelwise division: out(x) = a(x) / b(x); division by zero yields 0. ITK Parity: DivideImageFilter."""
219
+ ...
220
+
221
+ def minimum_images(a: Image, b: Image) -> Image:
222
+ """Pixelwise minimum: out(x) = min(a(x), b(x)). ITK Parity: MinimumImageFilter."""
223
+ ...
224
+
225
+ def abs_image(image: Image) -> Image:
226
+ """Pixelwise absolute value: out(x) = |in(x)|. ITK Parity: AbsImageFilter."""
227
+ ...
228
+
229
+ def sqrt_image(image: Image) -> Image:
230
+ """Pixelwise square root: out(x) = sqrt(in(x)). ITK Parity: SqrtImageFilter."""
231
+ ...
232
+
233
+ def square_image(image: Image) -> Image:
234
+ """Pixelwise square: out(x) = in(x)^2. ITK Parity: SquareImageFilter."""
235
+ ...
236
+
237
+ def exp_image(image: Image) -> Image:
238
+ """Pixelwise exponential: out(x) = exp(in(x)). ITK Parity: ExpImageFilter."""
239
+ ...
240
+
241
+ def log_image(image: Image) -> Image:
242
+ """Pixelwise natural log: out(x) = ln(in(x)). ITK Parity: LogImageFilter."""
243
+ ...
244
+
245
+ def log10_image(image: Image) -> Image:
246
+ """Pixelwise base-10 log: out(x) = log10(in(x)). ITK Parity: Log10ImageFilter."""
247
+ ...
248
+
249
+ def unary_minus_image(image: Image) -> Image:
250
+ """Pixelwise negation: out(x) = -in(x). ITK Parity: UnaryMinusImageFilter."""
251
+ ...
252
+
253
+ def round_image(image: Image) -> Image:
254
+ """Pixelwise round to nearest integer (half-up). ITK Parity: RoundImageFilter."""
255
+ ...
256
+
257
+ def not_image(image: Image) -> Image:
258
+ """Pixelwise logical NOT of a mask (1 where in==0, else 0). ITK Parity: NotImageFilter."""
259
+ ...
260
+
261
+ def binary_not(image: Image, foreground: float = 1.0, background: float = 0.0) -> Image:
262
+ """Binary logical NOT: background where in==foreground, else foreground. ITK Parity: BinaryNotImageFilter."""
263
+ ...
264
+
265
+ def modulus(image: Image, dividend: int) -> Image:
266
+ """Pixelwise in % dividend (integer images, C truncated remainder). ITK Parity: ModulusImageFilter."""
267
+ ...
268
+
269
+ def binary_magnitude_images(a: Image, b: Image) -> Image:
270
+ """Pixelwise magnitude: out(x) = sqrt(a(x)^2 + b(x)^2). ITK Parity: BinaryMagnitudeImageFilter."""
271
+ ...
272
+
273
+ def equal_images(a: Image, b: Image) -> Image:
274
+ """Pixelwise equality mask (1 where a==b). ITK Parity: EqualImageFilter."""
275
+ ...
276
+
277
+ def not_equal_images(a: Image, b: Image) -> Image:
278
+ """Pixelwise inequality mask (1 where a!=b). ITK Parity: NotEqualImageFilter."""
279
+ ...
280
+
281
+ def greater_images(a: Image, b: Image) -> Image:
282
+ """Pixelwise greater-than mask (1 where a>b). ITK Parity: GreaterImageFilter."""
283
+ ...
284
+
285
+ def greater_equal_images(a: Image, b: Image) -> Image:
286
+ """Pixelwise greater-or-equal mask (1 where a>=b). ITK Parity: GreaterEqualImageFilter."""
287
+ ...
288
+
289
+ def less_images(a: Image, b: Image) -> Image:
290
+ """Pixelwise less-than mask (1 where a<b). ITK Parity: LessImageFilter."""
291
+ ...
292
+
293
+ def less_equal_images(a: Image, b: Image) -> Image:
294
+ """Pixelwise less-or-equal mask (1 where a<=b). ITK Parity: LessEqualImageFilter."""
295
+ ...
296
+
297
+ def and_images(a: Image, b: Image) -> Image:
298
+ """Pixelwise logical AND of binary masks (1 where a>0 and b>0). ITK Parity: AndImageFilter."""
299
+ ...
300
+
301
+ def or_images(a: Image, b: Image) -> Image:
302
+ """Pixelwise logical OR of binary masks (1 where a>0 or b>0). ITK Parity: OrImageFilter."""
303
+ ...
304
+
305
+ def xor_images(a: Image, b: Image) -> Image:
306
+ """Pixelwise logical XOR of binary masks (1 where exactly one of a,b > 0). ITK Parity: XorImageFilter."""
307
+ ...
308
+
309
+ def divide_real_images(a: Image, b: Image) -> Image:
310
+ """Pixelwise real division a/b (FLT_MAX where b==0). ITK Parity: DivideRealImageFilter."""
311
+ ...
312
+
313
+ def nary_add(images: list[Image]) -> Image:
314
+ """Pixelwise sum of any number of images. ITK Parity: NaryAddImageFilter."""
315
+ ...
316
+
317
+ def nary_maximum(images: list[Image]) -> Image:
318
+ """Pixelwise maximum of any number of images. ITK Parity: NaryMaximumImageFilter."""
319
+ ...
320
+
321
+ def divide_floor_images(a: Image, b: Image) -> Image:
322
+ """Pixelwise floored division floor(a/b) (FLT_MAX where b==0). ITK Parity: DivideFloorImageFilter."""
323
+ ...
324
+
325
+ def ternary_add_images(a: Image, b: Image, c: Image) -> Image:
326
+ """Pixelwise sum of three images: a+b+c. ITK Parity: TernaryAddImageFilter."""
327
+ ...
328
+
329
+ def ternary_magnitude_images(a: Image, b: Image, c: Image) -> Image:
330
+ """Pixelwise magnitude: sqrt(a^2+b^2+c^2). ITK Parity: TernaryMagnitudeImageFilter."""
331
+ ...
332
+
333
+ def ternary_magnitude_squared_images(a: Image, b: Image, c: Image) -> Image:
334
+ """Pixelwise squared magnitude: a^2+b^2+c^2. ITK Parity: TernaryMagnitudeSquaredImageFilter."""
335
+ ...
336
+
337
+ def exp_negative_image(image: Image) -> Image:
338
+ """Pixelwise negative exponential: out(x) = exp(-in(x)). ITK Parity: ExpNegativeImageFilter."""
339
+ ...
340
+
341
+ def sin_image(image: Image) -> Image:
342
+ """Pixelwise sine: out(x) = sin(in(x)). ITK Parity: SinImageFilter."""
343
+ ...
344
+
345
+ def cos_image(image: Image) -> Image:
346
+ """Pixelwise cosine: out(x) = cos(in(x)). ITK Parity: CosImageFilter."""
347
+ ...
348
+
349
+ def tan_image(image: Image) -> Image:
350
+ """Pixelwise tangent: out(x) = tan(in(x)). ITK Parity: TanImageFilter."""
351
+ ...
352
+
353
+ def asin_image(image: Image) -> Image:
354
+ """Pixelwise arcsine: out(x) = asin(in(x)). ITK Parity: AsinImageFilter."""
355
+ ...
356
+
357
+ def acos_image(image: Image) -> Image:
358
+ """Pixelwise arccosine: out(x) = acos(in(x)). ITK Parity: AcosImageFilter."""
359
+ ...
360
+
361
+ def atan_image(image: Image) -> Image:
362
+ """Pixelwise arctangent: out(x) = atan(in(x)). ITK Parity: AtanImageFilter."""
363
+ ...
364
+
365
+ def bounded_reciprocal_image(image: Image) -> Image:
366
+ """Pixelwise bounded reciprocal: out(x) = 1 / (1 + in(x)). ITK Parity: BoundedReciprocalImageFilter."""
367
+ ...
368
+
369
+ def mean_filter(image: Image, radius: int = 1) -> Image:
370
+ """Mean (box) filter: average over a (2r+1)^3 cube. ITK Parity: MeanImageFilter."""
371
+ ...
372
+
373
+ def binomial_blur(image: Image, repetitions: int = 1) -> Image:
374
+ """Separable [1/4,1/2,1/4] blur applied `repetitions` times (reflect boundary). ITK Parity: BinomialBlurImageFilter."""
375
+ ...
376
+
377
+ def spatial_convolve(image: Image, kernel: Image) -> Image:
378
+ """Convolve a 3-D image with a kernel using zero-flux Neumann boundary conditions. ITK Parity: ConvolutionImageFilter."""
379
+ ...
380
+
381
+ def box_mean(
382
+ image: Image, radius_z: int = 1, radius_y: int = 1, radius_x: int = 1
383
+ ) -> Image:
384
+ """Box mean over a clipped (2r+1) window (shrink boundary). ITK Parity: BoxMeanImageFilter."""
385
+ ...
386
+
387
+ def box_sigma(
388
+ image: Image, radius_z: int = 1, radius_y: int = 1, radius_x: int = 1
389
+ ) -> Image:
390
+ """Box sample std-dev over a clipped (2r+1) window (divisor n-1). ITK Parity: BoxSigmaImageFilter."""
391
+ ...
392
+
393
+ def rank(
394
+ image: Image,
395
+ rank: float = 0.5,
396
+ radius_z: int = 1,
397
+ radius_y: int = 1,
398
+ radius_x: int = 1,
399
+ ) -> Image:
400
+ """Order statistic at floor(rank*(n-1)) of the sorted clipped window. ITK Parity: RankImageFilter."""
401
+ ...
402
+
403
+ def color_median(image: ColorImage, radius: int = 1) -> ColorImage:
404
+ """Per-component median on an RGB/vector image (box radius). ITK Parity: MedianImageFilter (vector)."""
405
+ ...
406
+
407
+ def color_mean(image: ColorImage, radius: int = 1) -> ColorImage:
408
+ """Per-component mean (box) filter on an RGB/vector image. ITK Parity: MeanImageFilter (vector)."""
409
+ ...
410
+
411
+ def color_smoothing_recursive_gaussian(image: ColorImage, sigma: float) -> ColorImage:
412
+ """Per-component smoothing recursive Gaussian on an RGB/vector image. ITK Parity: SmoothingRecursiveGaussianImageFilter (vector)."""
413
+ ...
414
+
415
+ def compose(c0: Image, c1: Image, c2: Image) -> ColorImage:
416
+ """Compose three scalar images into a 3-component vector image. ITK Parity: ComposeImageFilter."""
417
+ ...
418
+
419
+ def gradient(image: Image, use_image_spacing: bool = True) -> ColorImage:
420
+ """Central-difference gradient -> 3-component vector (dx,dy,dz). ITK Parity: GradientImageFilter."""
421
+ ...
422
+
423
+ def gradient_recursive_gaussian(image: Image, sigma: float = 1.0) -> ColorImage:
424
+ """Gaussian-smoothed gradient -> 3-component vector (dx,dy,dz). ITK Parity: GradientRecursiveGaussianImageFilter."""
425
+ ...
426
+
427
+ def scalar_to_rgb_colormap(image: Image, colormap: str = "grey") -> ColorImage:
428
+ """Map scalar -> RGB via a colormap (grey/red/green/blue). ITK Parity: ScalarToRGBColormapImageFilter."""
429
+ ...
430
+
431
+ def label_to_rgb(image: Image, background: int = 0) -> ColorImage:
432
+ """Map a label image to RGB via ITK's 30-colour table (background->black). ITK Parity: LabelToRGBImageFilter."""
433
+ ...
434
+
435
+ def label_overlay(
436
+ image: Image, label: Image, opacity: float = 0.5, background: int = 0
437
+ ) -> ColorImage:
438
+ """Overlay a label image on grayscale as RGB (alpha-blend with colour table). ITK Parity: LabelOverlayImageFilter."""
439
+ ...
440
+
441
+ def label_map_contour_overlay(
442
+ image: Image, label: Image, opacity: float = 0.5, background: int = 0
443
+ ) -> ColorImage:
444
+ """Overlay label contours on grayscale as RGB. ITK Parity: LabelMapContourOverlayImageFilter (sitk.LabelMapContourOverlay, default geometry)."""
445
+ ...
446
+
447
+ def physical_point_image_source(
448
+ size: tuple[int, int, int],
449
+ origin: tuple[float, float, float] = (0.0, 0.0, 0.0),
450
+ spacing: tuple[float, float, float] = (1.0, 1.0, 1.0),
451
+ ) -> ColorImage:
452
+ """Generate a vector image holding each voxel's physical coordinate. ITK Parity: PhysicalPointImageSource."""
453
+ ...
454
+
455
+ def vector_index_selection_cast(image: ColorImage, index: int) -> Image:
456
+ """Extract one component of a vector image as a scalar image. ITK Parity: VectorIndexSelectionCastImageFilter."""
457
+ ...
458
+
459
+ def edge_potential(image: ColorImage) -> Image:
460
+ """Edge potential exp(-|vector|) of a vector (gradient) image. ITK Parity: EdgePotentialImageFilter."""
461
+ ...
462
+
463
+ def vector_magnitude(image: ColorImage) -> Image:
464
+ """Per-voxel Euclidean magnitude of a vector image. ITK Parity: VectorMagnitudeImageFilter."""
465
+ ...
466
+
467
+ def clamp_image(image: Image, lower: float, upper: float) -> Image:
468
+ """Pixelwise clamp to [lower, upper]. ITK Parity: ClampImageFilter."""
469
+ ...
470
+
471
+ def invert_intensity(image: Image, maximum: float = 255.0) -> Image:
472
+ """Invert intensities about maximum: out(x) = maximum - in(x). ITK Parity: InvertIntensityImageFilter."""
473
+ ...
474
+
475
+ def mask_image(image: Image, mask: Image, outside_value: float = 0.0) -> Image:
476
+ """Keep image where mask > 0, else outside_value. ITK Parity: MaskImageFilter."""
477
+ ...
478
+
479
+ def mask_negated_image(image: Image, mask: Image, outside_value: float = 0.0) -> Image:
480
+ """Keep image where mask <= 0, else outside_value. ITK Parity: MaskNegatedImageFilter."""
481
+ ...
482
+
483
+ def masked_assign(image: Image, mask: Image, assign_value: float = 0.0) -> Image:
484
+ """Assign value where mask>0, keep image elsewhere. ITK Parity: MaskedAssignImageFilter."""
485
+ ...
486
+
487
+ def maximum_images(a: Image, b: Image) -> Image:
488
+ """Pixelwise maximum: out(x) = max(a(x), b(x)). ITK Parity: MaximumImageFilter."""
489
+ ...
490
+
491
+ def squared_difference_images(a: Image, b: Image) -> Image:
492
+ """Pixelwise squared difference: out(x) = (a(x) - b(x))^2. ITK Parity: SquaredDifferenceImageFilter."""
493
+ ...
494
+
495
+ def absolute_value_difference_images(a: Image, b: Image) -> Image:
496
+ """Pixelwise absolute difference: out(x) = |a(x) - b(x)|. ITK Parity: AbsoluteValueDifferenceImageFilter."""
497
+ ...
498
+
499
+ def atan2_images(a: Image, b: Image) -> Image:
500
+ """Pixelwise four-quadrant arctangent: out(x) = atan2(a(x), b(x)). ITK Parity: Atan2ImageFilter."""
501
+ ...
502
+
503
+ def pow_images(a: Image, b: Image) -> Image:
504
+ """Pixelwise power: out(x) = a(x) ^ b(x). ITK Parity: PowImageFilter."""
505
+ ...
506
+
507
+ def white_top_hat(image: Image, radius: int) -> Image: ...
508
+ def black_top_hat(image: Image, radius: int) -> Image: ...
509
+ def hit_or_miss(image: Image, fg_radius: int, bg_radius: int) -> Image: ...
510
+ def label_dilation(image: Image, radius: int) -> Image: ...
511
+ def label_erosion(image: Image, radius: int = 1) -> Image: ...
512
+ def label_opening(image: Image, radius: int = 1) -> Image: ...
513
+ def label_closing(image: Image, radius: int = 1) -> Image: ...
514
+ def morphological_reconstruction(
515
+ marker: Image,
516
+ mask: Image,
517
+ mode: str = "dilation",
518
+ fully_connected: bool = False,
519
+ ) -> Image: ...
520
+ def h_maxima(image: Image, height: float, fully_connected: bool = False) -> Image:
521
+ """H-maxima transform (suppress bright maxima below `height`). ITK Parity: HMaximaImageFilter."""
522
+ ...
523
+
524
+ def h_minima(image: Image, height: float, fully_connected: bool = False) -> Image:
525
+ """H-minima transform (suppress dark minima below `height`). ITK Parity: HMinimaImageFilter."""
526
+ ...
527
+
528
+ def h_convex(image: Image, height: float, fully_connected: bool = False) -> Image:
529
+ """H-convex transform: f - HMaxima_h(f). ITK Parity: HConvexImageFilter."""
530
+ ...
531
+
532
+ def h_concave(image: Image, height: float, fully_connected: bool = False) -> Image:
533
+ """H-concave transform: HMinima_h(f) - f. ITK Parity: HConcaveImageFilter."""
534
+ ...
535
+
536
+ def regional_maxima(
537
+ image: Image,
538
+ foreground: float = 1.0,
539
+ background: float = 0.0,
540
+ fully_connected: bool = False,
541
+ ) -> Image:
542
+ """Binary regional maxima. ITK Parity: RegionalMaximaImageFilter."""
543
+ ...
544
+
545
+ def regional_minima(
546
+ image: Image,
547
+ foreground: float = 1.0,
548
+ background: float = 0.0,
549
+ fully_connected: bool = False,
550
+ ) -> Image:
551
+ """Binary regional minima. ITK Parity: RegionalMinimaImageFilter."""
552
+ ...
553
+
554
+ def valued_regional_maxima(image: Image, fully_connected: bool = False) -> Image:
555
+ """Valued regional maxima (non-maxima → -FLT_MAX). ITK Parity: ValuedRegionalMaximaImageFilter."""
556
+ ...
557
+
558
+ def valued_regional_minima(image: Image, fully_connected: bool = False) -> Image:
559
+ """Valued regional minima (non-minima → +FLT_MAX). ITK Parity: ValuedRegionalMinimaImageFilter."""
560
+ ...
561
+
562
+ def opening_by_reconstruction(
563
+ image: Image, radius: int, fully_connected: bool = False
564
+ ) -> Image:
565
+ """Opening by reconstruction (box SE). ITK Parity: OpeningByReconstructionImageFilter."""
566
+ ...
567
+
568
+ def closing_by_reconstruction(
569
+ image: Image, radius: int, fully_connected: bool = False
570
+ ) -> Image:
571
+ """Closing by reconstruction (box SE). ITK Parity: ClosingByReconstructionImageFilter."""
572
+ ...
573
+
574
+ def grayscale_closing(image: Image, radius: int) -> Image:
575
+ """Grayscale morphological closing (box SE). ITK Parity: GrayscaleMorphologicalClosingImageFilter."""
576
+ ...
577
+
578
+ def grayscale_opening(image: Image, radius: int) -> Image:
579
+ """Grayscale morphological opening (box SE). ITK Parity: GrayscaleMorphologicalOpeningImageFilter."""
580
+ ...
581
+
582
+ def grayscale_fillhole(image: Image) -> Image:
583
+ """Grayscale fill-hole. ITK Parity: GrayscaleFillholeImageFilter."""
584
+ ...
585
+
586
+ def grayscale_grind_peak(image: Image, fully_connected: bool = False) -> Image:
587
+ """Grayscale grind-peak (dual of fill-hole). ITK Parity: GrayscaleGrindPeakImageFilter."""
588
+ ...
589
+
590
+ def binary_contour(
591
+ image: Image, fully_connected: bool = False, foreground_value: float = 1.0
592
+ ) -> Image:
593
+ """Binary object boundary. ITK Parity: BinaryContourImageFilter."""
594
+ ...
595
+
596
+ def label_contour(
597
+ image: Image, fully_connected: bool = False, background_value: float = 0.0
598
+ ) -> Image:
599
+ """Per-label boundary voxels. ITK Parity: LabelContourImageFilter."""
600
+ ...
601
+
602
+ def voting_binary(
603
+ image: Image,
604
+ radius: int = 1,
605
+ birth_threshold: int = 1,
606
+ survival_threshold: int = 1,
607
+ foreground_value: float = 1.0,
608
+ background_value: float = 0.0,
609
+ ) -> Image:
610
+ """One binary voting (cellular-automaton) step. ITK Parity: VotingBinaryImageFilter."""
611
+ ...
612
+
613
+ def voting_binary_hole_filling(
614
+ image: Image,
615
+ radius: int = 1,
616
+ majority_threshold: int = 1,
617
+ foreground_value: float = 1.0,
618
+ background_value: float = 0.0,
619
+ ) -> Image:
620
+ """Fill background holes by majority vote (fg always survives, clamp boundary). ITK Parity: VotingBinaryHoleFillingImageFilter."""
621
+ ...
622
+
623
+ def voting_binary_iterative_hole_filling(
624
+ image: Image,
625
+ radius: int = 1,
626
+ max_iterations: int = 10,
627
+ majority_threshold: int = 1,
628
+ foreground_value: float = 1.0,
629
+ background_value: float = 0.0,
630
+ ) -> Image:
631
+ """Iteratively fill background holes by majority vote. ITK Parity: VotingBinaryIterativeHoleFillingImageFilter."""
632
+ ...
633
+
634
+ def flip(
635
+ image: Image, flip_z: bool = False, flip_y: bool = False, flip_x: bool = False
636
+ ) -> Image:
637
+ """Flip along Z/Y/X axes. ITK Parity: FlipImageFilter (sitk.Flip, axes reversed to [x,y,z])."""
638
+ ...
639
+
640
+ def constant_pad(
641
+ image: Image,
642
+ lower: tuple[int, int, int],
643
+ upper: tuple[int, int, int],
644
+ constant: float = 0.0,
645
+ ) -> Image:
646
+ """Constant-value pad; lower/upper are (z,y,x). ITK Parity: ConstantPadImageFilter."""
647
+ ...
648
+
649
+ def mirror_pad(
650
+ image: Image, lower: tuple[int, int, int], upper: tuple[int, int, int]
651
+ ) -> Image:
652
+ """Mirror (symmetric) pad; lower/upper are (z,y,x). ITK Parity: MirrorPadImageFilter."""
653
+ ...
654
+
655
+ def wrap_pad(
656
+ image: Image, lower: tuple[int, int, int], upper: tuple[int, int, int]
657
+ ) -> Image:
658
+ """Wrap (periodic) pad; lower/upper are (z,y,x). ITK Parity: WrapPadImageFilter."""
659
+ ...
660
+
661
+ def zero_flux_neumann_pad(
662
+ image: Image, lower: tuple[int, int, int], upper: tuple[int, int, int]
663
+ ) -> Image:
664
+ """Edge-replicate (zero-flux Neumann) pad; lower/upper are (z,y,x). ITK Parity: ZeroFluxNeumannPadImageFilter."""
665
+ ...
666
+
667
+ def fft_pad(image: Image, max_prime: int = 5, boundary: int = 1) -> Image:
668
+ """Pad each axis to the next size whose greatest prime factor is <= max_prime
669
+ (default 5). boundary: 0 zero, 1 zero-flux Neumann (default), 2 periodic.
670
+ ITK Parity: FFTPadImageFilter."""
671
+ ...
672
+
673
+ def region_of_interest(
674
+ image: Image, start: tuple[int, int, int], size: tuple[int, int, int]
675
+ ) -> Image:
676
+ """Crop to a sub-region; start/size are (z,y,x). ITK Parity: RegionOfInterestImageFilter."""
677
+ ...
678
+
679
+ def crop(
680
+ image: Image, lower: tuple[int, int, int], upper: tuple[int, int, int]
681
+ ) -> Image:
682
+ """Crop lower/upper voxels off each axis face (z,y,x). ITK Parity: CropImageFilter."""
683
+ ...
684
+
685
+ def cyclic_shift(image: Image, shift: tuple[int, int, int]) -> Image:
686
+ """Cyclically roll the image by (z,y,x) voxels (wrap-around). ITK Parity: CyclicShiftImageFilter."""
687
+ ...
688
+
689
+ def join_series(images: list[Image]) -> Image:
690
+ """Stack a list of [zi,Y,X] images along Z into [sum zi, Y, X]. ITK Parity: JoinSeriesImageFilter."""
691
+ ...
692
+
693
+ def tile(
694
+ images: list[Image], layout: tuple[int, int, int], default_value: float = 0.0
695
+ ) -> Image:
696
+ """Tile same-sized images into a grid (layout = nx,ny,nz tiles per axis). ITK Parity: TileImageFilter."""
697
+ ...
698
+
699
+ def checker_board(
700
+ image1: Image, image2: Image, pattern: tuple[int, int, int] = (4, 4, 4)
701
+ ) -> Image:
702
+ """Checkerboard-combine two images (pattern = nx,ny,nz cells). ITK Parity: CheckerBoardImageFilter."""
703
+ ...
704
+
705
+ def slice_image(
706
+ image: Image,
707
+ start: tuple[int, int, int],
708
+ stop: tuple[int, int, int],
709
+ step: tuple[int, int, int],
710
+ ) -> Image:
711
+ """Strided sub-region (start:stop:step per axis, z,y,x order). ITK Parity: SliceImageFilter."""
712
+ ...
713
+
714
+ def expand(image: Image, factors: tuple[int, int, int]) -> Image:
715
+ """Integer-factor upsample (z,y,x) via linear interpolation. ITK Parity: ExpandImageFilter."""
716
+ ...
717
+
718
+ def permute_axes(image: Image, order: tuple[int, int, int]) -> Image:
719
+ """Permute tensor axes (order is a [z,y,x] permutation). ITK Parity: PermuteAxesImageFilter."""
720
+ ...
721
+
722
+ def paste(dest: Image, source: Image, dest_start: tuple[int, int, int]) -> Image:
723
+ """Paste source into dest at dest_start (z,y,x). ITK Parity: PasteImageFilter."""
724
+ ...
725
+
726
+ def resample_image(
727
+ image: Image,
728
+ spacing_z: float = 1.0,
729
+ spacing_y: float = 1.0,
730
+ spacing_x: float = 1.0,
731
+ mode: str = "linear",
732
+ ) -> Image: ...
733
+ def warp(moving: Image, disp_z: Image, disp_y: Image, disp_x: Image) -> Image:
734
+ """Warp `moving` through a dense displacement field (trilinear). out(p)=moving(p+D(p)). ITK Parity: WarpImageFilter."""
735
+ ...
736
+
737
+ def bspline_decomposition(image: Image) -> Image:
738
+ """Cubic B-spline interpolation coefficients (mirror boundary). ITK Parity: BSplineDecompositionImageFilter (order 3)."""
739
+ ...
740
+
741
+ def rotate_image(
742
+ image: Image,
743
+ angle_x: float = 0.0,
744
+ angle_y: float = 0.0,
745
+ angle_z: float = 0.0,
746
+ mode: str = "linear",
747
+ default_pixel_value: float = 0.0,
748
+ ) -> Image: ...
749
+ def shift_image(
750
+ image: Image,
751
+ shift_z: float = 0.0,
752
+ shift_y: float = 0.0,
753
+ shift_x: float = 0.0,
754
+ mode: str = "linear",
755
+ default_pixel_value: float = 0.0,
756
+ ) -> Image: ...
757
+ def zoom_image(
758
+ image: Image,
759
+ zoom_z: float = 1.0,
760
+ zoom_y: float = 1.0,
761
+ zoom_x: float = 1.0,
762
+ mode: str = "linear",
763
+ ) -> Image: ...
764
+ def distance_transform(
765
+ image: Image,
766
+ foreground_threshold: float = 0.5,
767
+ squared: bool = False,
768
+ ) -> Image:
769
+ """Euclidean distance transform (Meijster et al. 2000).
770
+
771
+ For each background voxel, computes distance to nearest foreground voxel
772
+ in physical units (respecting image spacing). Foreground voxels get 0.0.
773
+
774
+ Args:
775
+ image: Binary input image.
776
+ foreground_threshold: Voxels above this value are foreground (default 0.5).
777
+ squared: If True, return squared distances (default False).
778
+
779
+ Returns:
780
+ Distance image with identical shape and spatial metadata.
781
+ """
782
+ ...
783
+
784
+ def signed_distance_map(image: Image, foreground_threshold: float = 0.5) -> Image:
785
+ """Signed Euclidean distance map (voxel-centre convention).
786
+
787
+ Foreground voxels get -dist to nearest background; background voxels get
788
+ +dist to nearest foreground (physical units). Float-exact to scipy signed
789
+ distance_transform_edt. NOT sitk.SignedMaurerDistanceMap (which measures to
790
+ the object boundary, differing by up to sqrt(2) voxel).
791
+ """
792
+ ...
793
+
794
+ def signed_maurer_distance_map(
795
+ image: Image,
796
+ inside_is_positive: bool = False,
797
+ squared_distance: bool = True,
798
+ use_image_spacing: bool = True,
799
+ background_value: float = 0.0,
800
+ ) -> Image:
801
+ """Signed Maurer distance map (respects image spacing and evaluates to boundary)."""
802
+ ...
803
+
804
+ # -- Noise generators ---------------------------------------------------------
805
+
806
+ def additive_gaussian_noise(
807
+ image: Image, std: float, mean: float = 0.0, seed: int = 42
808
+ ) -> Image: ...
809
+ def salt_and_pepper_noise(
810
+ image: Image, probability: float, seed: int = 42
811
+ ) -> Image: ...
812
+ def shot_noise(image: Image, scale: float, seed: int = 42) -> Image: ...
813
+ def speckle_noise(image: Image, std: float, seed: int = 42) -> Image: ...
814
+
815
+ # -- Resampling / diffusion ---------------------------------------------------
816
+
817
+ def bin_shrink(
818
+ image: Image, factor_z: int = 2, factor_y: int = 2, factor_x: int = 2
819
+ ) -> Image: ...
820
+ def shrink(
821
+ image: Image, factor_z: int = 2, factor_y: int = 2, factor_x: int = 2
822
+ ) -> Image:
823
+ """Subsample (no averaging), ITK Shrink. factors (z,y,x); sitk.Shrink uses [x,y,z]. ITK Parity: ShrinkImageFilter."""
824
+ ...
825
+
826
+ def gaussian_image_source(
827
+ size: tuple[int, int, int],
828
+ sigma: tuple[float, float, float],
829
+ mean: tuple[float, float, float],
830
+ scale: float = 255.0,
831
+ origin: tuple[float, float, float] = (0.0, 0.0, 0.0),
832
+ spacing: tuple[float, float, float] = (1.0, 1.0, 1.0),
833
+ ) -> Image:
834
+ """Generate a Gaussian blob image (params in sitk x,y,z order). ITK Parity: GaussianImageSource."""
835
+ ...
836
+
837
+ def grid_image_source(
838
+ size: tuple[int, int, int],
839
+ spacing: tuple[float, float, float] = (1.0, 1.0, 1.0),
840
+ origin: tuple[float, float, float] = (0.0, 0.0, 0.0),
841
+ sigma: tuple[float, float, float] = (0.5, 0.5, 0.5),
842
+ grid_spacing: tuple[float, float, float] = (4.0, 4.0, 4.0),
843
+ grid_offset: tuple[float, float, float] = (0.0, 0.0, 0.0),
844
+ scale: float = 255.0,
845
+ which_dimensions: tuple[bool, bool, bool] = (True, True, True),
846
+ ) -> Image:
847
+ """Generate a grid-pattern image (dark Gaussian lines). ITK Parity: GridImageSource."""
848
+ ...
849
+
850
+ def gabor_image_source(
851
+ size: tuple[int, int, int],
852
+ spacing: tuple[float, float, float] = (1.0, 1.0, 1.0),
853
+ origin: tuple[float, float, float] = (0.0, 0.0, 0.0),
854
+ sigma: tuple[float, float, float] = (16.0, 16.0, 16.0),
855
+ mean: tuple[float, float, float] = (32.0, 32.0, 32.0),
856
+ frequency: float = 0.4,
857
+ ) -> Image:
858
+ """Generate a Gabor-wavelet image (Gaussian envelope * cosine along x). ITK Parity: GaborImageSource."""
859
+ ...
860
+
861
+ def coherence_enhancing_diffusion(
862
+ image: Image,
863
+ sigma: float = 3.0,
864
+ contrast: float = 1e-10,
865
+ alpha: float = 0.001,
866
+ time_step: float = 0.0625,
867
+ iterations: int = 10,
868
+ ) -> Image: ...
869
+ def anti_alias_binary(
870
+ image: Image,
871
+ max_rms_error: float = 0.01,
872
+ number_of_iterations: int = 50,
873
+ ) -> Image:
874
+ """Narrow-band level-set smoothing of binary boundaries via mean curvature flow.
875
+ Returns the level-set function \u03c6 (negative inside). ITK Parity: AntiAliasBinaryImageFilter."""
876
+ ...
877
+
878
+ def scalar_chan_and_vese_dense_level_set(
879
+ initial_level_set: Image,
880
+ feature_image: Image,
881
+ number_of_iterations: int = 20,
882
+ lambda1: float = 1.0,
883
+ lambda2: float = 1.0,
884
+ mu: float = 1.0,
885
+ nu: float = 0.0,
886
+ epsilon: float = 1.0,
887
+ ) -> Image:
888
+ """Dense Chan-Vese level set with user-supplied \u03c6\u2080 and feature image.
889
+ ITK Parity: ScalarChanAndVeseDenseLevelSetImageFilter."""
890
+ ...
891
+
892
+ def canny_segmentation_level_set(
893
+ initial_level_set: Image,
894
+ feature_image: Image,
895
+ canny_threshold: float = 0.1,
896
+ canny_variance: float = 1.0,
897
+ number_of_iterations: int = 20,
898
+ max_rms_error: float = 0.01,
899
+ propagation_scaling: float = 1.0,
900
+ ) -> Image:
901
+ """Canny-edge-guided level set segmentation.
902
+ ITK Parity: CannySegmentationLevelSetImageFilter."""
903
+ ...
904
+
905
+ def patch_based_denoising(
906
+ image: Image,
907
+ number_of_iterations: int = 1,
908
+ number_of_sample_patches: int = 200,
909
+ patch_radius: int = 4,
910
+ sample_variance: float = 400.0,
911
+ kernel_sigma: float = 400.0,
912
+ kernel_bandwidth_estimation: bool = False,
913
+ ) -> Image:
914
+ """Patch-based non-local-means denoising.
915
+ ITK Parity: PatchBasedDenoisingImageFilter."""
916
+ ...
917
+
918
+ # -- FFT spectral filters -----------------------------------------------------
919
+
920
+ def forward_fft(image: Image) -> Image: ...
921
+ def inverse_fft(image: Image) -> Image: ...
922
+ def fft_shift(image: Image) -> Image: ...
923
+ def real_fft_shift(image: Image) -> Image:
924
+ """Cyclic roll of a real-valued spatial image so the DC component is centred. ITK Parity: FFTShiftImageFilter."""
925
+ ...
926
+ def complex_to_real(image: Image) -> Image:
927
+ """Real part of an interleaved [D,H,2W] complex image. ITK Parity: ComplexToRealImageFilter."""
928
+ ...
929
+
930
+ def complex_to_imaginary(image: Image) -> Image:
931
+ """Imaginary part of a complex image. ITK Parity: ComplexToImaginaryImageFilter."""
932
+ ...
933
+
934
+ def complex_to_modulus(image: Image) -> Image:
935
+ """Modulus sqrt(re^2+im^2) of a complex image. ITK Parity: ComplexToModulusImageFilter."""
936
+ ...
937
+
938
+ def complex_to_phase(image: Image) -> Image:
939
+ """Phase atan2(im,re) of a complex image. ITK Parity: ComplexToPhaseImageFilter."""
940
+ ...
941
+
942
+ def real_and_imaginary_to_complex(real: Image, imaginary: Image) -> Image:
943
+ """Build interleaved [D,H,2W] complex from real+imag. ITK Parity: RealAndImaginaryToComplexImageFilter."""
944
+ ...
945
+
946
+ def magnitude_and_phase_to_complex(magnitude: Image, phase: Image) -> Image:
947
+ """Build complex from magnitude+phase (re=m*cos p, im=m*sin p). ITK Parity: MagnitudeAndPhaseToComplexImageFilter."""
948
+ ...
949
+
950
+ def fft_convolve(image: Image, kernel: Image) -> Image: ...
951
+ def fft_convolve_3d(volume: Image, kernel: Image) -> Image: ...
952
+ def fft_normalized_correlate(image: Image, template: Image) -> Image: ...
953
+ def fft_normalized_correlate_3d(volume: Image, template: Image) -> Image: ...
954
+ def masked_fft_normalized_correlation(
955
+ fixed: Image,
956
+ moving: Image,
957
+ fixed_mask: Image,
958
+ moving_mask: Image,
959
+ greatest_prime_factor: int = 0,
960
+ required_fraction: float = 0.0,
961
+ ) -> Image:
962
+ """Masked FFT normalized cross-correlation. ITK Parity: MaskedFFTNormalizedCorrelationImageFilter."""
963
+ ...
964
+
965
+ def normalized_correlation(
966
+ image: Image,
967
+ mask: Image,
968
+ template: Image,
969
+ ) -> Image:
970
+ """Local normalized correlation of image with a template (mask-gated). ITK Parity: NormalizedCorrelationImageFilter."""
971
+ ...
972
+
973
+ def fft_ideal_low_pass(image: Image, cutoff: float = 0.3) -> Image: ...
974
+ def fft_ideal_high_pass(image: Image, cutoff: float = 0.3) -> Image: ...
975
+ def fft_butterworth_low_pass(
976
+ image: Image, cutoff: float = 0.3, order: int = 2
977
+ ) -> Image: ...
978
+ def fft_butterworth_high_pass(
979
+ image: Image, cutoff: float = 0.3, order: int = 2
980
+ ) -> Image: ...
981
+
982
+ # -- Deconvolution ------------------------------------------------------------
983
+
984
+ def richardson_lucy_deconvolution(
985
+ image: Image, kernel: Image, max_iterations: int = 30, tolerance: float = 1e-06
986
+ ) -> Image: ...
987
+ def landweber_deconvolution(
988
+ image: Image,
989
+ kernel: Image,
990
+ step_size: float = 0.1,
991
+ max_iterations: int = 100,
992
+ tolerance: float = 1e-06,
993
+ ) -> Image: ...
994
+ def projected_landweber_deconvolution(
995
+ image: Image,
996
+ kernel: Image,
997
+ step_size: float = 0.1,
998
+ max_iterations: int = 100,
999
+ tolerance: float = 1e-06,
1000
+ ) -> Image:
1001
+ """Landweber with a non-negativity projection each iteration. ITK Parity: ProjectedLandweberDeconvolution."""
1002
+ ...
1003
+
1004
+ def inverse_deconvolution(
1005
+ image: Image, kernel: Image, kernel_zero_magnitude_threshold: float = 1e-4
1006
+ ) -> Image:
1007
+ """Direct inverse filter U=G/H, zeroing frequencies where |H|<threshold. ITK Parity: InverseDeconvolution."""
1008
+ ...
1009
+
1010
+ def wiener_deconvolution(
1011
+ image: Image, kernel: Image, noise_to_signal: float = 0.01
1012
+ ) -> Image: ...
1013
+ def tikhonov_deconvolution(
1014
+ image: Image, kernel: Image, lambda_: float = 0.01
1015
+ ) -> Image: ...
1016
+
1017
+ # -- Intensity projections ----------------------------------------------------
1018
+
1019
+ def max_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1020
+ def min_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1021
+ def mean_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1022
+ def median_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1023
+ def binary_projection(
1024
+ image: Image, axis: int = 0, foreground: float = 1.0, background: float = 0.0
1025
+ ) -> Image:
1026
+ """Binary projection (foreground if any voxel == foreground). ITK Parity: BinaryProjectionImageFilter."""
1027
+ ...
1028
+
1029
+ def binary_threshold_projection(
1030
+ image: Image,
1031
+ axis: int = 0,
1032
+ threshold: float = 0.0,
1033
+ foreground: float = 1.0,
1034
+ background: float = 0.0,
1035
+ ) -> Image:
1036
+ """Binary-threshold projection (foreground if any voxel >= threshold). ITK Parity: BinaryThresholdProjectionImageFilter."""
1037
+ ...
1038
+
1039
+ def sum_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1040
+ def stddev_intensity_projection(image: Image, axis: int = 0) -> Image: ...
1041
+
1042
+ # -- Parity resolution additions ----------------------------------------------
1043
+
1044
+ def binary_thinning(image: Image) -> Image:
1045
+ """Thin a binary image to its 1-pixel-wide skeleton. ITK Parity: BinaryThinningImageFilter."""
1046
+ ...
1047
+
1048
+ def binary_pruning(image: Image, iteration: int = 3) -> Image:
1049
+ """Prune short spurs from a binary skeleton. ITK Parity: BinaryPruningImageFilter."""
1050
+ ...
1051
+
1052
+ def erode_object_morphology(
1053
+ image: Image,
1054
+ radius: int = 1,
1055
+ object_value: float = 1.0,
1056
+ background_value: float = 0.0,
1057
+ ) -> Image:
1058
+ """Erode an object's surface with a box structuring element. ITK Parity: ErodeObjectMorphologyImageFilter."""
1059
+ ...
1060
+
1061
+ def real_to_half_hermitian_forward_fft(image: Image) -> Image:
1062
+ """Real-to-half-Hermitian forward FFT. ITK Parity: RealToHalfHermitianForwardFFTImageFilter."""
1063
+ ...
1064
+
1065
+ def half_hermitian_to_real_inverse_fft(
1066
+ image: Image, actual_x_is_odd: bool = False
1067
+ ) -> Image:
1068
+ """Half-Hermitian-to-real inverse FFT. ITK Parity: HalfHermitianToRealInverseFFTImageFilter."""
1069
+ ...
1070
+
1071
+ def laplacian_sharpening(image: Image, use_image_spacing: bool = True) -> Image:
1072
+ """Sharpen an image by subtracting its (range-rescaled) Laplacian. ITK Parity: LaplacianSharpeningImageFilter."""
1073
+ ...
1074
+
1075
+ def zero_crossing_based_edge_detection(
1076
+ image: Image,
1077
+ variance: float = 1.0,
1078
+ maximum_error: float = 0.01,
1079
+ foreground_value: float = 1.0,
1080
+ background_value: float = 0.0,
1081
+ ) -> Image:
1082
+ """Zero-crossing-based edge detection. ITK Parity: ZeroCrossingBasedEdgeDetectionImageFilter."""
1083
+ ...
1084
+
1085
+ def iso_contour_distance(
1086
+ image: Image, level_set_value: float = 0.0, far_value: float = 10.0
1087
+ ) -> Image:
1088
+ """Narrow-band signed distance to the iso-contour. ITK Parity: IsoContourDistanceImageFilter."""
1089
+ ...
1090
+
1091
+ def approximate_signed_distance_map(
1092
+ image: Image,
1093
+ inside_value: float = 1.0,
1094
+ outside_value: float = 0.0,
1095
+ ) -> Image:
1096
+ """Approximate signed distance map via IsoContourDistance + FastChamferDistance.
1097
+ ITK Parity: ApproximateSignedDistanceMapImageFilter."""
1098
+ ...
1099
+
1100
+ def local_noise(
1101
+ image: Image, radius_z: int = 1, radius_y: int = 1, radius_x: int = 1
1102
+ ) -> Image:
1103
+ """Estimate local image noise. ITK Parity: NoiseImageFilter."""
1104
+ ...
1105
+
1106
+ def stochastic_fractal_dimension(image: Image, radius: int = 2) -> Image:
1107
+ """Per-voxel stochastic fractal dimension. ITK Parity: StochasticFractalDimensionImageFilter."""
1108
+ ...
1109
+
1110
+ def transform_to_displacement_field(
1111
+ reference: Image,
1112
+ matrix: list[list[float]],
1113
+ translation: list[float],
1114
+ center: list[float] = [0.0, 0.0, 0.0],
1115
+ ) -> tuple[Image, Image, Image]:
1116
+ """Sample an affine transform onto a reference grid as a dense displacement field. ITK Parity: TransformToDisplacementField."""
1117
+ ...
1118
+
1119
+ def fast_marching(
1120
+ image: Image,
1121
+ trial_points: list[list[int]],
1122
+ normalization_factor: float = 1.0,
1123
+ stopping_value: float | None = None,
1124
+ initial_trial_values: list[float] = [],
1125
+ ) -> Image:
1126
+ """Solve the Eikonal arrival-time field by fast marching. ITK Parity: FastMarchingImageFilter."""
1127
+ ...
1128
+
1129
+ def colliding_fronts(
1130
+ image: Image,
1131
+ seeds1: list[list[int]],
1132
+ seeds2: list[list[int]],
1133
+ apply_connectivity: bool = True,
1134
+ negative_epsilon: float = -1e-6,
1135
+ ) -> Image:
1136
+ """Colliding-fronts segmentation potential. ITK Parity: CollidingFrontsImageFilter."""
1137
+ ...
1138
+
1139
+ def transform_geometry(
1140
+ image: Image,
1141
+ matrix: list[list[float]],
1142
+ translation: list[float],
1143
+ center: list[float] = [0.0, 0.0, 0.0],
1144
+ ) -> Image:
1145
+ """Apply an affine transform to the image geometry (origin + direction), leaving
1146
+ voxel data and spacing unchanged. ITK Parity: TransformGeometryImageFilter."""
1147
+ ...
1148
+
1149
+ def invert_displacement_field(
1150
+ disp_z: Image,
1151
+ disp_y: Image,
1152
+ disp_x: Image,
1153
+ max_iterations: int = 10,
1154
+ max_error_tolerance: float = 0.1,
1155
+ mean_error_tolerance: float = 0.001,
1156
+ enforce_boundary: bool = True,
1157
+ ) -> tuple[Image, Image, Image]:
1158
+ """Iteratively invert a dense displacement field (Chen et al. fixed-point scheme).
1159
+ Returns (disp_z, disp_y, disp_x) inverse field components.
1160
+ ITK Parity: InvertDisplacementFieldImageFilter."""
1161
+ ...
1162
+
1163
+ def inverse_displacement_field(
1164
+ disp_z: Image,
1165
+ disp_y: Image,
1166
+ disp_x: Image,
1167
+ subsampling_factor: int = 16,
1168
+ ) -> tuple[Image, Image, Image]:
1169
+ """Invert a dense displacement field by thin-plate-spline landmark fitting.
1170
+ Returns (disp_z, disp_y, disp_x) inverse field components; float-exact (z==1 ⇒ 2-D).
1171
+ ITK Parity: InverseDisplacementFieldImageFilter (sitk.InverseDisplacementField)."""
1172
+ ...
1173
+
1174
+ def iterative_inverse_displacement_field(
1175
+ disp_z: Image,
1176
+ disp_y: Image,
1177
+ disp_x: Image,
1178
+ number_of_iterations: int = 5,
1179
+ stop_value: float = 0.0,
1180
+ ) -> tuple[Image, Image, Image]:
1181
+ """Coordinate-descent line-search inversion of a dense displacement field.
1182
+ Returns (disp_z, disp_y, disp_x) inverse field components.
1183
+ ITK Parity: IterativeInverseDisplacementFieldImageFilter."""
1184
+ ...
1185
+
1186
+ def dicom_orient(image: Image, orientation: str) -> Image:
1187
+ """Reorient image to the specified DICOM orientation code (e.g. 'LPS', 'RAS').
1188
+ Performs a signed axis permutation — no resampling. ITK Parity: DICOMOrientImageFilter."""
1189
+ ...
1190
+
1191
+ def reinitialize_level_set(image: Image, level_set_value: float = 0.0) -> Image:
1192
+ """Reinitialize a level-set image to a signed distance function.
1193
+ Deterministic: zero-crossing extractor + fast marching (NOT an iterative PDE).
1194
+ ITK Parity: ReinitializeLevelSetImageFilter."""
1195
+ ...
1196
+
1197
+ def bitwise_not(
1198
+ image: Image,
1199
+ bits: int = 8,
1200
+ signed: bool = False,
1201
+ ) -> Image:
1202
+ """Bitwise complement of an integer image represented as f32.
1203
+ For unsigned width `bits`: result = (2^bits - 1) - round(x).
1204
+ For signed two's complement: result = -round(x) - 1.
1205
+ Bit-exact to sitk.BitwiseNot for uint8/uint16/int16.
1206
+ ITK Parity: BitwiseNotImageFilter."""
1207
+ ...