本文整理汇总了Java中net.imagej.axis.CalibratedAxis.type方法的典型用法代码示例。如果您正苦于以下问题:Java CalibratedAxis.type方法的具体用法?Java CalibratedAxis.type怎么用?Java CalibratedAxis.type使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imagej.axis.CalibratedAxis
的用法示例。
在下文中一共展示了CalibratedAxis.type方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: axesToSplit
import net.imagej.axis.CalibratedAxis; //导入方法依赖的package包/类
/**
* Returns a list of all AxisTypes that should be split out. This is a list of
* all non-X,Y planar axes. Always tries to split {@link Axes#CHANNEL}.
*/
private AxisType[] axesToSplit(final ReaderFilter r) {
final Set<AxisType> axes = new HashSet<>();
final Metadata meta = r.getTail().getMetadata();
// Split any non-X,Y axis
for (final CalibratedAxis t : meta.get(0).getAxesPlanar()) {
final AxisType type = t.type();
if (!(type == Axes.X || type == Axes.Y)) {
axes.add(type);
}
}
// Ensure channel is attempted to be split
axes.add(Axes.CHANNEL);
return axes.toArray(new AxisType[axes.size()]);
}
示例2: axesToSplit
import net.imagej.axis.CalibratedAxis; //导入方法依赖的package包/类
/**
* Generates a list of axes using the given Reader, such that {@link Axes#X}
* and {@link Axes#Y} are first.
*/
private AxisType[] axesToSplit(final ReaderFilter r) {
final Set<AxisType> axes = new HashSet<>();
final Metadata meta = r.getTail().getMetadata();
// Split any non-X,Y axis
for (final CalibratedAxis t : meta.get(0).getAxesPlanar()) {
final AxisType type = t.type();
if (!(type == Axes.X || type == Axes.Y)) {
axes.add(type);
}
}
return axes.toArray(new AxisType[axes.size()]);
}
示例3: StringBuilder
import net.imagej.axis.CalibratedAxis; //导入方法依赖的package包/类
private int[]
overwriteDimensions(final Metadata meta, final int imageIndex)
throws IOException
{
getStream().seek(dimensionOffset);
// final int sizeX = (int) meta.getAxisLength(imageIndex, Axes.X);
// final int sizeY = (int) meta.getAxisLength(imageIndex, Axes.Y);
// final int z = (int) meta.getAxisLength(imageIndex, Axes.Z);
// final int c = (int) meta.getAxisLength(imageIndex, Axes.SPECTRA);
// final int t = (int) meta.getAxisLength(imageIndex, Axes.TIME);
final int pixelType = meta.get(imageIndex).getPixelType();
final int bytesPerPixel = FormatTools.getBytesPerPixel(pixelType);
final StringBuilder dimOrder = new StringBuilder();
final int[] sizes = new int[6];
int nextSize = 0;
sizes[nextSize++] = 8 * bytesPerPixel;
if (meta.get(imageIndex).isMultichannel()) {
dimOrder.append("ch\t");
sizes[nextSize++] =
(int) (meta.get(imageIndex).getAxisLength(Axes.CHANNEL));
}
for (final CalibratedAxis axis : meta.get(imageIndex).getAxes()) {
if (axis.type() == Axes.CHANNEL) {
if (dimOrder.indexOf("ch") == -1) {
sizes[nextSize++] =
(int) meta.get(imageIndex).getAxisLength(Axes.CHANNEL);
dimOrder.append("ch");
}
else {
continue;
}
}
else {
sizes[nextSize++] =
(int) meta.get(imageIndex).getAxisLength(axis.type());
dimOrder.append(String.valueOf(axis.type().getLabel().charAt(0))
.toLowerCase());
}
dimOrder.append("\t");
}
getStream().writeBytes(
"layout\torder\tbits\t" + dimOrder.toString() + "\n");
getStream().writeBytes("layout\tsizes\t");
for (final int size : sizes) {
getStream().writeBytes(size + "\t");
}
while ((getStream().getFilePointer() - dimensionOffset) < dimensionLength - 1)
{
getStream().writeBytes(" ");
}
getStream().writeBytes("\n");
return sizes;
}