Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
fe8c0c5
Fix generated class names for nested array types
ctrueden Oct 21, 2026
74c83c4
Test ops with nested array parameters in the engine
ctrueden Oct 22, 2026
c8af21a
Add a changelog for SciJava Ops Engine
ctrueden Oct 22, 2026
f2bbc94
Add segment.statisticalRegionMerging ops
ctrueden Oct 20, 2026
5404521
Add morphology.localThickness op
ctrueden Oct 20, 2026
88d8ecc
Add segment.hWatershed op
ctrueden Oct 20, 2026
318217a
Add transform.bin op
ctrueden Oct 20, 2026
ed3e7f0
Add image.localExtrema ops
ctrueden Oct 20, 2026
6603fe8
Add segment.detectSpotsDoG op
ctrueden Oct 20, 2026
5c8659d
Add image.kymograph op
ctrueden Oct 20, 2026
42dca72
Add Hessian and structure tensor filter ops
ctrueden Oct 20, 2026
289ab24
Add filter.pseudoFlatField op
ctrueden Oct 20, 2026
bac4a8b
Add filter.flatFieldCorrect op
ctrueden Oct 20, 2026
db0bcf1
Add filter.convolvedBackgroundSubtraction op
ctrueden Oct 20, 2026
96c51b5
Add filter.weightedMedian op
ctrueden Oct 20, 2026
b25a13a
Add filter.gaussianWeightedMedian op
ctrueden Oct 20, 2026
c0a6235
Add labeling.edgeCorrectedCount op
ctrueden Oct 20, 2026
6568a9d
Add labeling.nearestNeighborDistances and labeling.clarkEvans ops
ctrueden Oct 20, 2026
81e5628
Add geom.extent op
ctrueden Oct 20, 2026
c1f20e2
Add geom.compactness op
ctrueden Oct 20, 2026
8c71a46
Add geom.feretAspectRatio op
ctrueden Oct 20, 2026
bab055a
Add labeling.featureMap op
ctrueden Oct 20, 2026
18aaaea
Add scijava-ops-image-gpl component
ctrueden Oct 20, 2026
ea2c54e
Add scijava-ops-image-lgpl component
ctrueden Oct 20, 2026
270b976
Add transform.houghCircle op
ctrueden Oct 20, 2026
b25f6ba
Add segment.detectHoughCircles op
ctrueden Oct 20, 2026
2cdeb06
Add segment.siox ops
ctrueden Oct 21, 2026
aaf5e84
Add labeling filtering ops
ctrueden Oct 21, 2026
171da52
Add labeling relabel, merge, hole filling and crop ops
ctrueden Oct 21, 2026
e600693
Add labeling.boundaries and labeling.adjacency ops
ctrueden Oct 21, 2026
c583b24
Add image.runLengthMatrix and features.glrlm.* ops
ctrueden Oct 21, 2026
e44f654
Add image.sizeZoneMatrix and features.glszm.* ops
ctrueden Oct 21, 2026
626aa56
Add image.distanceZoneMatrix and features.gldzm.* ops
ctrueden Oct 21, 2026
5b1bedf
Add image.neighborhoodGrayToneDifferenceMatrix and features.ngtdm.* ops
ctrueden Oct 21, 2026
6918830
Add image.neighboringGrayLevelDependenceMatrix and features.ngldm.* ops
ctrueden Oct 21, 2026
614f49f
Add missing IBSI GLCM features to features.haralick
ctrueden Oct 21, 2026
9753b1f
Add morphological reconstruction and extrema ops
ctrueden Oct 21, 2026
68966dc
Add filter.localContrast and segment.phantast ops
ctrueden Oct 21, 2026
d8423e3
Add filter.helmholtzWavelength and filter.helmholtzOrientation ops
ctrueden Oct 21, 2026
4ccd45d
Add color.deconvolveStains op
ctrueden Oct 21, 2026
8f94a47
Fix image.integral for images with more than two dimensions
ctrueden Oct 21, 2026
a2ca77f
Add filter.kuwahara op
ctrueden Oct 21, 2026
2da7d00
Add filter.tvDenoise op
ctrueden Oct 21, 2026
1c28612
Add filter.anisotropicDiffusion op
ctrueden Oct 21, 2026
caf9cdd
Correct provenance of built-in stain vectors
ctrueden Oct 21, 2026
472d8ba
Fix filter.tubeness ignoring the calibration
ctrueden Oct 21, 2026
d7082e1
Fix geom.majorAxis/minorAxis on aligned or clockwise polygons
ctrueden Oct 21, 2026
bd2b0e2
Fix coloc.pValue block shuffling of trimmed images
ctrueden Oct 21, 2026
680953b
Document coloc.pValue as the Costes significance test
ctrueden Oct 21, 2026
cb384c3
Add labeling.distanceMap and label morphology ops
ctrueden Oct 21, 2026
2f2dee9
Add morphological gradient and Laplacian ops
ctrueden Oct 21, 2026
4820259
Add morphology.skeletonize3D op
ctrueden Oct 21, 2026
24b9255
Add skeleton analysis ops
ctrueden Oct 21, 2026
1772d51
Add compact, extended-minima and distance transform watershed ops
ctrueden Oct 21, 2026
a87df08
Add grayscale attribute openings and closings
ctrueden Oct 21, 2026
0cc2af6
Add AbstractOpTest base class to scijava-ops-image-lgpl
ctrueden Oct 21, 2026
f05e286
Add features.intrinsicVolumes ops
ctrueden Oct 21, 2026
cccf1f4
Move MorphoLibJ-derived ops to scijava-ops-image-lgpl
ctrueden Oct 21, 2026
4d35c97
Rename volume attribute filters to grayVolume
ctrueden Oct 21, 2026
98e4519
Add optional watershed line label to LGPL watershed ops
ctrueden Oct 21, 2026
6c1a535
Put Curtis Rueden and Claude Opus 5.5 first in @author tags
ctrueden Oct 21, 2026
56d73e7
Add features.directionality op
ctrueden Oct 21, 2026
82140f1
Add threshold.limitedMean op
ctrueden Oct 21, 2026
5199613
Add labeling.countContained and labeling.filterByContainedCount ops
ctrueden Oct 21, 2026
65d64a8
Add threshold.hysteresis op
ctrueden Oct 21, 2026
345f76c
Add filter.waveletATrous and filter.waveletDenoise ops
ctrueden Oct 21, 2026
e37062e
Add image.bleachCorrect, image.bleachFit and image.histogramMatch ops
ctrueden Oct 21, 2026
e9570cd
Add transform.focusStack and transform.focusStackIndex ops
ctrueden Oct 21, 2026
b0b5575
Add threshold.rats and threshold.ratsSurface ops
ctrueden Oct 21, 2026
a4f8c2f
Move clean-room ops back to scijava-ops-image
ctrueden Oct 21, 2026
9a6f39f
Add stats.entropy op
ctrueden Oct 21, 2026
a469747
Add image.histogram2D op
ctrueden Oct 21, 2026
a8dc259
Add coloc.mutualInformation op
ctrueden Oct 21, 2026
07e6419
Add coloc.spearman op
ctrueden Oct 21, 2026
07e18ca
Add coloc.manders op
ctrueden Oct 21, 2026
9b6d436
Add coloc.costesThreshold op
ctrueden Oct 21, 2026
fbf76b0
Add filter.phaseCorrelate op
ctrueden Oct 21, 2026
2959d23
Add morphology.geodesicDistanceMap and labeling.geodesicDiameter ops
ctrueden Oct 21, 2026
0f52a1f
Add labeling.overlap.* segmentation evaluation ops
ctrueden Oct 21, 2026
999c298
Add n-D labeling region shape measure ops
ctrueden Oct 21, 2026
1534742
Use matching centroid coordinates in 3D inertia tensor
ctrueden Oct 21, 2026
ad2a670
Add deconvolve.wiener and deconvolve.tikhonov ops
ctrueden Oct 21, 2026
cb8a887
Add deconvolve.landweber op
ctrueden Oct 22, 2026
d42e4d4
Add color.convert and color.deltaE ops
ctrueden Oct 21, 2026
dbf9922
Add filter.kuwaharaLinear ops
ctrueden Oct 21, 2026
b24e94c
Add filter.retinex ops
ctrueden Oct 21, 2026
4f5d775
Add filter.kalman op
ctrueden Oct 21, 2026
455971f
Add image.signedDistanceTransform and morphology.interpolateSlices ops
ctrueden Oct 22, 2026
90c8d13
Add segment.detectLines and segment.estimateLineParameters ops
ctrueden Oct 22, 2026
8d7da1c
Add segment.spotsFromSeeds op
ctrueden Oct 21, 2026
e337009
Add Canny-Deriche edge detection ops
ctrueden Oct 22, 2026
b58f178
Add morphology.directionalFilter op
ctrueden Oct 21, 2026
abf4617
Add filter.coherenceEnhancingDiffusion op
ctrueden Oct 21, 2026
5e2c38b
Add segment.kMeans op
ctrueden Oct 22, 2026
fa2c396
Add segment.seededRegionGrowing op
ctrueden Oct 22, 2026
0a1b15b
Add image.quantileNormalize op
ctrueden Oct 22, 2026
5072103
Add features.twoPointCorrelation op
ctrueden Oct 22, 2026
bdf1395
Add labeling.shapeBasedAverage op
ctrueden Oct 22, 2026
cfbb791
Fix Landweber default step size for unnormalized kernels
ctrueden Oct 22, 2026
22d40dd
Use one histogram bin per grey level in threshold ops
ctrueden Oct 21, 2026
23425c2
Add bilevel shortcut to global threshold ops
ctrueden Oct 21, 2026
f4a870a
Add ignoreBlack and ignoreWhite to global threshold ops
ctrueden Oct 21, 2026
3c7a2e5
Fix threshold.minError when the iteration does not converge
ctrueden Oct 21, 2026
adfaa71
Resolve threshold.otsu ties toward the lowest bin
ctrueden Oct 21, 2026
4682093
Make threshold.huang match Fiji Huang; add threshold.huang2
ctrueden Oct 21, 2026
0231213
Fix inverted threshold.localContrast
ctrueden Oct 21, 2026
ab22d61
Fix the threshold.localSauvola formula
ctrueden Oct 21, 2026
bb0d1d4
Fix local threshold ops on rectangles computed via integral images
ctrueden Oct 21, 2026
692f4f7
Make threshold.localPhansalkar stretch its input to [0, 1]
ctrueden Oct 21, 2026
8adcb73
Pin threshold.localBernsen and localNiblack to Fiji
ctrueden Oct 21, 2026
e3c87ff
Add transform.piv op
ctrueden Oct 22, 2026
2e916a9
Add segment.graphCut ops
ctrueden Oct 22, 2026
623895c
Add image.fastMarching and segment.fastMarching ops
ctrueden Oct 22, 2026
a62d3b7
Add segment.levelSet and image.levelSet ops
ctrueden Oct 22, 2026
5aa4556
Clamp flat-field corrections to the output type range
ctrueden Oct 22, 2026
21d820b
Compute filter.localContrast moments in double precision
ctrueden Oct 22, 2026
42222f5
Keep deconvolve.landweber buffers in double precision
ctrueden Oct 22, 2026
1d9d54f
Fix filter.weightedMedian for inputs with a non-zero min
ctrueden Oct 22, 2026
9987d46
Fix filter.tubeness for inputs with a non-zero min
ctrueden Oct 22, 2026
3967b3b
Keep filter.helmholtzOrientation within [0, 180)
ctrueden Oct 22, 2026
1d5b016
Match filter.kalman to the documented Kalman stack filter
ctrueden Oct 22, 2026
ab11fd7
Clamp edge-preserving smoothers to the output type range
ctrueden Oct 22, 2026
a400929
Extract the flat-array helpers into filter.FlatImage
ctrueden Oct 22, 2026
09b72f8
Move the CED Jacobi eigensolver into TensorUtils
ctrueden Oct 22, 2026
11110cf
Move defaultChannelDim into a shared ColorUtils class
ctrueden Oct 22, 2026
d1363ae
Limit hill climbing in filter.phaseCorrelate
ctrueden Oct 22, 2026
bb55a04
Test the MSRCR value of filter.retinex analytically
ctrueden Oct 22, 2026
c012991
Fix image.distanceTransform for inputs with non-zero min
ctrueden Oct 22, 2026
4429459
Keep the input interval in segment.distanceTransformWatershed
ctrueden Oct 22, 2026
7758980
Reject NaN in the morphology reconstruction ops
ctrueden Oct 22, 2026
0203f49
Reject all-foreground input in morphology.localThickness
ctrueden Oct 22, 2026
bae89fc
Order labeling.geodesicDiameterPath from first to second extremity
ctrueden Oct 22, 2026
8a0b5a8
Lowercase string options with Locale.ROOT
ctrueden Oct 22, 2026
ad282c7
Share the neighbor offset and spacing helpers
ctrueden Oct 22, 2026
41ecd98
Reuse image.signedDistanceTransform in labeling.shapeBasedAverage
ctrueden Oct 22, 2026
67c59e5
Exclude NaN pixels from threshold.limitedMean
ctrueden Oct 22, 2026
b8d0c81
Keep NaN pixels out of segment.spotsFromSeeds spots
ctrueden Oct 22, 2026
01e332e
Reject size-1 dimensions in intrinsicVolumes.densities
ctrueden Oct 22, 2026
cd97bd4
Add op-count regression tests to the GPL and LGPL modules
ctrueden Oct 22, 2026
178d9d7
Normalize GPL license headers in the ridge package
ctrueden Oct 22, 2026
0faa80e
Clean up the ridge package to the project style
ctrueden Oct 22, 2026
5e18d0f
Share one Gaussian curve fit in the GPL module
ctrueden Oct 22, 2026
1cba88c
Fix RATS noise estimate on quantized low-noise images
ctrueden Oct 22, 2026
6fcdc0e
Fix segment.kMeans iteration limit, output interval and NaN pixels
ctrueden Oct 22, 2026
edd1e23
Round the Bernsen mid grey down on integer images, as Fiji does
ctrueden Oct 22, 2026
c59471a
Use the population standard deviation in threshold.localNiblack
ctrueden Oct 22, 2026
7ddca33
Match Fiji in threshold.localSauvola, including its default r
ctrueden Oct 22, 2026
3b20f40
Match Fiji in threshold.localPhansalkar; add normalize option
ctrueden Oct 22, 2026
79f48ba
Cap the histograms of local thresholds at 256 bins
ctrueden Oct 22, 2026
fcfc8dc
Remove unused grey level counts from IBSI Haralick features
ctrueden Oct 22, 2026
414ba21
Reject NaN in the watershed and region growing ops
ctrueden Oct 22, 2026
171368e
Test translated inputs of transform.focusStack and threshold.hysteresis
ctrueden Oct 22, 2026
80a770c
Handle NaN in the other segment ops
ctrueden Oct 22, 2026
9b26511
Use the shared neighbor offsets in threshold.hysteresis
ctrueden Oct 22, 2026
33e5078
Reproduce upstream license notices and fix @author attributions
ctrueden Oct 22, 2026
49feb43
Remove unused dependencies from the GPL and LGPL POMs
ctrueden Oct 22, 2026
39bb397
Fix half-bin bias of features.directionality gradient method
ctrueden Oct 22, 2026
080f0b0
Drop java.awt.geom.Point2D from the ridge LineDetector
ctrueden Oct 22, 2026
6b10b1a
Use a nullable Shape connectivity, defaulting to full, in new ops
ctrueden Oct 22, 2026
18048e1
Name the pixel spacing parameter calibration in new ops
ctrueden Oct 22, 2026
1e24675
Number the labels of new partition ops from 1
ctrueden Oct 22, 2026
ab137bc
Remove the noiseVariance parameter of filter.kalman
ctrueden Oct 22, 2026
9122a25
Rename four new filter ops to avoid name clashes
ctrueden Oct 22, 2026
0bba7ec
Rename features.directionality and morphology.skeletonize3D
ctrueden Oct 22, 2026
8965f97
Rename three new segment and labeling ops for consistency
ctrueden Oct 22, 2026
3dbf3bc
Rename image.fastMarching, image.levelSet and transform.piv
ctrueden Oct 22, 2026
4b53aba
Add changelogs and list the GPL and LGPL components' ops
ctrueden Oct 22, 2026
6ec60e7
Document Fiji plugin equivalents of Ops
ctrueden Oct 22, 2026
142cce7
Document deviations and limits of the new filter and color ops
ctrueden Oct 22, 2026
23b3a0e
Document deviations and limits of the new morphology, labeling and im…
ctrueden Oct 22, 2026
badbebf
Document deviations and limits of the new segment and threshold ops
ctrueden Oct 22, 2026
d525bd2
Document the Directionality quirks kept for plugin parity
ctrueden Oct 22, 2026
200e2b8
Export the labeling utils and util packages of scijava-ops-image
ctrueden Nov 20, 2026
82d8107
Add About classes to the GPL and LGPL components
ctrueden Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
55 changes: 55 additions & 0 deletions docs/ops/doc/FijiPluginEquivalents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Fiji Plugin Equivalents

Many classic ImageJ and Fiji plugins have equivalent Ops. This page maps each plugin to its Ops;
the javadoc of each Op details its differences from the plugin. Ops marked *GPL* or *LGPL* live in the
`scijava-ops-image-gpl` or `scijava-ops-image-lgpl` components, since they derive from code under
those licenses; all other Ops are in `scijava-ops-image`.

"Same results" means the Op reproduces the plugin's output exactly on our test images; most Ops also
generalize the plugin to n-dimensional images and calibrated pixel sizes.

| Plugin | Ops | Notes |
|---|---|---|
| Auto Threshold | `threshold.<method>` | Same results, including Huang and Huang2. |
| Auto Local Threshold | `threshold.local<Method>` | Same results. |
| 3D ImageJ Suite: Canny edge 3D | `filter.derichePartialDerivative`, `filter.dericheGradientMagnitude`, `segment.cannyDericheEdges` | Normalized, separable Deriche filter; magnitudes differ by a constant factor. |
| 3D ImageJ Suite: 3D Spot Segmentation | `segment.spotsFromSeeds` (*GPL*) | Same results; no watershed option. |
| Anisotropic Diffusion 2D | — | Not ported; see `filter.peronaMalik` and `filter.coherenceEnhancingDiffusion`. |
| Bleach Correction | `image.bleachCorrect`, `image.bleachFit`, `image.histogramMatch` | |
| BioVoxxel Toolbox | `filter.pseudoFlatField`, `filter.flatFieldCorrect`, `filter.convolvedBackgroundSubtraction`, `filter.gaussianWeightedMedian`, `labeling.edgeCorrectedCount`, `labeling.clarkEvans`; `threshold.limitedMean`, `labeling.countContained` (*GPL*) | |
| CircleSkinner | `transform.houghCircle`, `segment.detectHoughCircles` | Votes on full rings rather than midpoint circles. |
| Coloc 2 | `coloc.pearsons`, `coloc.manders`, `coloc.costesThreshold`, `coloc.spearman`, `coloc.pValue` | Costes thresholds count a pixel equal to the threshold as below it. |
| Colour Deconvolution | `color.deconvolveStains` | Within one grey level. |
| Curvatures, Shape Index Map | `filter.hessianEigenvalues`, `filter.shapeIndex` | |
| Directionality | `features.directionalityHistogram` (*GPL*) | Same results for the Fourier method; the gradient method's half-bin bias is fixed. |
| Gaussian Stack Focuser | `transform.focusStack`, `transform.focusStackIndex` | |
| Graph Cut | `segment.graphCut` | Independent implementation of Boykov–Kolmogorov max-flow. |
| Helmholtz Analysis | `filter.helmholtzWavelength`, `filter.helmholtzOrientation` | Spatial instead of FFT band-pass; results differ slightly. |
| Interactive H-Watershed | `segment.hWatershed` | Same results on integer images. |
| Iterative Deconvolve 3D | `deconvolve.wiener`, `deconvolve.tikhonov`, `deconvolve.landweber` | Independent implementations. |
| Kalman Stack Filter | `filter.kalman` | Independent implementation of the documented algorithm. |
| Kuwahara Filter | `filter.kuwahara` | Same results away from the image border. |
| Linear Kuwahara | `filter.kuwaharaLinear` | Independent implementation. |
| KymographBuilder | `image.kymograph` | Samples the first row and column, which the plugin skips. |
| Level Sets | `segment.levelSet`, `segment.fastMarching` | Independent implementations (Chan–Vese, geodesic active contours). |
| Local Thickness | `morphology.localThickness` | Same results to 1e-5. |
| MorphoLibJ: morphological reconstruction, extrema, h-transforms, kill borders, fill holes | `morphology.reconstructBy*`, `morphology.regional*`, `morphology.extended*`, `morphology.h*`, `morphology.impose*`, `morphology.killBorders`, `morphology.fillHoles` | Same results. |
| MorphoLibJ: attribute filtering | `morphology.areaOpening`, `morphology.boxDiagonalOpening`, `morphology.attributeOpening` and closings | Same results. MorphoLibJ's "volume opening" is `morphology.areaOpening` on a 3D image. |
| MorphoLibJ: morphological segmentation | `segment.extendedMinimaWatershed`, `segment.compactWatershed` | Same results with watershed lines. |
| MorphoLibJ: distance transform watershed | `segment.distanceTransformWatershed` | Uses the exact Euclidean distance transform instead of chamfer. |
| MorphoLibJ: label utilities and label morphology | `labeling.*` (e.g. `removeBorderLabels`, `filterBySize`, `dilate`, `distanceMap`, `adjacency`) | Exact Euclidean distances instead of chamfer. |
| MorphoLibJ: geodesic distance, region analysis, label overlap | `morphology.geodesicDistanceMap`, `labeling.geodesicDiameter`, `labeling.inscribedBall`, `labeling.equivalentEllipsoid`, `labeling.maximumFeret`, `labeling.overlap.*` | |
| MorphoLibJ: intrinsic volumes (Analyze Regions) | `features.intrinsicVolumes.*` (*LGPL*) | Same results, except that interface area honors the pixel calibration. |
| OrientationJ | `filter.structureTensor`, `filter.orientation`, `filter.coherency` | |
| PHANTAST | `segment.phantast`, `filter.localCoefficientOfVariation` | Same results; two halo-correction bugs fixed. |
| PIV analyser | `image.piv` | |
| RadiomicsJ texture features | `features.glrlm.*`, `features.glszm.*`, `features.gldzm.*`, `features.ngtdm.*`, `features.ngldm.*` | Match the IBSI reference values. |
| RATS | `threshold.rats` | Independent implementation; results differ in detail. |
| Retinex | `filter.retinex` | Each scale is applied to the original image. |
| Ridge Detection | `segment.detectLines` (*GPL*) | Same results. |
| ROF Denoise | `filter.tvDenoise` | Chambolle's algorithm; borders differ. |
| SIOX Segmentation | `segment.siox` | Same results. |
| Skeletonize3D, AnalyzeSkeleton | `morphology.skeletonize`, `morphology.tagSkeleton`, `topology.skeletonGraph`, `topology.skeletonStatistics` (*GPL*) | Same results; fixes pruning after the root vertex is removed. |
| Statistical Region Merging | `segment.statisticalRegionMerging` | Same results on full-range 8-bit images. |
| Stitching (pairwise phase correlation) | `filter.phaseCorrelate` | Translation only. |
| Tubeness, Frangi Vesselness | `filter.tubeness`, `filter.frangiVesselness`, `filter.sheetness` | `filter.tubeness` differentiates in calibrated units, unlike the plugin. |
1 change: 1 addition & 0 deletions docs/ops/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The combination of these libraries allows declarative image analysis workflows,
SearchingForOps
CallingOps
IntrospectingOps
FijiPluginEquivalents

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
<module>scijava-ops-engine</module>
<module>scijava-ops-flim</module>
<module>scijava-ops-image</module>
<module>scijava-ops-image-gpl</module>
<module>scijava-ops-image-lgpl</module>
<module>scijava-ops-opencv</module>
<module>scijava-ops-ext-parser</module>
<module>scijava-ops-spi</module>
Expand Down
11 changes: 11 additions & 0 deletions scijava-ops-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog

All notable changes to SciJava Ops Engine.

## [Unreleased]

### Fixed

- Ops with multi-dimensional array parameters (e.g. `double[][]`) could not
be called with their optional parameters omitted, or with converted
arguments.
Comment on lines +1 to +11

@gselzer gselzer Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ctrueden is this something we're going to start doing for all of the modules in here now?

Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ static String getClassName(Type t) {
var className = clazz.getSimpleName();
if (className.chars().allMatch(Character::isJavaIdentifierPart))
return className;
if (clazz.isArray()) return clazz.getComponentType().getSimpleName() +
if (clazz.isArray()) return getClassName(clazz.getComponentType()) +
"_Arr";
return className;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private static String getClassName(Class<?> clazz) {
var className = clazz.getSimpleName();
if (className.chars().allMatch(c -> Character.isJavaIdentifierPart(c)))
return className;
if (clazz.isArray()) return clazz.getComponentType().getSimpleName() +
if (clazz.isArray()) return getClassName(clazz.getComponentType()) +
"_Arr";
return className;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,13 @@ public void testConversionDescription() {
Assertions.assertTrue(info.toString().contains(TEST_DESC));
}

/** Generated names of nested array types must be valid identifiers. */
@Test
public void testClassNameOfNestedArray() {
assertEquals("double", Conversions.getClassName(double.class));
assertEquals("double_Arr", Conversions.getClassName(double[].class));
assertEquals("double_Arr_Arr", Conversions.getClassName(double[][].class));
assertEquals("Integer_Arr_Arr_Arr", Conversions.getClassName(
Integer[][][].class));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*-
* #%L
* Java implementation of the SciJava Ops matching engine.
* %%
* Copyright (C) 2016 - 2025 SciJava developers.
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/

package org.scijava.ops.engine.reduce;

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.function.BiFunction;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.scijava.ops.engine.AbstractTestEnvironment;
import org.scijava.ops.engine.conversionLoss.impl.IdentityLossReporter;
import org.scijava.ops.engine.conversionLoss.impl.PrimitiveLossReporters;
import org.scijava.ops.engine.copy.CopyOpCollection;
import org.scijava.ops.engine.matcher.convert.IdentityCollection;
import org.scijava.ops.engine.matcher.convert.PrimitiveConverters;
import org.scijava.ops.engine.matcher.convert.UtilityConverters;
import org.scijava.ops.engine.matcher.impl.LossReporterWrapper;
import org.scijava.ops.spi.Nullable;
import org.scijava.ops.spi.OpCollection;
import org.scijava.ops.spi.OpMethod;

/**
* Tests ops with a multi-dimensional array parameter, whose reduced and
* converted wrappers need a generated class name derived from the parameter
* types ({@code double[][]} must give a valid identifier such as
* {@code double_Arr_Arr}).
*
* @author Curtis Rueden
* @author Claude Opus 5.5
*/
public class NestedArrayParameterTest extends AbstractTestEnvironment
implements OpCollection
{

@BeforeAll
public static void addNeededOps() {
ops.register( //
new CopyOpCollection<>(), //
new IdentityCollection<>(), //
new IdentityLossReporter<>(), //
new LossReporterWrapper<>(), //
new PrimitiveConverters<>(), //
new PrimitiveLossReporters(), //
new UtilityConverters(), //
new NestedArrayParameterTest() //
);
}

@OpMethod(names = "test.nestedArraySum", type = BiFunction.class)
public static Double nestedArraySum(final double[][] values,
@Nullable final Double scale)
{
double sum = 0;
for (final double[] row : values)
for (final double v : row)
sum += v;
return sum * (scale == null ? 1 : scale);
}

@OpMethod(names = "test.nestedArrayCount", type = BiFunction.class)
public static Double nestedArrayCount(final double[][][] values,
@Nullable final Double scale)
{
long count = 0;
for (final double[][] plane : values)
for (final double[] row : plane)
count += row.length;
return count * (scale == null ? 1 : scale);
}

private static final double[][] VALUES = { { 1, 2 }, { 3, 4 } };

@Test
public void testAllArguments() {
final Double sum = ops.op("test.nestedArraySum").input(VALUES, 2.0)
.outType(Double.class).apply();
assertEquals(20, sum, 0);
}

/** Omitting the optional parameter goes through a reduced wrapper. */
@Test
public void testOptionalOmitted() {
final Double sum = ops.op("test.nestedArraySum").input(VALUES).outType(
Double.class).apply();
assertEquals(10, sum, 0);
final Double count = ops.op("test.nestedArrayCount").input(
new double[2][3][4]).outType(Double.class).apply();
assertEquals(24, count, 0);
}

/** An Integer scale goes through a converted wrapper. */
@Test
public void testConverted() {
final Double sum = ops.op("test.nestedArraySum").input(VALUES, 3)
.outType(Double.class).apply();
assertEquals(30, sum, 0);
final Integer rounded = ops.op("test.nestedArraySum").input(VALUES)
.outType(Integer.class).apply();
assertEquals(10, rounded);
}
}
Loading
Loading