I would like to know if someone has tried to link Mathematica with ITK code (call ITK code in Mathematica)?
Asked
Active
Viewed 328 times
10
1 Answers
2
ITK seems to have already been implemented using MathLink. Watch your processes when you run a WatershedComponents filter, you can see an ITK.exe process appear. I'm not too familiar with MathLink but maybe this very simple starting point can be taken further by people who know how to use MathLink.
This is a Windows-centric example:
itk = LinkLaunch["C:\\Program Files\\Wolfram Research\\Mathematica\\8.0\\SystemFiles\\\Converters\\Binaries\\Windows\\ITK.exe"]
(*
LinkObject["C:\\Program Files\\Wolfram \Research\\Mathematica\\8.0\\SystemFiles\\Converters\\Binaries\\\Windows\\ITK.exe", 33, 12]
*)
LinkRead[itk]
(*
"Begin[\"Image`ITK`\"];"
*)
LinkReadyQ[itk]
(*
True
*)
LinkWrite[itk, 5]
LinkRead[itk]
(*
"Image`ITK::filterr = \"`1` generated code `2`: `3`\";"
*)
It would be nice to have the source code of the compiled ITK MathLink executable. ITK is released under an Apache or BSD license which, I think, means that Wolfram can use the code in a closed source application and not release it as long as they provide a copy of the license.
s0rce
- 9,632
- 4
- 45
- 78
-
1It is there: FindList[FileNameJoin[{$TopDirectory, "SystemFiles", "FrontEnd", "TextResources", "AboutBox.nb"}], {"ITK", "Insight"}] gives {"Cell["ITK", "LicenseText",", "Copyright (c) 1999-2003 Insight
Software Consortium All rights reserved.\", "* Neither the name of
the Insight Software Consortium nor the names of its \"} – Rolf Mertig Jul 31 '12 at 20:19
WatershedComponentsfilter and watch for an ITK process to appear. – s0rce Jul 30 '12 at 00:06?Image`ITK`*. – Szabolcs Oct 19 '15 at 15:43