public class SeedProcessor extends Object
Constructor and Description |
---|
SeedProcessor() |
Modifier and Type | Method and Description |
---|---|
static Seeds |
decodeSeedsfromGrayscaleImage(ij.process.ImageProcessor im)
Convert grayscale image to
Seeds . |
static Seeds |
decodeSeedsfromRgb(ij.ImagePlus rgb,
List<Color> fseed,
Color bseed)
Decode RGB seed images to separate binary images.
|
static Seeds |
decodeSeedsfromRgb(ij.process.ImageProcessor rgb,
List<Color> fseed,
Color bseed)
Decode RGB seed images to separate binary images.
|
static Seeds |
decodeSeedsfromRoi(List<Roi> rois,
String fgName,
String bgName,
int width,
int height)
Decode seeds from list of ROIs objects.
|
static List<Seeds> |
decodeSeedsfromRoiStack(List<Roi> rois,
String fgName,
String bgName,
int width,
int height,
int slices)
Convert list of ROIs to binary images separately for each ROI.
|
static ij.process.ImageProcessor |
flatten(Seeds seeds,
RandomWalkSegmentation.SeedTypes type,
int initialValue)
Flatten seeds of specified type and output grayscale image.
|
static ij.process.ImageProcessor |
seedsToGrayscaleImage(Seeds seeds)
Convert the whole
Seeds object into one-slice grayscale image. |
static void |
validateSeeds(Seeds seeds,
RandomWalkSegmentation.SeedTypes type)
Validate if at least one map in specified seed type contains non-zero pixel.
|
public static Seeds decodeSeedsfromRgb(ij.process.ImageProcessor rgb, List<Color> fseed, Color bseed) throws RandomWalkException
Seeded RGB image is decomposed to separated binary images that contain only seeds. E.g. FOREGROUND image will have only pixels that were labelled as foreground. Decomposition is performed with respect to provided label colours.
rgb
- original imagefseed
- foreground seed imagebseed
- background seed imageRandomWalkException
- on problems with decoding, unsupported image or empty list.
Exception is thrown only when all seed images for key are emptydecodeSeedsfromRgb(ImagePlus, List, Color)
public static Seeds decodeSeedsfromRgb(ij.ImagePlus rgb, List<Color> fseed, Color bseed) throws RandomWalkException
Seeded RGB image is decomposed to separated binary images that contain only seeds. E.g. FOREGROUND image will have only pixels that were labelled as foreground. Decomposition is performed with respect to provided label colours.
rgb
- RGB seed imagefseed
- color of marker for foreground pixelsbseed
- color of marker for background pixelsRandomWalkException
- When image other that RGB provideddecodeSeedsfromRgb(ImageProcessor, List, Color)
public static void validateSeeds(Seeds seeds, RandomWalkSegmentation.SeedTypes type) throws RandomWalkException
seeds
- seeds to verifytype
- seed typeRandomWalkException
- when all maps under specified key are empty (black). Allows for
empty maps or nonexisting keyspublic static Seeds decodeSeedsfromRoi(List<Roi> rois, String fgName, String bgName, int width, int height) throws RandomWalkException
ROIs naming must comply with the following pattern: coreID_NO, where core is different for FG and BG objects, ID is the id of object and NO is its number unique within ID (one object can ba labelled by several separated ROIs). All ROIs must have name set otherwise NullPointException is thrown.
rois
- list of ROIs with namesfgName
- core for FG ROI namebgName
- core for BG core namewidth
- width of output mapheight
- height of output mapRandomWalkException
- when all seeds are empty (but maps exist)public static ij.process.ImageProcessor seedsToGrayscaleImage(Seeds seeds)
Seeds
object into one-slice grayscale image. Background map has
maximum intensity.
If there is more than one BG map it is not possible to find which of last colours are they.
seeds
- seeds to convertSeedProcessor#flatten(Seeds, SeedTypes, int)
public static ij.process.ImageProcessor flatten(Seeds seeds, RandomWalkSegmentation.SeedTypes type, int initialValue)
seeds
- seeds to flattentype
- which mapinitialValue
- brightness value to start from (typically 1)seedsToGrayscaleImage(Seeds)
public static Seeds decodeSeedsfromGrayscaleImage(ij.process.ImageProcessor im) throws RandomWalkException
Seeds
.
Pixels with the same intensity are collected in one map at Seeds
structure under
RandomWalkSegmentation.SeedTypes.FOREGROUNDS
key. Works for separated objects as
well. Collected maps are binary.
im
- 8-bit grayscale image, 0 is backgroundRandomWalkSegmentation.SeedTypes.FOREGROUNDS
filled. No RandomWalkSegmentation.SeedTypes.BACKGROUND
RandomWalkException
- when all output FG seed maps are emptypublic static List<Seeds> decodeSeedsfromRoiStack(List<Roi> rois, String fgName, String bgName, int width, int height, int slices) throws RandomWalkException
Assumes that ROIs are named: fgNameID_NO, where ID belongs to the same object and NO are
different scribbles for it. Similar to
decodeSeedsfromRoi(List, String, String, int, int)
but process each slice separately.
rois
- rois to process.fgName
- core for FG ROI namebgName
- core for BG core namewidth
- width of output mapheight
- height of output mapslices
- number of slicesRandomWalkException
- when all seeds are empty (but maps exist)decodeSeedsfromRoi(List, String, String, int, int)
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.