use of net.imagej.options.OptionsCompatibility in project imagej-plugins-commands by imagej.
the class InvertDataValues method run.
// -- public interface --
@Override
public void run() {
Dataset dataset = imgDispService.getActiveDataset(display);
Overlay overlay = overlayService.getActiveOverlay(display);
DatasetView view = imgDispService.getActiveDatasetView(display);
OptionsCompatibility options = optionsService.getOptions(OptionsCompatibility.class);
if (options.isInvertModeLegacy() && dataset.isInteger() && !dataset.isSigned() && dataset.getType().getBitsPerPixel() == 8) {
min = 0;
max = 255;
} else
calcValueRange(dataset);
final RealInvert<DoubleType, DoubleType> op = new RealInvert<DoubleType, DoubleType>(min, max);
final InplaceUnaryTransform<T, DoubleType> transform;
if (allPlanes)
transform = new InplaceUnaryTransform<T, DoubleType>(op, new DoubleType(), dataset, overlay);
else
transform = new InplaceUnaryTransform<T, DoubleType>(op, new DoubleType(), dataset, overlay, view.getPlanePosition());
transform.run();
}
Aggregations