Package biopb.image
Class ArgCodec
java.lang.Object
biopb.image.ArgCodec
Ops arguments and results: values and pixels to and from
Arg.
An Arg is pixels (inline, or a reference to a tensor on a plane) or
anything else as a protobuf Value. Both sides of the wire use these: a
client encodes what it sends and decodes what comes back, a server the reverse.
The Java twin of Python's biopb.image._arg.
JSON values are null, Boolean, Number, String, a Map with string keys, and a Iterable or array of
these. A pixel array is a RandomAccessibleInterval.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe axes an unlabelled array of each rank is taken to have, as Python's row-major arrays have them: an interval's dimension 0 is the first label. -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectdecodeArg(Arg, boolean)reading integral numbers asLong.static ObjectAnArgas Java: JSON as plain values (seejsonValue(com.google.protobuf.Value, boolean)forints), inline pixels as aRandomAccessibleInterval, and a reference as the lazy interval it names, read from its plane on demand.static Argvalueas anArg: aRandomAccessibleIntervalas inline pixels, anything else as JSON.static ArgencodeArg(Object)withdimLabelsnaming an array's axes (one per dimension); null takesNDIM_LABELS.static Argvalueas a JSONArg.static ObjectjsonValue(com.google.protobuf.Value value, boolean ints)
-
Field Details
-
NDIM_LABELS
The axes an unlabelled array of each rank is taken to have, as Python's row-major arrays have them: an interval's dimension 0 is the first label. An interval whose dimension 0 is X (imglib2's usual order) must pass its own labels toencodeArg(Object, List).
-
-
Method Details
-
jsonArg
valueas a JSONArg.- Throws:
IllegalArgumentException- a value of a type with no JSON form
-
jsonValue
-
encodeArg
valueas anArg: aRandomAccessibleIntervalas inline pixels, anything else as JSON. The array's axes are labelled byNDIM_LABELSfor its rank. -
encodeArg
encodeArg(Object)withdimLabelsnaming an array's axes (one per dimension); null takesNDIM_LABELS. Ignored for a value that is not an array. -
decodeArg
decodeArg(Arg, boolean)reading integral numbers asLong. -
decodeArg
AnArgas Java: JSON as plain values (seejsonValue(com.google.protobuf.Value, boolean)forints), inline pixels as aRandomAccessibleInterval, and a reference as the lazy interval it names, read from its plane on demand.- Throws:
IllegalArgumentException- an emptyArg
-