Class BinaryKernelMorphological
Object
Kernel
BinaryKernel
BinaryKernelMorphological
- Direct Known Subclasses:
DilationKernel,ErosionKernel,OutlineKernelBase
A parent class for any
BinaryKernel that implements a morphological operation.- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBinaryKernelMorphological(boolean bigNeighborhood, boolean unqualifiedOutcome, boolean failedFirstCheckOutcome) Creates with a flag for big-neighborhood, and boolean outcomes for certain cases. -
Method Summary
Modifier and TypeMethodDescriptionbooleancalculateAt(KernelPointCursor point) Calculates the boolean at a particular point.protected abstract booleandoesNeighborQualify(boolean inside, KernelPointCursor point, Supplier<UnsignedByteBuffer> buffer, int zShift) Does a particular neighboring-point satisfy the conditions.protected abstract booleanfirstCheck(KernelPointCursor point, UnsignedByteBuffer buffer) The first check done on the kernel center-point, before checking any neighbors.voidnotifyBuffer(LocalSlices slices, int sliceIndex) Called to inform theKernelof buffers that are currently being processed.
-
Constructor Details
-
BinaryKernelMorphological
protected BinaryKernelMorphological(boolean bigNeighborhood, boolean unqualifiedOutcome, boolean failedFirstCheckOutcome) Creates with a flag for big-neighborhood, and boolean outcomes for certain cases.- Parameters:
bigNeighborhood- if true, a big neighborhood is used 2D-plane (8-connected instead of 4-connected), but not in Z-direction (remains always 2-connected).unqualifiedOutcome- the (negative) outcome that occurs if no neighbor qualifies (satisfies a condition). The positive outcome is assumed to be the complement of this.failedFirstCheckOutcome- if the first-check fails, this outcome is returned.
-
-
Method Details
-
notifyBuffer
Description copied from class:KernelCalled to inform theKernelof buffers that are currently being processed.Only a single z-slice is processed at a particular time.
This should be repeatedly called each time the focus changes to a different z-slice.
- Specified by:
notifyBufferin classKernel- Parameters:
slices- slices that can be processed by the kernel, localized to a current local area of focus.sliceIndex- the global z-index of the slice that is currently the focus of the kernel.
-
calculateAt
Description copied from class:BinaryKernelCalculates the boolean at a particular point.- Specified by:
calculateAtin classBinaryKernel- Parameters:
point- the point.- Returns:
- the boolean result at this point.
-
firstCheck
The first check done on the kernel center-point, before checking any neighbors.- Parameters:
point- a kernel focused on a particular point.buffer- the associated buffer.- Returns:
- true if the check passed, and false otherwise.
-
doesNeighborQualify
protected abstract boolean doesNeighborQualify(boolean inside, KernelPointCursor point, Supplier<UnsignedByteBuffer> buffer, int zShift) Does a particular neighboring-point satisfy the conditions.- Parameters:
inside- true iff the neighboring-point is inside the scene.point- the point.buffer- the associated buffer.zShift- the buffer associated with the current point.- Returns:
- true if the neighboring-point satisfied the conditions.
-