public class Seeds extends ListMap<ij.process.ImageProcessor>
Seed type specifies type of object scribbled by user (RandomWalkSegmentation.SeedTypes
, seed map is an binary
image of size of scribbled (original) image where pixels selected by user are white.
Each seed map is stored as binary ImageProcessor but it is assumed that for one key
(RandomWalkSegmentation.SeedTypes
) there can be several separate seeds (e.g. for different objects that should
be treated separately). This is common case for e.g. RandomWalkSegmentation.SeedTypes.FOREGROUNDS
.
Internally each seed image is stored in ImageStack
structure, note that put
method does not verify is there is the same slice in stack already. Seed types other than
RandomWalkSegmentation.SeedTypes.FOREGROUNDS
usually have only one seed map associated, but it is also stored
in ImageStack
. One needs to take care about proper unwrapping data if standard
HashMap.get(Object)
is used.
Seed maps can be converted from various sources like RGB images or grayscale images but maps are always binary.
SeedProcessor
,
Serialized FormAbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
Seeds()
Default constructor.
|
Seeds(int initialCapacity)
Allow to set initial capacity.
|
Modifier and Type | Method and Description |
---|---|
List<List<Point>> |
convertToList(RandomWalkSegmentation.SeedTypes key)
Convert binary maps representing foregrounds and background seeds to lists of coordinates
(format accepted by
RandomWalkSegmentation.solver(Seeds, RealMatrix[]) ). |
ij.ImageStack |
convertToStack(RandomWalkSegmentation.SeedTypes key)
Convert seeds to ImageStack.
|
ij.process.ImageProcessor |
get(RandomWalkSegmentation.SeedTypes key,
int slice)
Retrieve specified seed map from specified key.
|
String |
toString() |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode
public Seeds()
public Seeds(int initialCapacity)
initialCapacity
- initial capacitypublic ij.process.ImageProcessor get(RandomWalkSegmentation.SeedTypes key, int slice)
key
- key to retrieveslice
- seed map number (starts from 1)public List<List<Point>> convertToList(RandomWalkSegmentation.SeedTypes key)
RandomWalkSegmentation.solver(Seeds, RealMatrix[])
).
Assumes that there can be more labels for each key (e.g. few objects labelled as foreground that will be treated separately). Each label for specified key is converted to list of points separately as well.
key
- which map to convertSeedProcessor.decodeSeedsfromRgb(ImagePlus, List, Color)
,
SeedProcessor.decodeSeedsfromRgb(ImageProcessor, List, Color)
public ij.ImageStack convertToStack(RandomWalkSegmentation.SeedTypes key)
key
- which map to convertpublic String toString()
toString
in class AbstractMap<RandomWalkSegmentation.SeedTypes,List<ij.process.ImageProcessor>>
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.