use of net.imagej.display.DatasetView in project imagej-plugins-commands by imagej.
the class ShowLUTAsTable method run.
// -- Command methods --
@Override
public void run() {
final DatasetView view = imgDispService.getActiveDatasetView(display);
final List<ColorTable> colorTables = view.getColorTables();
final Position planePos = view.getPlanePosition();
long pos = planePos.getIndex();
if (pos < 0 || pos >= colorTables.size())
pos = 0;
final ColorTable colorTable = colorTables.get((int) pos);
final int rowCount = colorTable.getLength();
final int componentCount = colorTable.getComponentCount();
final int colCount = componentCount + 1;
table = new DefaultResultsTable(colCount, rowCount);
table.setColumnHeader(0, "Index");
// use here.
for (int x = 0; x < componentCount; x++) {
table.setColumnHeader(x + 1, "CH" + x);
}
// fill in values
for (int y = 0; y < rowCount; y++) {
table.setValue(0, y, y);
for (int x = 0; x < componentCount; x++) {
final double value = colorTable.get(x, y);
table.setValue(x + 1, y, value);
}
}
}
use of net.imagej.display.DatasetView in project imagej-plugins-commands by imagej.
the class SquareRootDataValues method run.
// -- public interface --
@Override
public void run() {
Dataset dataset = imgDispService.getActiveDataset(display);
Overlay overlay = overlayService.getActiveOverlay(display);
DatasetView view = imgDispService.getActiveDatasetView(display);
final RealSqrt<DoubleType, DoubleType> op = new RealSqrt<DoubleType, DoubleType>();
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();
}
use of net.imagej.display.DatasetView in project imagej-plugins-commands by imagej.
the class LogDataValues method run.
// -- public interface --
@Override
public void run() {
Dataset dataset = imgDispService.getActiveDataset(display);
Overlay overlay = overlayService.getActiveOverlay(display);
DatasetView view = imgDispService.getActiveDatasetView(display);
final RealLog<DoubleType, DoubleType> op = new RealLog<DoubleType, DoubleType>();
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();
}
use of net.imagej.display.DatasetView in project imagej-plugins-commands by imagej.
the class ReciprocalDataValues method run.
// -- public interface --
@Override
public void run() {
Dataset dataset = imgDispService.getActiveDataset(display);
Overlay overlay = overlayService.getActiveOverlay(display);
DatasetView view = imgDispService.getActiveDatasetView(display);
final OptionsMisc optionsMisc = optionsService.getOptions(OptionsMisc.class);
final String dbzString = optionsMisc.getDivByZeroVal();
double dbzVal;
try {
dbzVal = Double.parseDouble(dbzString);
} catch (final NumberFormatException e) {
dbzVal = Double.POSITIVE_INFINITY;
}
final RealReciprocal<DoubleType, DoubleType> op = new RealReciprocal<DoubleType, DoubleType>(dbzVal);
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();
}
use of net.imagej.display.DatasetView in project imagej-plugins-commands by imagej.
the class SquareDataValues method run.
// -- public interface --
@Override
public void run() {
Dataset dataset = imgDispService.getActiveDataset(display);
Overlay overlay = overlayService.getActiveOverlay(display);
DatasetView view = imgDispService.getActiveDatasetView(display);
final RealSqr<DoubleType, DoubleType> op = new RealSqr<DoubleType, DoubleType>();
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