Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I would like to know if someone has tried to link Mathematica with ITK code (call ITK code in Mathematica)?

share|improve this question
1  
It looks like it's written in C++, so this more general information might be useful. –  b.gatessucks Jul 19 '12 at 14:26
    
It seems you've been looking for something like this for a while: forums.wolfram.com/mathgroup/archive/2010/Dec/msg00252.html It's the only related post Google gives me. If you implement it yourself, be sure to let us know! –  Szabolcs Jul 19 '12 at 14:28
    
From what I can tell ITK is already integreated, run a WatershedComponents filter and watch for an ITK process to appear. –  s0rce Jul 30 '12 at 0:06

1 Answer 1

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.

share|improve this answer
1  
It 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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