Class FilterHelper
Object
FilterHelper
Helper class for applying filters to
Channels and BinaryVoxels using ImageJ
operations.-
Method Summary
Modifier and TypeMethodDescriptionstatic ChannelapplyRankFilter(Channel channel, int radius, int filterType) Applies a 2D rank-filter to each slice independently of aChannel.static voidprocessEachSlice(Channel channel, Consumer<ij.process.ImageProcessor> consumer) Applies aConsumerto each slice independently of aChannel.static voidprocessEachSlice(BinaryVoxels<UnsignedByteBuffer> voxels, Consumer<ij.process.ImageProcessor> consumer)
-
Method Details
-
applyRankFilter
public static Channel applyRankFilter(Channel channel, int radius, int filterType) throws OperationFailedException Applies a 2D rank-filter to each slice independently of aChannel.- Parameters:
channel- the channel to apply the filter toradius- the radius of the filterfilterType- the type of rank filter to apply- Returns:
- the filtered channel
- Throws:
OperationFailedException- ifchannelcontains an unsupported data-type
-
processEachSlice
public static void processEachSlice(Channel channel, Consumer<ij.process.ImageProcessor> consumer) throws ImageJConversionException Applies aConsumerto each slice independently of aChannel.The slice is exposed as a
ImageProcessor.- Parameters:
channel- the channel whose slices will be processedconsumer- successively applied to theImageProcessorderived from each slice- Throws:
ImageJConversionException- if the voxels are neither unsigned byte nor unsigned short (the only two supported types)
-
processEachSlice
public static void processEachSlice(BinaryVoxels<UnsignedByteBuffer> voxels, Consumer<ij.process.ImageProcessor> consumer) Applies aConsumerto each slice independently of aBinaryVoxelswithUnsignedByteBuffer.The slice is exposed as a
ImageProcessor.- Parameters:
voxels- the voxels whose slices will be processedconsumer- successively applied to theImageProcessorderived from each slice
-