Search in sources :

Example 21 with DatasetInputImage

use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.

the class LabeledImage method snapshot.

/**
 * Returns an up to date {@link ImageLabelingModel}. But doesn't guarantee for
 * changes to be tracked, or to keep the reference.
 */
public ImageLabelingModel snapshot() {
    if (imageLabelingModel != null)
        return imageLabelingModel;
    DatasetInputImage inputImage = openInputImage();
    inputImage.setDefaultLabelingFilename(modifiedLabelingFile);
    Labeling labeling = openOrEmptyLabeling(storedIn.get(), inputImage.imageForSegmentation());
    ImageLabelingModel imageLabelingModel = new ImageLabelingModel(inputImage);
    imageLabelingModel.labeling().set(labeling);
    return imageLabelingModel;
}
Also used : ImageLabelingModel(sc.fiji.labkit.ui.models.ImageLabelingModel) DatasetInputImage(sc.fiji.labkit.ui.inputimage.DatasetInputImage) Labeling(sc.fiji.labkit.ui.labeling.Labeling)

Example 22 with DatasetInputImage

use of sc.fiji.labkit.ui.inputimage.DatasetInputImage 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)

Example 23 with DatasetInputImage

use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.

the class MultiChannelMovieDemo method main1.

private static void main1() {
    byte[] pixels = { -1, -1, -1, -1, 0, 0, 0, 0, -1, 0, -1, 0, -1, 0, -1, 0 };
    ArrayImg<UnsignedByteType, ByteArray> image = ArrayImgs.unsignedBytes(pixels, 2, 2, 2, 2);
    assertEquals(16, pixels.length);
    AxisType[] axes = { Axes.X, Axes.Y, Axes.Z, Axes.CHANNEL };
    DatasetInputImage inputImage = new DatasetInputImage(new ImgPlus<>(image, "", axes), BdvShowable.wrap(Views.hyperSlice(image, 3, 0)));
    LabkitFrame.showForImage(new Context(), inputImage);
}
Also used : Context(org.scijava.Context) DatasetInputImage(sc.fiji.labkit.ui.inputimage.DatasetInputImage) UnsignedByteType(net.imglib2.type.numeric.integer.UnsignedByteType) ByteArray(net.imglib2.img.basictypeaccess.array.ByteArray) AxisType(net.imagej.axis.AxisType)

Example 24 with DatasetInputImage

use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.

the class MultiChannelMovieDemo method inputImage5d.

private static DatasetInputImage inputImage5d() {
    Img<UnsignedByteType> image = image5d();
    AxisType[] axes = { Axes.X, Axes.Y, Axes.Z, Axes.CHANNEL, Axes.TIME };
    DatasetInputImage inputImage = new DatasetInputImage(new ImgPlus<>(image, "title", axes), BdvShowable.wrap(Views.hyperSlice(image, 3, 0)));
    return inputImage;
}
Also used : DatasetInputImage(sc.fiji.labkit.ui.inputimage.DatasetInputImage) UnsignedByteType(net.imglib2.type.numeric.integer.UnsignedByteType) AxisType(net.imagej.axis.AxisType)

Example 25 with DatasetInputImage

use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.

the class CustomSegmenterDemo method main.

public static void main(String... args) {
    LegacyInjector.preinit();
    Img<? extends NumericType<?>> image = ImageJFunctions.wrap(new ImagePlus("https://imagej.nih.gov/ij/images/AuPbSn40-2.jpg"));
    LabkitFrame.showForImage(null, new DatasetInputImage(image));
}
Also used : DatasetInputImage(sc.fiji.labkit.ui.inputimage.DatasetInputImage) ImagePlus(ij.ImagePlus)

Aggregations

DatasetInputImage (sc.fiji.labkit.ui.inputimage.DatasetInputImage)25 Context (org.scijava.Context)10 Test (org.junit.Test)7 UnsignedByteType (net.imglib2.type.numeric.integer.UnsignedByteType)6 ImagePlus (ij.ImagePlus)5 DefaultSegmentationModel (sc.fiji.labkit.ui.models.DefaultSegmentationModel)5 ShortType (net.imglib2.type.numeric.integer.ShortType)4 ValuePair (net.imglib2.util.ValuePair)4 Labeling (sc.fiji.labkit.ui.labeling.Labeling)4 ImageLabelingModel (sc.fiji.labkit.ui.models.ImageLabelingModel)4 SegmentationModel (sc.fiji.labkit.ui.models.SegmentationModel)4 ImgPlus (net.imagej.ImgPlus)3 AxisType (net.imagej.axis.AxisType)3 SegmentationItem (sc.fiji.labkit.ui.models.SegmentationItem)3 File (java.io.File)2 IOException (java.io.IOException)2 ARGBType (net.imglib2.type.numeric.ARGBType)2 ProgressWriter (bdv.export.ProgressWriter)1 ProgressWriterConsole (bdv.export.ProgressWriterConsole)1 AbstractSource (bdv.util.AbstractSource)1