The problem I am facing is the following. I need to have as input to my LibraryFunction and 2D or 3D image. Using the following syntax

$FunctionBlabla= safeLibraryFunctionLoad[debug,"FunctionBlabla",{"UTF8String"}, LibraryDataType[Image|Image3D]]; 

It is possible to return either an Image or an Image3D depending on some conditions in your function FunctionBlabla. I want to know if it's also possible to something like that in the output? This syntax doesn't work.

$FunctionBlabla= safeLibraryFunctionLoad[debug,"FunctionBlabla",{LibraryDataType[Image|Image3D]}, LibraryDataType[Image|Image3D]]; 
  • $\begingroup$ What do you mean by "it doesn't work"? LibraryDataType[Image|Image3D] is the correct way to do this, and it works for me. Image|Image3D also works as a shorthand. $\endgroup$ – Szabolcs Oct 15 '17 at 15:21
  • 1
    $\begingroup$ I'm voting to close this question as off-topic because it is too localized; i.e, it applies only to the local situation and needs of its poster and answers will not benefit others. $\endgroup$ – m_goldberg Oct 15 '17 at 19:57
  • $\begingroup$ The question has an answer. It is probably a year old. I'm fine closing it. Or I can just delete it if you'd like $\endgroup$ – Vahagn Tumanyan Oct 15 '17 at 20:52
  • $\begingroup$ I voted to close because there is not enough information to reproduce the problem, and because I do not believe that the problem was what the answer would suggest. It can be reopened if you show how to reproduce the problem. Then we can try to tease out the real cause. $\endgroup$ – Szabolcs Nov 1 '17 at 11:05

Turns out it was as simple as writing

$FunctionBlabla= safeLibraryFunctionLoad[debug,"FunctionBlabla",{{"Image" | "Image3D"}}, LibraryDataType[Image|Image3D]]; 

Not the answer you're looking for? Browse other questions tagged or ask your own question.