當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。