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;
}
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);
}
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);
}
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;
}
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));
}
Aggregations