use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.
the class ImageLabelingModelTest method testChangeLabelingInterval.
@Test
public void testChangeLabelingInterval() {
Img<UnsignedByteType> image = ArrayImgs.unsignedBytes(8, 8);
ImageLabelingModel model = new ImageLabelingModel(new DatasetInputImage(image));
model.labeling().set(initLabeling(4, 4));
AffineTransform3D labelTransformation = model.labelTransformation();
assertArrayEquals(expectedTransform(2.0), labelTransformation.getRowPackedCopy(), 0.0);
// process
model.labeling().set(initLabeling(2, 2));
assertArrayEquals(expectedTransform(4.0), labelTransformation.getRowPackedCopy(), 0.0);
}
use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.
the class CziOpener method openInputImage.
private DatasetInputImage openInputImage(String filename, String labelingFilename, int fullres, int series) {
ImgPlus<ARGBType> image = Parallelization.runMultiThreaded(() -> openImage(filename, fullres, series));
DatasetInputImage result = new DatasetInputImage(image);
result.setDefaultLabelingFilename(labelingFilename);
return result;
}
use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.
the class CziOpener method openResolutionPyramid.
private static DatasetInputImage openResolutionPyramid(String filename, String labelingFilename, List<Integer> selectedSectionIndices) {
int fullres = selectedSectionIndices.get(0);
List<ImgPlus<ARGBType>> pyramid = selectedSectionIndices.stream().map(series -> openCachedImage(filename, fullres, series)).collect(Collectors.toList());
AbstractSource<ARGBType> source = new ResolutionPyramidSource<>(pyramid, new ARGBType(), "source");
BdvShowable showable = BdvShowable.wrap(source);
ImgPlus<? extends NumericType<?>> imageForSegmentation = pyramid.get(2);
imageForSegmentation.setSource(filename);
DatasetInputImage result = new DatasetInputImage(imageForSegmentation, showable);
result.setDefaultLabelingFilename(labelingFilename);
return result;
}
use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.
the class LabkitPlugin method run.
@Override
public void run() {
DatasetInputImage input = new DatasetInputImage(dataset);
LabkitFrame.showForImage(context, input);
}
use of sc.fiji.labkit.ui.inputimage.DatasetInputImage in project labkit-ui by juglab.
the class LabeledImage method openInputImage.
private DatasetInputImage openInputImage() {
try {
DatasetIOService datasetIOService = context.service(DatasetIOService.class);
Dataset dataset = datasetIOService.open(imageFile);
return new DatasetInputImage(dataset);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations