Repository navigation
Conversation
| # 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. |
There was a problem hiding this comment.
@ctrueden is this something we're going to start doing for all of the modules in here now?
| * @param <B> type of the binary input | ||
| * @implNote op names='morphology.localThickness' | ||
| */ | ||
| public class DefaultLocalThickness<B extends BooleanType<B>> implements |
There was a problem hiding this comment.
In general, I'm not a huge fan of DefaultBlah file names in this repo, because we could be using that filename to tell us what algorithm is implemented (I know there are many of these in this library - I'd love to get rid of them sometime!)
I'm going to save time and try to avoid digging into this or similar instances, but if you or an AI can suggest a better name I think that'd be swell
| * are {@code 1..numLeaves()}, and merge nodes follow. | ||
| * </p> | ||
| * | ||
| * @author Benoit Lombardot (MPI-CBG) |
There was a problem hiding this comment.
I remember at one point @ctrueden told me that adding institutions here is bad practice - maybe we could filter these out?
(I'm reviewing commit by commit, so forgive me if it's done in one of the many later commits 😅 )
| * Unlike {@code transform.subsampleView}, which simply decimates, this op | ||
| * aggregates every input sample. | ||
| * </p> | ||
| * | ||
| * @author Curtis Rueden | ||
| * @param <I> input type | ||
| * @param <O> output type | ||
| * @implNote op names='transform.bin' |
There was a problem hiding this comment.
transform.downsample? Could also be cool to have a transform.downsample that computes on demand (but probably not necessary)
| * Unlike {@code transform.subsampleView}, which simply decimates, this op | ||
| * aggregates every input sample. | ||
| * </p> | ||
| * | ||
| * @author Curtis Rueden | ||
| * @param <I> input type | ||
| * @param <O> output type | ||
| * @implNote op names='transform.bin' |
There was a problem hiding this comment.
Also for Functions like this I'd advise an adaptation.FORBIDDEN Op hint, especially since you wrote a Function.
9cc666a to
d525bd2
Compare
|
The rebase broke the SNAPSHOT pin versions (things had since been released on main, thus bumping the current SNAPSHOT versions in the meantime. I have now rebased again to address the issue; hopefully CI will pass this time. |
|
After some additional tinkering: CI build is passing. |
| * @param <V> output pixel type | ||
| * @see <a href="https://github.com/biovoxxel/BioVoxxel-Toolbox">BioVoxxel | ||
| * Toolbox</a> | ||
| * @implNote op names='filter.flatFieldCorrect' |
There was a problem hiding this comment.
The previous commit added filter.pseudoFlatField - should this op be named filter.flatField for parity?
|
@ctrueden I've worked up to 6568a9d. Maybe you mentioned this in earlier discussions, but I had a couple questions:
|
Yes: the original plugins are written against the original ImageJ
I would deprecate all the old plugins. Most of them already have not been changed in >10 years. For the ones we don't control like BioVoxxel Toolbox, it would be up to @biovoxxel and other upstream authors how they want to proceed. |
| * @param output the feature map | ||
| */ | ||
| @Override | ||
| public void compute(final ImgLabeling<L, I> labeling, final Map<L, N> values, |
There was a problem hiding this comment.
Maybe this Map<L, N> should be a Map<L, V>
| * @author Jean-Yves Tinevez | ||
| * @author Curtis Rueden | ||
| * @param <T> the type of the vote image | ||
| * @implNote op names='segment.detectHoughCircles' |
There was a problem hiding this comment.
Maybe segment.houghCircles?
Got it, good point!
Sounds good! |
| * @return a new labeling with the labels {@code start, start + 1, ...} | ||
| * @param <L> label type | ||
| * @param <I> index type of the labeling | ||
| * @implNote op names='labeling.relabel', type=Function |
There was a problem hiding this comment.
Maybe labels.enumerate? The idea is to capture the renumbering, right?
| * @return a new labeling with the labels merged | ||
| * @param <L> label type | ||
| * @param <I> index type of the labeling | ||
| * @implNote op names='labeling.mergeLabels', type=Function |
| * @return a new labeling with the holes filled | ||
| * @param <L> label type | ||
| * @param <I> index type of the labeling | ||
| * @implNote op names='labeling.fillHoles', type=Function |
There was a problem hiding this comment.
Just wanted to note this is very similar to morphology.fillHoles.
| * @param <I> index type of the labeling | ||
| * @implNote op names='labeling.cropLabel', type=Function | ||
| */ | ||
| public static <L, I extends IntegerType<I>> RandomAccessibleInterval<BitType> |
Reduced and converted op wrappers derive a class name from the parameter types, replacing "[]" with "_Arr". This was done only one level deep, so a parameter such as double[][] produced an invalid class name and the op could not be called with its optional parameters omitted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fix for generated class names of nested array types (a14c733e9) was only exercised indirectly by color.deconvolveStains in scijava-ops-image. NestedArrayParameterTest calls ops with double[][] and double[][][] parameters with a @nullable parameter omitted (reduced wrapper), and with a converted argument and output; without the fix, the reduced calls fail. The converted wrapper name is not compiled into a class on that path, so ConversionTest checks Conversions.getClassName directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cumulative sum along each dimension was computed over whole hyperslices in flat iteration order, which only coincides with a running sum along a line for 2D images. Accumulate along each line instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DefaultTubeness computed per-dimension sigmas in pixel units from the calibration, but then passed the scalar sigma to HessianMatrix, so the calibration argument had no effect at all. Now the Gaussian smoothing uses the calibrated sigmas, and the Hessian is converted to calibrated units (component (i, j) divided by cal[i] * cal[j]). Note that VIB's TubenessProcessor with calibration enabled smooths with calibrated sigmas but differentiates in pixel units, which makes the result depend on the sampling (2x the analytic value for a tube sampled with voxel depth 2). This op follows the physically consistent definition instead; the regression test checks against the analytic tubeness of an anisotropically sampled Gaussian tube. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DefaultMinorMajorAxis followed the angle-based branches of ImageJ's EllipseFitter#getEllipseParam, which are numerically unstable when the cross moment u11 is close to (but not exactly) zero: a 360-vertex polygon of an axis-aligned 40 x 10 ellipse gave axes 78.8 x 20.3 instead of 80 x 20. Clockwise polygons have a negative signed area, which made the area-equalizing scale (and thus both axes) NaN. The axes are now computed directly from the eigenvalues of the covariance matrix, which is mathematically the same moment-equivalent ellipse as ImageJ's (including its area equalization), and the absolute area is used. Existing regression values are unchanged. This also fixes geom.eccentricity and geom.roundness, which depend on these axes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When an image is not a multiple of the block size, coloc.pValue trims it symmetrically, which gives a view with a non-zero min. ShuffledView ignored the interval min, so it either read pixels outside the view (and misaligned the shuffled image with image2 by the trim offset) or threw an ArrayIndexOutOfBoundsException. ShuffledView and its cropAt helpers now honor the interval min, and DefaultPValue works on zero-min views so the zero-min shuffle buffer stays aligned with image2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
coloc.pValue with coloc.pearsons and PSF-sized blocks already performs the block randomization test of Costes et al. (2004); it just reports the complementary fraction (shuffles above the observed value, so p < 0.05 matches Costes' P > 95%). Document this, and the ways Coloc 2 deviates from the published test (Gaussian smoothing of the shuffled images and a normal-CDF P-value), and add a test running the Costes test on colocalized and unrelated synthetic channels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Several terms subtracted another axis's centroid coordinate from one factor. Because deviations from the centroid sum to zero over the region, the results were nonetheless correct, but the code read as a bug. Also add a test for the op, which had none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- maxIterations = 0 skipped the loop and left every assignment at -1, so numbering the labels threw ArrayIndexOutOfBoundsException. Now 0 assigns the pixels to the k-means++ seeds, and negative values are rejected. - When the iteration limit was hit, the centers were updated after the last assignment and never reassigned, so the labels were numbered by centers they did not belong to. The loop now always ends with an assignment step. - The labeling was created from FinalDimensions and so was zero-min; it now has the interval of the (sliced) input, like the other segment ops. - A NaN pixel made its cluster center NaN and thus corrupted the whole result. Pixels with a NaN feature are now left unlabeled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NaN pixel values gave NaN flooding priorities, for which the priority
comparisons are always false, so the flooding order of
segment.compactWatershed, segment.watershedExtendedMinima (via
Flooding.values) and segment.hWatershed was silently corrupted, and a
NaN in a seed region of segment.seededRegionGrowing made that region's
mean NaN. Like the reconstruction and attribute ops, these ops now
throw IllegalArgumentException("NaN values are not supported").
segment.seededRegionGrowing also rejects seeds with several labels at
one pixel, as Flooding does for markers: it used to take the "first"
label, but LabelingType iteration order is not defined.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both ops already handle a non-zero min correctly; these tests guard it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comparisons such as "value < threshold" let NaN through silently:
- segment.detectHoughCircles reported a NaN vote as a circle, since
NaN is neither below the threshold nor below its neighbors. NaN
votes are now ignored.
- segment.statisticalRegionMerging sorted and merged NaN pixels in an
undefined order, segment.siox turned NaN channels or trimap values
into NaN colors and confidences, and segment.phantast and
segment.detectSpotsDoG spread NaN through their Gaussian filters.
Like the watershed and reconstruction ops, these now throw
IllegalArgumentException("NaN values are not supported").
threshold.hysteresis already treated NaN pixels as background that does
not connect its neighbors; this is now documented and tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its private offsets(Shape, n) duplicated util.Neighborhoods.neighborOffsets, which Flooding and the morphology ops already share. The shared helper also makes the offsets symmetric, so an asymmetric shape now gives symmetric connectivity; symmetric shapes (including the default) give the same results as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Permissive ports must carry the notice text their license requires. Add the original notice, verbatim, to the class javadoc of: * the BioVoxxel BSD-3 ports (pseudoFlatField, flatFieldCorrect, convolvedBackgroundSubtraction, edge correction, featureMap, compactness, extent, feretAspectRatio), and the two GPL-module BioVoxxel ports, whose source files carry the toolbox BSD-3 header alongside a GPL-3 one (their javadoc now says so, instead of calling the toolbox GPL); * image.kymograph (KymographBuilder, MIT); * the SRM ops (BSD-2, Johannes Schindelin); * the Hough circle classes (CircleSkinner, BSD-2); * the SIOX classes and the RadiomicsJ-derived texture classes (Apache-2.0, stating that the code was modified). Fix @author tags, which list original authors only for translated or adapted code: * labeling.nearestNeighborDistances/clarkEvans were only inspired by BioVoxxel, so drop Jan Brocher (the credit stays in the prose); * the new features.haralick IBSI classes implement the IBSI formulas directly on the co-occurrence matrix rather than translating RadiomicsJ GLCMFeatures, so drop Tatsuaki Kobayashi and the Apache text, and keep RadiomicsJ as a reference; also drop their unused ng locals and say that jointAverage equals coocMeanX + 1. Also reword the gaussianWeightedMedian credit to cite only the algorithm definition. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mvn dependency:analyze (offline) reports these as unused, and grep confirms no imports: * GPL: scijava-concurrent, and the test-scope scijava-common and scifio. * LGPL: scijava-concurrent, scijava-function, imglib2-algorithm, and the test-scope scijava-common and scifio. scijava-ops-image moves to test scope: the LGPL main code uses none of it, but IntrinsicVolumesTest calls topology.eulerCharacteristic26N, which lives there. scijava-ops-engine stays (test scope), since the tests need it at runtime to build the OpEnvironment, which bytecode analysis cannot see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With LOCAL_GRADIENT_ORIENTATION, the bin index was computed by truncation, as in the Directionality plugin, so each bin collected the orientations in [center, center + width) while being reported at its center. The histogram, and hence the fitted direction, were thus offset by half a bin: on gratings at known orientations the direction came out 1.0 degree low on average with 90 bins and 3.1 degrees low with 30. The last bin only received orientations exactly at its center, and the index == nBins wrap was dead code. Round to the nearest bin center instead, and document the deviation from the plugin. The plugin regression test now compares the gradient cases by their fitted direction shifted by half a bin; the Fourier cases still match the plugin exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The set of processed junction positions was an ArrayList of AWT Point2D.Float, which pulled in the java.desktop module and made each lookup linear. Use a HashSet of packed float coordinates instead, with the same equality as Point2D (-0 equals 0, NaN positions are never seen), so the behavior is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every op added on this branch that takes a connectivity now takes a @nullable Shape connectivity, defaulting to full connectivity (RectangleShape(1, false): 8 in 2D, 26 in 3D); face connectivity is DiamondShape(1). * labeling.adjacency, labeling.boundaries, labeling.fillHoles and segment.seededRegionGrowing: StructuringElement -> Shape; the default changes from face to full. For labeling.fillHoles, the connectivity applies to the unlabeled (hole) components, as for morphology.fillHoles. * segment.hWatershed: Boolean useEightConnectivity -> Shape connectivity; the default changes from face (as in the original plugin) to full. * segment.graphCut (both): Boolean fullConnectivity -> Shape connectivity, with pair weights divided by the offset length; the default changes from face to full. * features.intrinsicVolumes.eulerNumber/densities: Integer 4/8/6/26 -> Shape (face -> C4/C6, full -> C8/C26, other shapes rejected); the default changes from face to full. meanBreadth: Integer connectivity2D -> Shape connectivity (default unchanged: full, i.e. C8 sections). This needs imglib2-algorithm in the LGPL module again. The morphology, watershed and hysteresis ops already took a Shape that defaults to full connectivity. labeling.countContained, segment.spotsFromSeeds, the texture zone matrices and segment.phantast keep their fixed full connectivity; segment.statisticalRegionMerging keeps the fixed face connectivity of the original algorithm. The new Neighborhoods.rasterOffsets lists neighbor offsets in raster order; Labelings, SeededRegionGrowing, HSegmentTree, GridGraphCut, GeodesicGraph and DefaultLocalThickness now use it instead of their own enumerations, in the same order as before (so results do not change), except that seeded region growing with explicit face connectivity visits face neighbors in raster order, which can only affect ties. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every op added on this branch that takes a pixel spacing now takes it as @nullable double[] calibration, with one value per dimension: * Rename spacing to calibration in labeling.distanceMap, dilate, erode, open, close, influenceZones, equivalentEllipsoid, inscribedBall, maximumFeret, maximumFeretDiameter, geodesicDiameter and geodesicDiameterPath; morphology.geodesicDistanceMap (both); and all features.intrinsicVolumes ops. * morphology.interpolateSlices now takes n values (including the one along dim, which does not affect the result) instead of n - 1, so the calibration of the image can be passed as is. * Add calibration to labeling.nearestNeighborDistances (centroids are compared in calibrated units), labeling.clarkEvans (the default volume is calibrated too) and labeling.shapeBasedAverage (passed on to image.signedDistanceTransform). This adds three op signatures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Labelings produced by the ops added on this branch now start at 1, with background or unassigned pixels unlabeled. Only two ops numbered from 0, and both are partitions that label every pixel: * segment.statisticalRegionMerging: regions are labeled 1, 2, ... (the region index of the original plugin plus one). * segment.kMeans: clusters are labeled 1, ..., k; NaN pixels stay unlabeled. The other new ops returning labelings already followed the convention (hWatershed, distanceTransformWatershed, extendedMinimaWatershed, spotsFromSeeds) or keep the labels of their input (compactWatershed, seededRegionGrowing, the labeling.* editing and filtering ops). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under the documented algorithm of the Kalman stack filter, the error variance is seeded with the noise variance, so the Kalman gain is 1 / (t + 1) whatever its value: the parameter had no effect. The op now computes the gain directly, and its signature is (input, dim?, gain?) -> [output], which removes one op signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- filter.anisotropicDiffusion -> filter.peronaMalik (Fiji's Anisotropic Diffusion 2D is Tschumperle-Deriche diffusion) - filter.surfaceness -> filter.sheetness (Sato sheet measure, not VIB's Surfaceness); TensorFilters.surfaceness -> sheetness - filter.localContrast -> filter.localCoefficientOfVariation (clashed with threshold.localContrast); DefaultLocalContrast moves to filter.localCoefficientOfVariation.DefaultLocalCoefficientOfVariation - filter.cannyDeriche -> filter.dericheGradientMagnitude (it returns the gradient magnitude, not edges) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- features.directionality -> features.directionalityHistogram, so it no longer resembles the Tamura feature features.tamura.directionality; DefaultDirectionality -> DefaultDirectionalityHistogram - morphology.skeletonize3D -> morphology.skeletonize, since it also handles 2D images; Skeletonize3D -> Skeletonize Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- segment.watershedExtendedMinima -> segment.extendedMinimaWatershed, matching the word order of the other watershed ops - labeling.maximumFeretDiameter -> labeling.maximumFeretsDiameter, matching geom.maximumFeretsDiameter - labeling.filter (labeling, values, min, max) -> labeling.filterByValue, matching labeling.filterBySize and friends; the predicate overload keeps the name labeling.filter Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- image.fastMarching -> image.fastMarchingTimes and image.levelSet -> image.levelSetFunction, so the scalar-field variants are told apart from segment.fastMarching and segment.levelSet by a suffix rather than by the namespace alone; DefaultLevelSet -> LevelSetFunction - transform.piv -> image.piv, since transform.* is for views and resampling; the transform.piv package moves to image.piv Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record in the class javadoc what users comparing results with the original plugins would hit: Landini colour deconvolution output and third-vector differences, the mcib3d Canny comparison, phase correlation choices (no window, regularized spectrum, Pearson subpixel fit), tensor eigenvalue orders and calibration padding, retinex channel handling, Helmholtz orientation convention, and the 2^31 pixel limits of the flat-array filters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…age ops Note the 2^31 pixel limit of the reconstruction and attribute filters, the memory cost of the box diagonal attribute, when grayscale fillHoles takes over binary images, MorphoLibJ differences (line discretization, label boundaries, region adjacency across watershed lines, geodesic diameter), the quadratic cost of labeling Feret diameters, the memory cost of quantile normalization, and how image.piv relates to Fiji's PIV_analyser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record the watershed line conventions versus image.watershed and hWatershed, the clean-room origin and size limit of graph cut, the clean-room origin of the level set ops, and the size limit of RATS; rewrap overlong javadoc lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GPL component's ContainedCount calls LabelFiltering directly, which compiles on the classpath but fails module-aware javadoc, since an open module grants only run-time access to unexported packages. The util package holds types and helpers meant for reuse, too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Besides reporting each component's version and license, these give the base packages a class, without which module-aware javadoc fails with "No source files for package" on a package with only package-info.java. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
List every op added on this branch with a link to the original plugin's source and its license, whether the op is a port, a clean-room reimplementation or a wrapper, and how closely its results match the plugin's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
b180397 to
0bf5384
Compare
This fixes a compilation error by declaring threshold op compute methods. Co-Authored-By: Copilot <copilot@github.com>
Written not at all by me 😅