Remove App.image_dic
I believe you said image_dic is not required.
The only place I see it is here :
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs) -> App:
if method == "__call__":
# Converting potential pyotb inputs to arrays
arrays = []
image_dic = None
for inp in inputs:
if isinstance(inp, (float, int, np.ndarray, np.generic)):
arrays.append(inp)
elif isinstance(inp, OTBObject):
image_dic = inp.export()
arrays.append(image_dic["array"])
else:
logger.debug(type(self))
return NotImplemented
# Performing the numpy operation
result_array = ufunc(*arrays, **kwargs)
result_dic = image_dic
result_dic["array"] = result_array
# Importing back to OTB, pass the result_dic just to keep reference
pyotb_app = App("ExtractROI", image_dic=result_dic, frozen=True, quiet=True)
if result_array.shape[2] == 1:
pyotb_app.app.ImportImage("in", result_dic)
else:
pyotb_app.app.ImportVectorImage("in", result_dic)
pyotb_app.execute()
return pyotb_app
In App it does nothing.
If possible we should remove it from App. What is this reference ? If image_dic is just numpy data, is it required to keep the ref after we call ImportImage
?
What about orfeotoolbox/otb#1824 (closed) ?
Edited by Vincent Delbar