From d2e7c11a4798ed05af48aa923bdb7a4665f4851b Mon Sep 17 00:00:00 2001 From: Vojtech Moravec <vojtech.moravec.st@vsb.cz> Date: Thu, 22 Oct 2020 11:38:05 +0200 Subject: [PATCH] Add new class representing HyperStack dimensions. This will replace V3i in most APIs. --- .../it4i/qcmp/data/HyperStackDimensions.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 src/main/java/cz/it4i/qcmp/data/HyperStackDimensions.java diff --git a/src/main/java/cz/it4i/qcmp/data/HyperStackDimensions.java b/src/main/java/cz/it4i/qcmp/data/HyperStackDimensions.java new file mode 100644 index 0000000..652486d --- /dev/null +++ b/src/main/java/cz/it4i/qcmp/data/HyperStackDimensions.java @@ -0,0 +1,85 @@ +package cz.it4i.qcmp.data; + +/** + * Class representing dimensions of the Stack or Hyperstack. + * This terminology is taken from the ImageJ. + */ +public class HyperStackDimensions { + private final int width; + private final int height; + private final int sliceCount; + private final int numberOfTimepoints; + + + /** + * Create HyperStackDimensions. + * + * @param width Width of the slice. + * @param height Height of the slice. + * @param sliceCount Slice count in the stack. + * @param numberOfTimepoints Number of stack timepoints. + */ + public HyperStackDimensions(final int width, final int height, final int sliceCount, final int numberOfTimepoints) { + this.width = width; + this.height = height; + this.sliceCount = sliceCount; + this.numberOfTimepoints = numberOfTimepoints; + } + + /** + * Create HyperStackDimensions for single timepoint. + * + * @param width Width of the slice. + * @param height Height of the slice. + * @param sliceCount Slice count in the stack. + */ + public HyperStackDimensions(final int width, final int height, final int sliceCount) { + this(width, height, sliceCount, 1); + } + + /** + * Create HyperStackDimensions for single slice and single timepoint. + * + * @param width Width of the slice. + * @param height Height of the slice. + */ + public HyperStackDimensions(final int width, final int height) { + this(width, height, 1, 1); + } + + /** + * Get single slice width. (X) + * + * @return Slice width. + */ + public final int getWidth() { + return width; + } + + /** + * Get single slice height. (Y) + * + * @return Slice height. + */ + public final int getHeight() { + return height; + } + + /** + * Get slice count. (Z, Plane Count) + * + * @return Slice count. + */ + public final int getSliceCount() { + return sliceCount; + } + + /** + * Get number of timepoints of the stack. + * + * @return Timepoint count. + */ + public final int getNumberOfTimepoints() { + return numberOfTimepoints; + } +} -- GitLab