Search in sources :

Example 1 with Holder

use of sc.fiji.labkit.ui.models.Holder in project labkit-ui by juglab.

the class SegmentationAsLabelAction method addLabel.

private void addLabel(String selected, int index, RandomAccessibleInterval<ShortType> segmentation) {
    Converter<ShortType, BitType> converter = (in, out) -> out.set(in.get() == index);
    RandomAccessibleInterval<BitType> result = Converters.convert(segmentation, converter, new BitType());
    Holder<Labeling> labelingHolder = labelingModel.labeling();
    addLabel(labelingHolder.get(), "segmented " + selected, result);
    labelingHolder.notifier().notifyListeners();
}
Also used : BitType(net.imglib2.type.logic.BitType) RandomAccess(net.imglib2.RandomAccess) Converter(net.imglib2.converter.Converter) List(java.util.List) Cursor(net.imglib2.Cursor) MenuBar(sc.fiji.labkit.ui.MenuBar) RandomAccessibleInterval(net.imglib2.RandomAccessibleInterval) Labeling(sc.fiji.labkit.ui.labeling.Labeling) LabelingType(net.imglib2.roi.labeling.LabelingType) ImageLabelingModel(sc.fiji.labkit.ui.models.ImageLabelingModel) SegmentationItem(sc.fiji.labkit.ui.models.SegmentationItem) Converters(net.imglib2.converter.Converters) Extensible(sc.fiji.labkit.ui.Extensible) Label(sc.fiji.labkit.ui.labeling.Label) SegmentationResultsModel(sc.fiji.labkit.ui.models.SegmentationResultsModel) Holder(sc.fiji.labkit.ui.models.Holder) ShortType(net.imglib2.type.numeric.integer.ShortType) SegmentationModel(sc.fiji.labkit.ui.models.SegmentationModel) Views(net.imglib2.view.Views) javax.swing(javax.swing) BitType(net.imglib2.type.logic.BitType) ShortType(net.imglib2.type.numeric.integer.ShortType) Labeling(sc.fiji.labkit.ui.labeling.Labeling)

Aggregations

List (java.util.List)1 javax.swing (javax.swing)1 Cursor (net.imglib2.Cursor)1 RandomAccess (net.imglib2.RandomAccess)1 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)1 Converter (net.imglib2.converter.Converter)1 Converters (net.imglib2.converter.Converters)1 LabelingType (net.imglib2.roi.labeling.LabelingType)1 BitType (net.imglib2.type.logic.BitType)1 ShortType (net.imglib2.type.numeric.integer.ShortType)1 Views (net.imglib2.view.Views)1 Extensible (sc.fiji.labkit.ui.Extensible)1 MenuBar (sc.fiji.labkit.ui.MenuBar)1 Label (sc.fiji.labkit.ui.labeling.Label)1 Labeling (sc.fiji.labkit.ui.labeling.Labeling)1 Holder (sc.fiji.labkit.ui.models.Holder)1 ImageLabelingModel (sc.fiji.labkit.ui.models.ImageLabelingModel)1 SegmentationItem (sc.fiji.labkit.ui.models.SegmentationItem)1 SegmentationModel (sc.fiji.labkit.ui.models.SegmentationModel)1 SegmentationResultsModel (sc.fiji.labkit.ui.models.SegmentationResultsModel)1