/
RawPixelsStore.java
165 lines (119 loc) · 5.25 KB
/
RawPixelsStore.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
/*
* ome.api.RawPixelsStore
*
* Copyright 2006 University of Dundee. All rights reserved.
* Use is subject to license terms supplied in LICENSE.txt
*/
package ome.api;
import java.util.List;
import java.util.Map;
import java.util.Set;
import ome.annotations.Validate;
import ome.model.core.Pixels;
import omeis.providers.re.data.PlaneDef;
/**
* Binary data provider. Initialized with the id of a
* {@link ome.model.core.Pixels} instance, this interface can provide various
* slices, stacks, regions of the 5-dimensional (X-Y planes with multiple
* Z-sections and Channels over Time). The byte array returned by the getter
* methods and passed to the setter methods can and will be interpreted
* according to results of {@link #getByteWidth()}, {@link #isFloat()}, and
* {@link #isSigned()}.
*/
public interface RawPixelsStore extends StatefulServiceInterface {
// State management.
/**
* Initializes the stateful service for a given Pixels set.
* @param pixelsId Pixels set identifier.
* @param bypassOriginalFile Whether or not to bypass checking for an
* original file to back the pixel buffer used by this service. If requests
* are predominantly <code>write-only</code> or involve the population of
* a brand new pixel buffer using <code>true</code> here is a safe
* optimization otherwise <code>false</code> is expected.
*/
public void setPixelsId(long pixelsId, boolean bypassOriginalFile);
/**
* Returns the current Pixels path.
* @return See above.
*/
public String getPixelsPath();
/**
* Returns the current Pixels set identifier.
* @return See above.
*/
public long getPixelsId();
/**
* Prepares the stateful service with a cache of loaded Pixels objects.
* This method is designed to combat query overhead, where many sets of
* Pixels are to be read from or written to, by loading all the Pixels
* sets at once. Multiple calls will result in the existing cache being
* overwritten.
* @param pixelsIds Pixels IDs to cache.
*/
public void prepare(@Validate(Long.class) Set<Long> pixelsIds);
/**
* Returns the plane size
* @return the plane size
*/
public long getPlaneSize();
public int getRowSize();
public long getStackSize();
public long getTimepointSize();
public long getTotalSize();
public long getRowOffset(int y, int z, int c, int t);
public long getPlaneOffset(int z, int c, int t);
public long getStackOffset(int c, int t);
public long getTimepointOffset(int t);
public byte[] getTile(int z, int c, int t, int x, int y, int w, int h);
public byte[] getRegion(int size, long offset);
public byte[] getRow(int y, int z, int c, int t);
public byte[] getCol(int x, int z, int c, int t);
public Map<Integer, int[]> getHistogram(int[] channels, int binCount, boolean globalRange, PlaneDef plane);
public Map<Integer, double[]> findMinMax(int[] channels);
public byte[] getHypercube(@Validate(Integer.class) List<Integer> offset, @Validate(Integer.class) List<Integer> size, @Validate(Integer.class) List<Integer> step);
public byte[] getPlaneRegion(int z, int c, int t, int count, int offset);
public byte[] getPlane(int z, int c, int t);
public byte[] getStack(int c, int t);
public byte[] getTimepoint(int t);
public void setTile(byte[] buffer, int z, int c, int t, int x, int y, int w, int h);
public void setRegion(int size, long offset, byte[] buffer);
public void setRow(byte[] buffer, int y, int z, int c, int t);
public void setPlane(byte[] buffer, int z, int c, int t);
public void setStack(byte[] buffer, int z, int c, int t);
public void setTimepoint(byte[] buffer, int t);
public int getByteWidth();
public boolean isSigned();
public boolean isFloat();
public byte[] calculateMessageDigest();
public Pixels save();
public boolean requiresPixelsPyramid();
public Object getResolutionDescriptions();
/**
* Retrieves the number of resolution levels that the backing
* pixels pyramid contains.
* @return The number of resolution levels. This value does not
* necessarily indicate either the presence or absence of a
* pixels pyramid.
**/
public int getResolutionLevels();
/**
* Retrieves the active resolution level.
* @return The active resolution level. The level will be non-negative and less
* than {@link #getResolutionLevels()}. Resolution level 0 is the smallest
* resolution and resolution level <code>getResolutionLevels() - 1</code>
* is the largest resolution. This is the inverse of how Bio-Formats indexes
* resolutions.
*/
public int getResolutionLevel();
/**
* Sets the active resolution level.
* @param resolutionLevel The resolution level to be used.
* The level should be non-negative and less than
* {@link #getResolutionLevels()}. * Resolution level 0 is the smallest
* resolution and resolution level <code>getResolutionLevels() - 1</code>
* is the largest resolution. This is the inverse of how Bio-Formats indexes
* resolutions.
*/
public void setResolutionLevel(int resolutionLevel);
public int[] getTileSize();
}