Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Mathlink connection to Spyglass/Fortner Transform
Posted:
Nov 21, 1999 6:49 PM


I have an old copy of Spyglass Transform (version 3.0 for NT, 1994). This product is now available only as part of Fortner Noesys (see [mg18812]), and my copy is so old that Fortner Software (the successor to Spyglass) will not support it or provide assistance with technical queries. Transform is an image / matrix data processing package with an impressive turn of speed, excellent interactive facilities, a good easytouse macro language and a direct Mathlink connection to Mathematica. The Mathlink connection for passing data for image processing worked well with Mathematica 2.2.3 and Mathematica 3.0 under NT4.0 with my version of Transform, despite this obviously having been developed under the very first NT version of the Mathlink Developers Kit (there are some warnings in the documentation....).
Unfortunately when using Mathematica 4.0 a large number of the commands supplied (including "TransformPutArray" and "TransformGetArray") fail, killing the link, with a message box (from Transform) saying "Mathlink Error: 3  MLGet out of sequence. Closing connection". This seems to be caused by Transform not being able to perform operations correctly as requested, and it is not obvious how to work around this. Changing the "ml32i1.dll" file used by Transform between v3 and v4 versions in the .INI file has no effect (and the v4 version works quite happily when used with Mathematica 3.0). Changing link protocol has no effect.
Transfer of data is still possible using files etc. but the lack of a Mathlink connection is a bit unfortunate  that was why I bought Transform in the first place.
Can the group recommend a way forward?
1) is there a way of modifying the Mathlink commands in Mathematica to get round this problem when using the old Transform software  e.g. what is MessagePacket doing here?
2) does the version of Transform now supplied with Noesys (Adept Scientific has Noesys version 1.3 for the UK, Fortner sells version 2.0 in the US only) have this problem with Mathematica4.0?
3) is there any other matrix & image processing software which performs similar tasks, preferably with Mathlink connection, for *large* matrix data sets? Mathematica itself is still too slow & unreliable for large image, contour plots etc. despite its ever increasing ability to generate the data for them. [mg16786] suggests OMATRIX, and I am now struggling with the demo version [I haven't yet found how to make image plots, or do 2way named data transfers]  are there any alternatives?

Appendix: sequence of commands which all work on Mathematica3.0, but most fail on Mathematica4.0.
Functions are extracted/modified from "trnsfrm3.m" for clarity
In[1]:= (TransformLinkName = LinkConnect[ "3000", LinkMode>Listen]; LinkRead[TransformLinkName])
In[2]:= (* manually perform the connection from Transform *)
In[3]:= m83file = FileNames["m83.hdf", "d:\\appsnt", 10][[1]];
In[4]:= (LinkWrite[ TransformLinkName, MessagePacket["call open( \"" <> m83file <> "\" )"]]; LinkRead[TransformLinkName])
(* this fails for Mathematica4.0 : instead, manually open the file *)
In[5]:= (LinkWrite[TransformLinkName, MessagePacket["$putlink Radio_Map"]]; m83data = LinkRead[TransformLinkName]; LinkRead[TransformLinkName])
(* from function TransformGetArray : this fails for Mathematica4.0 *)
In[6]:= (LinkWrite[TransformLinkName, MessagePacket["call contour(\"Radio_Map\")"]]; LinkRead[TransformLinkName])
(* this works correctly for Mathematica4.0 (!!!) *)
In[7]:= (testdata = Table[i*j, {i, 1, 5}, {j, 1, 5}]; LinkWrite[ TransformLinkName, MessagePacket["$getlink test1"]]; LinkWrite[ TransformLinkName, N[testdata] ]; LinkRead[TransformLinkName])
(* from function TransformPutArray : this fails for Mathematica4.0 *) In[8]:= LinkClose[TransformLinkName]  from  John Tanner home  john@janacek.demon.co.uk mantra  curse Microsoft, curse... work  john.tanner@gecm.com I hate this 'orrible computer, I really ought to sell it: It never does what I want, but only what I tell it.



