Search in sources :

Example 6 with DefaultSegmentationModel

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

the class LabkitFrame method showForImage.

public static LabkitFrame showForImage(Context context, final InputImage inputImage) {
    if (context == null)
        context = SingletonContext.getInstance();
    final SegmentationModel model = new DefaultSegmentationModel(context, inputImage);
    model.imageLabelingModel().labeling().set(InitialLabeling.initialLabeling(context, inputImage));
    return show(model, inputImage.imageForSegmentation().getName());
}
Also used : DefaultSegmentationModel(sc.fiji.labkit.ui.models.DefaultSegmentationModel) DefaultSegmentationModel(sc.fiji.labkit.ui.models.DefaultSegmentationModel) SegmentationModel(sc.fiji.labkit.ui.models.SegmentationModel)

Example 7 with DefaultSegmentationModel

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

the class CustomizedSegmentationComponentDemo method main.

public static void main(String... args) {
    JFrame frame = new JFrame("Labkit UI Customization Demo");
    ImgPlus<?> image = VirtualStackAdapter.wrap(new ImagePlus("https://imagej.nih.gov/ij/images/t1-head.zip"));
    DefaultSegmentationModel segmentationModel = new DefaultSegmentationModel(new Context(), new DatasetInputImage(image));
    CustomizedSegmentationComponentDemo component = new CustomizedSegmentationComponentDemo(frame, segmentationModel);
    component.autoContrast();
    frame.setJMenuBar(component.getMenuBar());
    frame.add(component);
    frame.setSize(800, 500);
    frame.setVisible(true);
}
Also used : Context(org.scijava.Context) DefaultSegmentationModel(sc.fiji.labkit.ui.models.DefaultSegmentationModel) JFrame(javax.swing.JFrame) DatasetInputImage(sc.fiji.labkit.ui.inputimage.DatasetInputImage) ImagePlus(ij.ImagePlus)

Aggregations

DefaultSegmentationModel (sc.fiji.labkit.ui.models.DefaultSegmentationModel)7 DatasetInputImage (sc.fiji.labkit.ui.inputimage.DatasetInputImage)6 Context (org.scijava.Context)5 SegmentationModel (sc.fiji.labkit.ui.models.SegmentationModel)5 ShortType (net.imglib2.type.numeric.integer.ShortType)3 ValuePair (net.imglib2.util.ValuePair)3 Test (org.junit.Test)3 SegmentationItem (sc.fiji.labkit.ui.models.SegmentationItem)3 ImgPlus (net.imagej.ImgPlus)2 UnsignedByteType (net.imglib2.type.numeric.integer.UnsignedByteType)2 Labeling (sc.fiji.labkit.ui.labeling.Labeling)2 ImagePlus (ij.ImagePlus)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1 ArrayList (java.util.ArrayList)1 JFrame (javax.swing.JFrame)1 FinalInterval (net.imglib2.FinalInterval)1 InputImage (sc.fiji.labkit.ui.inputimage.InputImage)1 ImageLabelingModel (sc.fiji.labkit.ui.models.ImageLabelingModel)1 SegmenterListModel (sc.fiji.labkit.ui.models.SegmenterListModel)1