本文整理汇总了Java中net.imagej.axis.AxisType.getLabel方法的典型用法代码示例。如果您正苦于以下问题:Java AxisType.getLabel方法的具体用法?Java AxisType.getLabel怎么用?Java AxisType.getLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imagej.axis.AxisType
的用法示例。
在下文中一共展示了AxisType.getLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LongColumn
import net.imagej.axis.AxisType; //导入方法依赖的package包/类
/**
* Creates columns for a {@link net.imagej.table.Table} that describe the
* positions of the subspaces in a hyperspace
* <p>
* For example, if you've split a {X, Y, Z, C, T} space into {X, Y, Z}, the
* method returns "Channel" and "Time" columns that list the positions of the
* subspaces in C and T.
* </p>
*
* @see Subspace
* @param subspaces the subspaces of a hyperspace.
* @param <T> type of the elements in the spaces.
* @return columns that list the positions of the subspaces.
* @deprecated only used in tests.
*/
@Deprecated
public static <T extends RealType<T> & NativeType<T>> List<LongColumn>
createCoordinateColumns(List<Subspace<T>> subspaces)
{
final List<LongColumn> coordinateColumns = new ArrayList<>();
if (subspaces == null) {
return coordinateColumns;
}
final AxisType[] types = subspaces.get(0).getAxisTypes().toArray(
AxisType[]::new);
final List<long[]> positions = subspaces.stream().map(s -> s.getPosition()
.toArray()).collect(Collectors.toList());
for (int i = 0; i < types.length; i++) {
final AxisType type = types[i];
final LongColumn coordinateColumn = new LongColumn(type.getLabel());
final int index = i;
positions.stream().mapToLong(p -> toConventionalIndex(type, p[index]))
.forEach(coordinateColumn::add);
coordinateColumns.add(coordinateColumn);
}
return coordinateColumns;
}
示例2: getAxisGlobalValue
import net.imagej.axis.AxisType; //导入方法依赖的package包/类
/**
* Returns the global min or max (based on the provided list) for the given
* image, axis type, and slice for that axis.
*/
private Double getAxisGlobalValue(final int imageIndex, final AxisType type,
final int index, final List<Map<AxisType, double[]>> planarAxisValues)
throws FormatException
{
// FormatTools.assertId(getCurrentFile(), true, 2);
if (index < 0 || index >= getMetadata().get(imageIndex).getAxisLength(type))
{
throw new FormatException("Invalid " + type.getLabel() + " index: " +
index);
}
// check that all planes have been read
if (minMaxDone == null ||
minMaxDone[imageIndex] < getPlaneCount(imageIndex))
{
return null;
}
return getAxisValue(planarAxisValues.get(imageIndex).get(type), index);
}