本文整理汇总了Java中net.imagej.axis.LinearAxis类的典型用法代码示例。如果您正苦于以下问题:Java LinearAxis类的具体用法?Java LinearAxis怎么用?Java LinearAxis使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinearAxis类属于net.imagej.axis包,在下文中一共展示了LinearAxis类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calibrate
import net.imagej.axis.LinearAxis; //导入依赖的package包/类
/**
* Applies the given scale and origin to the provided {@link CalibratedAxis} ,
* if it is a {@link LinearAxis}.
*
* @throws IllegalArgumentException if the axis is not a {@link LinearAxis}.
*/
public static void calibrate(final CalibratedAxis axis, final double scale,
final double origin)
{
if (!(axis instanceof LinearAxis)) {
throw new IllegalArgumentException("Not a linear axis: " + axis);
}
final LinearAxis linearAxis = (LinearAxis) axis;
linearAxis.setScale(scale);
linearAxis.setOrigin(origin);
}
示例2: populateImageMetadata
import net.imagej.axis.LinearAxis; //导入依赖的package包/类
@Override
public void populateImageMetadata() {
// TODO: Consider whether this check is really the right approach.
// It is present because otherwise, the uninitialized format-specific
// metadata fields overwrite the values populated by the ImgSaver.
if (getImageCount() > 0) return; // already populated
// construct dimensional axes
final LinearAxis xAxis = axis(Axes.X, physSizeX);
final LinearAxis yAxis = axis(Axes.Y, physSizeY);
final LinearAxis zAxis = axis(Axes.Z, physSizeZ);
final LinearAxis cAxis = axis(Axes.CHANNEL, waveStart, waveIncrement);
final LinearAxis tAxis = axis(Axes.TIME, timeIncrement);
// HACK: Do things in XYCZT order for ImageJ1 compatibility.
// Technically, this _shouldn't_ matter because imagej-legacy
// should take care of dimension swapping incompatible orderings.
// But for now, this sidesteps the issue.
final CalibratedAxis[] axes = { xAxis, yAxis, cAxis, zAxis, tAxis };
final long[] axisLengths = { sizeX, sizeY, sizeC, sizeZ, sizeT };
// obtain pixel type
final int pixType = FormatTools.pixelTypeFromString(pixelType);
// populate SCIFIO ImageMetadata
createImageMetadata(1);
final ImageMetadata imageMeta = get(0);
imageMeta.setName(name);
imageMeta.setAxes(axes, axisLengths);
imageMeta.setPixelType(pixType);
imageMeta.setMetadataComplete(true);
imageMeta.setOrderCertain(true);
}
示例3: calibrate
import net.imagej.axis.LinearAxis; //导入依赖的package包/类
private static void calibrate(final LinearAxis axis, final Number origin,
final Number scale, final String unit)
{
if (origin != null) axis.setOrigin(origin.doubleValue());
if (scale != null) axis.setScale(scale.doubleValue());
if (unit != null) axis.setUnit(unit);
}
示例4: axisStream
import net.imagej.axis.LinearAxis; //导入依赖的package包/类
/**
* Checks if the given space has any non-linear spatial dimensions.
*
* @param space an N-dimensional space.
* @param <S> type of the space.
* @param <A> type of axes in the space.
* @return true if there are any power, logarithmic or other non-linear axes.
*/
//TODO is this really necessary?
public static <S extends AnnotatedSpace<A>, A extends TypedAxis> boolean
hasNonLinearSpatialAxes(final S space)
{
return axisStream(space).anyMatch(a -> !(a instanceof LinearAxis) && a
.type().isSpatial());
}