Skip to content
Snippets Groups Projects
Commit 9afd1ea5 authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Change type of dataset dimensions V3i -> HyperStackDimensions

parent bb7f1d58
No related branches found
No related tags found
No related merge requests found
package cz.it4i.qcmp.io;
import cz.it4i.qcmp.data.V3i;
import cz.it4i.qcmp.data.HyperStackDimensions;
/**
* Input data backed by the buffer object.
......@@ -17,19 +17,16 @@ public class BufferInputData extends InputData {
/**
* Create input data backed by buffer object.
*
* @param imageBuffers Image buffer references.
* @param imageDimensions Image dimensions.
* @param pixelType Image pixel type.
* @param cacheHint Name of the image used in caching.
* @param imageBuffers Image buffer references.
* @param datasetDimensions Dataset dimensions.
* @param cacheHint Name of the image used in caching.
*/
public BufferInputData(final Object[] imageBuffers,
final V3i imageDimensions,
final PixelType pixelType,
final HyperStackDimensions datasetDimensions,
final String cacheHint) {
super(datasetDimensions);
this.imageBuffers = imageBuffers;
setDataLoaderType(DataLoaderType.ImageJBufferLoader);
setDimension(imageDimensions);
setPixelType(pixelType);
this.cacheHint = cacheHint;
}
......
package cz.it4i.qcmp.io;
import cz.it4i.qcmp.data.V3i;
import cz.it4i.qcmp.data.HyperStackDimensions;
public class CallbackInputData extends InputData {
......@@ -22,14 +22,21 @@ public class CallbackInputData extends InputData {
int getValueAt(final int x, final int y, final int z);
}
/**
* Create very generic loader, which load data by executing callbacks with parameters.
*
* @param pixelLoadCallback Object with callbacks.
* @param datasetDimensions Dataset dimensions.
* @param cacheHint Qcmp cache file name.
*/
public CallbackInputData(final LoadCallback pixelLoadCallback,
final V3i dimensions,
final HyperStackDimensions datasetDimensions,
final String cacheHint) {
super(datasetDimensions);
this.pixelLoadCallback = pixelLoadCallback;
this.cacheHint = cacheHint;
setDataLoaderType(DataLoaderType.CallbackLoader);
setPixelType(PixelType.Gray16);
setDimension(dimensions);
}
@Override
......@@ -37,6 +44,11 @@ public class CallbackInputData extends InputData {
return cacheHint;
}
/**
* Get the pixel value callback object.
*
* @return Callback object.
*/
public final LoadCallback getPixelLoadCallback() {
return pixelLoadCallback;
}
......
package cz.it4i.qcmp.io;
/**
* Input data backed by the file.
*/
import cz.it4i.qcmp.data.HyperStackDimensions;
public class FileInputData extends InputData {
/**
......@@ -13,16 +12,19 @@ public class FileInputData extends InputData {
/**
* Create input data backed by data file.
*
* @param filePath
* @param filePath Path to the file.
* @param datasetDimensions Dataset dimensions.
*/
public FileInputData(final String filePath) {
public FileInputData(final String filePath,
final HyperStackDimensions datasetDimensions) {
super(datasetDimensions);
this.filePath = filePath;
}
/**
* Get path to the data file.
*
* @return
* @return Path to data file.
*/
@Override
public String getFilePath() {
......
package cz.it4i.qcmp.io;
import cz.it4i.qcmp.data.V3i;
import cz.it4i.qcmp.data.HyperStackDimensions;
/**
* Input data backed by the single buffer object.
......@@ -20,19 +20,16 @@ public class FlatBufferInputData extends InputData {
/**
* Create input data backed by buffer object.
*
* @param imageBuffer Image buffer reference.
* @param imageDimensions Image dimensions.
* @param pixelType Image pixel type.
* @param cacheHint Name of the image used in caching.
* @param imageBuffer Image buffer reference.
* @param datasetDimensions Dataset dimensions.
* @param cacheHint Name of the image used in caching.
*/
public FlatBufferInputData(final Object imageBuffer,
final V3i imageDimensions,
final PixelType pixelType,
final HyperStackDimensions datasetDimensions,
final String cacheHint) {
super(datasetDimensions);
this.imageBuffer = imageBuffer;
setDataLoaderType(DataLoaderType.FlatBufferLoader);
setDimension(imageDimensions);
setPixelType(pixelType);
this.cacheHint = cacheHint;
}
......
package cz.it4i.qcmp.io;
import cz.it4i.qcmp.data.HyperStackDimensions;
import cz.it4i.qcmp.data.Range;
import cz.it4i.qcmp.data.V3i;
/**
* Information about the input file.
......@@ -15,6 +15,7 @@ public abstract class InputData {
CallbackLoader
}
// NOTE(Moravec): Supporting this will need a lot of work. If only we had C++ templates.
public enum PixelType {
Gray16,
AnythingElse
......@@ -32,9 +33,9 @@ public abstract class InputData {
private PixelType pixelType = PixelType.Gray16;
/**
* Image dimension.
* Dataset dimensions.
*/
private V3i dimension;
private HyperStackDimensions dimension;
/**
* Index of the plane to compress.
......@@ -46,6 +47,15 @@ public abstract class InputData {
*/
Range<Integer> planeRange = null;
/**
* Create InputData object with dataset dimensions.
*
* @param datasetDimensions Dataset dimensions.
*/
public InputData(final HyperStackDimensions datasetDimensions) {
this.dimension = datasetDimensions;
}
public boolean isPlaneIndexSet() {
return (planeIndex != null);
......@@ -55,12 +65,11 @@ public abstract class InputData {
return (planeRange != null);
}
public void setDimension(final V3i dimension) {
public void setDimension(final HyperStackDimensions dimension) {
this.dimension = dimension;
}
public V3i getDimensions() {
public HyperStackDimensions getDimensions() {
return dimension;
}
......@@ -96,11 +105,10 @@ public abstract class InputData {
this.pixelType = pixelType;
}
/**
* Override in FileInputData!!!
* This is mostly used by loaders which are backed by file.
*
* @return null!
* @return Basic non-overloaded versions always returns null.
*/
public String getFilePath() {
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment