当前位置: 首页>>代码示例>>Java>>正文


Java LinearAxis类代码示例

本文整理汇总了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);
}
 
开发者ID:scifio,项目名称:scifio,代码行数:17,代码来源:FormatTools.java

示例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);
}
 
开发者ID:imagej,项目名称:imagej-omero,代码行数:33,代码来源:OMEROFormat.java

示例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);
}
 
开发者ID:imagej,项目名称:imagej-omero,代码行数:8,代码来源:OMEROFormat.java

示例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());
}
 
开发者ID:bonej-org,项目名称:BoneJ2,代码行数:16,代码来源:AxisUtils.java


注:本文中的net.imagej.axis.LinearAxis类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。