01: package it.geosolutions.imageio.plugins.slices2D;
02:
03: /**
04: * {@link SliceImageReader}'s need to implement this interface to provide a
05: * mechanism of index-interpreting to the above layer (working on ND data).
06: *
07: * A class of the above layer should get metadata in order to know the inner
08: * structure (coverages, dims) of a datasource. Then, it should specify a
09: * required 2D slice by setting a proper array of indexes for each dimension of
10: * the underlying (sub)dataset. At this point, the belover layer represented by
11: * a {@link SliceImageReader} class should perform a read operation with a
12: * proper imageIndex param retrieved by the first method of this interface. The
13: * second method simply allows to perform the inverse operation, that is:
14: * retrieving a set of indexes, given an absolute 2D slice index.
15: *
16: * @author Romagnoli Daniele
17: */
18:
19: public interface IndexManager {
20:
21: /**
22: * Retrieve a slice2D index, from an imageIndex and a vector of
23: * selectedDims. This method should be used to access (sub)datasets having
24: * more then 2D.
25: *
26: * @param imageIndex
27: * Related to a Specific Product contained within a sourceFile or
28: * a subDataset
29: *
30: * @param selectedIndexOfEachDim
31: * An <code>int</code> array containing the required index in
32: * the proper dimension. As an instance, suppose having a
33: * products with rank=4 and dimensions = [1024,768,10,20] that is
34: * a dataset having 1024x768 wider 2D slices, for 10 z-levels at
35: * 20 time instants. If you want to retrieve the subIndex needed
36: * to access to the 3rd z-level of the 7th instant, you should
37: * specify a dimensionIndex of [2,6] (starting from zero).
38: */
39: public int retrieveSlice2DIndex(final int imageIndex,
40: int[] selectedIndexOfEachDim);
41:
42: /**
43: * Given a specified index, returns a <code>int[]</code> containing
44: * indexing information such as coverageIndex, Nth dimension,
45: * (N-1)th-dimension, until (N-2)th-dimension. In case of 2D subDatasets, it
46: * simply returns the index of the coverage in the source. In case of source
47: * having a single 2D dataset, it returns 0.
48: *
49: * @param requiredSlice2DIndex
50: * The requiredSlice2DIndex to be "parsed"
51: * @return the indexes needed to find a required Slice 2D within a
52: * multi-subDatasets multi-dimensional source.
53: *
54: */
55: public int[] getSlice2DIndexCoordinates(
56: final int requiredSlice2DIndex);
57: }
|