Repository navigation
Conversation
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>
Port the Statistical Region Merging algorithm of Nock & Nielsen (IEEE TPAMI 26(11):1452-1458, 2004) from the SRM_ plugin of Fiji's Statistical_Region_Merging project (Copyright 2009-2013 Johannes Schindelin, BSD-2-Clause), generalized from 8-bit 2D/3D images to n-D images of any RealType: intensities are mapped linearly from the image's value range onto [0, g-1], and only the neighbor-pair ordering is quantized into g buckets. Two signatures are provided: a Function producing an ImgLabeling of the regions, and a Computer writing the region means (the plugin's "showAverages" output). Both take optional Q (default 25) and g (default 256). On full-range 8-bit inputs, results match the original plugin exactly (regression values produced from SRM_ itself). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port of the local thickness pipeline (distance ridge, local thickness, clean-up) from the Fiji LocalThickness project, originally written by Bob Dougherty (Copyright (c) 2006-2007 OptiNav, Inc., BSD-3-Clause). Only the OptiNav BSD-licensed algorithm code was used; the GPL-only Fiji wrapper/masking classes and later GPL optimisations were not. The Saito-Toriwaki EDT is replaced by the existing morphology.distanceTransform op. The algorithm is generalized to n-D and to anisotropic calibration. With unit calibration, results match the original plugins voxel for voxel. Reference: Hildebrand & Rüegsegger, J. Microsc. 185(1):67-75 (1997). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Watershed seeded by h-maxima: the image is flooded from its regional maxima, building a hierarchy of peaks annotated with their dynamics, which is then cut by seed dynamics (hMin), intensity threshold and peak flooding percentage, optionally splitting off peaks isolated by the threshold. The result is an ImgLabeling. Ported from the Interactive H-Watershed Fiji plugin by Benoit Lombardot (Scientific Computing Facility, MPI-CBG), BSD-3-Clause; the original copyright notice is retained in the derived sources. Unlike the original, intensities are not truncated to integers (the hierarchical FIFO queue becomes an equivalent priority queue) and any number of dimensions is supported. Regression tests compare against output of the original classes on integer-valued synthetic 2D and 3D images. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Integer-factor block downsampling with mean, sum, min, max, median or mode reduction, as in ImageJ's Image > Transform > Bin and VIB's Resample_ plugin. Implemented fresh (VIB is GPL); incomplete edge blocks are dropped, and results are rounded and clamped for integer types. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wraps ImgLib2's LocalExtrema (BSD-2) to find non-strict local maxima or minima, with optional neighborhood shape and threshold. Border pixels are candidates (border-replicated extension). The function returns a sorted List<Point>; the computer fills a binary mask. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wraps ImgLib2's DogDetection (BSD-2) to detect bright or dark blobs at scale sigma (second scale sigma * 2^(1/4)), with a threshold on the normalized DoG response and optional subpixel refinement via SubpixelLocalization. This is the detector core of Descriptor-based registration and TrackMate (Lowe, IJCV 2004). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapted from the KymographBuilder Fiji plugin by Hadrien Mary (MIT). Samples a time series along an imglib2-roi Polyline at unit arc-length steps, with optional line width reduced by max, mean or none, and n-linear or nearest-neighbor interpolation. Unlike the original, row 0 and column 0 are sampled (fixing its x > 0 && y > 0 bounds check), and all non-spatial, non-time dimensions are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the org.scijava.ops.image.filter.tensor package with: * filter.hessianEigenvalues (n-D, sorted by magnitude, optional sigma² scale normalization) * filter.structureTensor and filter.structureTensorEigenvalues (n-D) * filter.shapeIndex (2D; Koenderink & van Doorn 1992, sign convention of Fiji's Shape_Index_Map) * filter.surfaceness (3D; sheet measure of Sato et al. 2000, instead of the degenerate VIB Surfaceness ratio) * filter.orientation and filter.coherency (2D; OrientationJ semantics, implemented from Rezakhaniha et al. 2012 and Püspöki et al. 2016) * filter.harris (n-D; det - k·traceⁿ, Harris & Stephens 1988, without the determinant bug of VIB's Harris_Corner_Detector) Eigenvalues use imglib2-algorithm's TensorEigenValues. The structure tensor follows labkit-pixel-classification (Matthias Arzt, BSD-2). GPL sources (VIB, OrientationJ, Trainable Segmentation) were used only as behavioral references. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Corrects uneven illumination by dividing by a Gaussian-blurred copy of the image and rescaling by the mean of that background estimate. Translated from the Pseudo_flat_field_correction plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause), generalized to n-D and floating-point arithmetic. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Computes (in - dark) / (flat - dark) * mean(flat - dark), with the dark-field image optional. Based on the "Flat-field correction" macro of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause); the dark-field term is an addition to the original. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Estimates the background with a large Gaussian, median or mean filter, dilates it slightly with a maximum filter, and subtracts it. Translated from the Convoluted_Background_Subtraction plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause), generalized to n-D with hypersphere rank-filter neighborhoods. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An n-D weighted median filter over an arbitrary non-negative weight kernel; with uniform weights it reduces to the ordinary median filter. It is the building block for filter.gaussianWeightedMedian. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A weighted median whose weights are exp(-d^2 / 2 sigma^2) over a hyperspherical neighborhood, built on filter.weightedMedian. Inspired by the Gaussian_Weighted_Median plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel. Because that file carries a GPL-3 header, this op was implemented independently from the general definition of a Gaussian-weighted median rather than translated from its source. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements the Miles-Lantuejoul edge correction for object counts in a bounded field of view: border-touching labels are excluded and every remaining label is weighted by prod_d W_d / (W_d - w_d). The weights are also exposed as labeling.edgeCorrectionWeights, for edge-corrected statistics of any per-object measurement. Based on the "Field-of-view measure correction" (CountCorrection) macro of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause), generalized from 2D to n-D. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
labeling.nearestNeighborDistances maps each label to the distance from its centroid to the nearest other centroid (via a KD-tree). labeling.clarkEvans computes the Clark-Evans aggregation index R with its z-score and two-sided p-value against complete spatial randomness, generalized to n-D via the Poisson nearest-neighbor distribution. Inspired by the Particle_Distribution2D and Distribution_Analysis plugins of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause); the statistics follow Clark & Evans, Ecology 35(4):445-453, 1954, rather than the plugins' tabulated F/t tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ratio of a shape's size to that of its axis-aligned bounding box, for 2D polygons and for n-D regions such as LabelRegions. Based on the "Extent" shape descriptor of the Extended_Particle_Analyzer plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause), generalized to n-D regions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sqrt(4 A / pi) / major axis: the diameter of the equal-area circle relative to the major axis of the fitted ellipse. Based on the "Compactness" shape descriptor of the Extended_Particle_Analyzer plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ratio of the maximum to the minimum Feret diameter of a polygon. Based on the "Feret aspect ratio" (FAR) shape descriptor of the Extended_Particle_Analyzer plugin of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paints a per-label value (any measurement, given as a Map from label to number) into an image, with a configurable background value; pixels with several labels get the mean of their values. Based on the "Shape Descriptor Maps" macro of the BioVoxxel Toolbox by Jan Brocher / BioVoxxel (BSD-3-Clause), generalized to any per-label value in n-D. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # 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.
A home for image processing ops translated from GPL-licensed ImageJ and Fiji plugins whose algorithms cannot practically be reimplemented from their published descriptions, keeping scijava-ops-image BSD-2 licensed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A home for image processing ops translated from LGPL-licensed ImageJ and Fiji plugins (e.g. MorphoLibJ) whose algorithms cannot practically be reimplemented from their published descriptions. Keeping them separate from scijava-ops-image-gpl lets downstream projects depend on them without GPL obligations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hough transform for circles and n-dimensional spheres: each foreground pixel of a binary image votes for all centers at each tested radius, yielding an (n+1)-dimensional vote image whose last axis indexes radii. Ported from HoughTransformOp of CircleSkinner by Jean-Yves Tinevez (https://github.com/tinevez/CircleSkinner, BSD-2-Clause), generalizing its 2D midpoint-circle voting to n-D discrete spherical shells. Reference: Duda and Hart, Commun. ACM 15(1):11-15, 1972. 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>
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. |
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>
|
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> |
Written not at all by me 😅