Search in sources :

Example 26 with Labeling

use of sc.fiji.labkit.ui.labeling.Labeling in project labkit-ui by juglab.

the class BitmapImportExportAction method importLabel.

private void importLabel(Void ignore, String filename) throws IOException {
    RandomAccessibleInterval<RealType<?>> image = datasetIOService.open(filename);
    Labeling labeling = model.labeling().get();
    if (!Intervals.equals(image, labeling))
        JOptionPane.showMessageDialog(extensible.dialogParent(), "The resolution of the image does not fit", "Import Label", JOptionPane.ERROR_MESSAGE);
    labeling.addLabel("Label \"" + new File(filename).getName() + "\"", toBoolType(image));
    model.labeling().notifier().notifyListeners();
}
Also used : Labeling(sc.fiji.labkit.ui.labeling.Labeling) RealType(net.imglib2.type.numeric.RealType) File(java.io.File)

Aggregations

Labeling (sc.fiji.labkit.ui.labeling.Labeling)26 LabelingType (net.imglib2.roi.labeling.LabelingType)8 Label (sc.fiji.labkit.ui.labeling.Label)8 FinalInterval (net.imglib2.FinalInterval)7 BitType (net.imglib2.type.logic.BitType)7 Test (org.junit.Test)7 Context (org.scijava.Context)7 ImgPlus (net.imagej.ImgPlus)6 Interval (net.imglib2.Interval)6 Cursor (net.imglib2.Cursor)5 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)5 DatasetInputImage (sc.fiji.labkit.ui.inputimage.DatasetInputImage)5 File (java.io.File)4 List (java.util.List)4 Intervals (net.imglib2.util.Intervals)4 ValuePair (net.imglib2.util.ValuePair)4 Views (net.imglib2.view.Views)4 ArrayList (java.util.ArrayList)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3