David -
Does the following do what you want? It has a little cruft around the
anonymous function at the end which runs the transform main window. This
cruft is for parsing the command-line for arguments to be passed into the
code.
I don't remember off the top of my head how to hide or do without the
session window but at least the former of these is possible.
Good luck,
Devon
NB. ------------ J script follows ------------
NB.* transformSA.ijs: Standalone image transforms
invokeThis=: 0 : 0
"C:\Program Files\j602\bin\j.exe" c:\amisc\JSys\user\code\TransformSA.ijs
-rt
)
addon_path=: jpath '~addons/media/image3/'
require addon_path,'transform_m.ijs'
setGlobalParms=: 3 : 0
PIC=: ,>'c:\amisc\pix\Utah_teapot.jpg' lookupValAfterName ARGV_z_;<'PIC'
DEBUGON=: >0 lookupValAfterName ARGV_z_;<'DEBUGON'
ans=. ans,:".&.>ans=. 'PIC';'DEBUGON'
)
lookupValAfterName=: 3 : 0
NB.* lookupValAfterName: given vec of name, value pairs, return value for
each
NB. name specified; return default value x if no name found.
'' lookupValAfterName y
:
try.
'vnvec names'=. split y
wh=. names i.~vnvec=. >vnvec
val=. (>:wh){vnvec,2$<x NB. Return default x for invalid name.
catch. val=. boxopen x end. NB. val boxed because may be multiple parms
NB. VAR=: 'Default' lookupValAfterName ARGV_z_;'CMDLNVAR'
)
NB.* : only invoke if not loaded via interactive session.
3 : 0 ''
if. -.ARGV_z_ +./ . e. '-rt';'-jijx' do.
smoutput 'ARGV_z_: ',;ARGV_z_,&.>' '
return.
end.
setGlobalParms ''
transformimage_run PIC
)
On 7/18/08, David Porter <[EMAIL PROTECTED]> wrote:
>
> (Another humbling question.)
>
> I'm having trouble building a standalone version of transform_m from the
> image3 addons. I have tried multiple combinations of source files and
> commenting out file paths and putting combinations of the support files
> in the standalone directory.
>
> The best I've been able to achieve is to have the standalone file run
> and have the transform_m window come up using the barebones approach,
> that is loading the file manually with 0!:0 into a j session without the
> profile. However, when an image file was opened, it failed with an
> error in raw_read_image.
>
> At this point, I'm not sure which iteration included which modifications
> so I'm not much help in trying to figure out what I did wrong. My
> question is: What should I do right? It seems to me that it just
> shouldn't be this hard to do.
>
> Thanks,
> Dave
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm