scijava-common icon indicating copy to clipboard operation
scijava-common copied to clipboard

ConvertService API improvements

Open imagejan opened this issue 5 years ago • 0 comments

For some conversions, it would be useful if we were able to hand over some optional parameters, e.g. to specify if a conversion from UnsignedShortType to UnsignedByteType should clip or not, or if a conversion to ImgLabeling should add prefixes to the labels, and if yes, which prefix.

How about a new signature:

ConvertService#convert(Object src, Type dest, Options options)

where these options could be specified?


Maybe this could even help in distinguishing between lossless and lossy conversions? (See also https://github.com/scijava/scijava-common/issues/288.) Although for this we might also need:

ConvertService#supports(Object src, Type dest, boolean lossless)

or

ConvertService#isGuaranteedLossless(Object src, Type dest)

/cc @frauzufall @ctrueden

imagejan avatar Apr 30 '20 09:04 imagejan