Changing filenames can surely be achieved by a different way, but for changing 
a textsting for example in a net file m4 seemd very helpful for me. The 
following example just produces an image with a textstring. The textstring 
and the filename of the tiff picture can be changed by:

m4 -DFILENAME=picture1.tiff -DTEXTSTRING="Picture 1" caption.net.m4 > 
caption.net

dx -script caption.net

I think it is not too complicated, as you can use your already existing net 
files, just change the filenames, textstrings, etc into keywords and process 
it with m4. If you have a better way of doing this, please let me know. 

Alex

> These must be pretty complicated if you can't use dx to do the
> filename changing, etc. Can you give us an example?
>
> David
>
> >I had the same problem of processing hundreds of Datasets to produce
> > images and movies. To change filenames of the datasets and values of text
> > output I was using the macroprocessor m4 out of a shell script to change
> > keywords in the .net and .cfg files. Seems to me a solution with a
> > minimum of coding.
> >
> >Alex
> >
> >Am Freitag, 25. Juli 2003 17:31 schrieb Sharon Gibson:
> >>  Yes, I am in the practice of doing this and there are others (maybe
> >> using a different scripting language). In the archives, there has been
> >> some past discussion about the idea of altering nets (or something to
> >> get the same effect) and using dx in batch mode. One thread I think was
> >> called something like 'parameterizing a net', and another about
> >> 'scripting'.
> >>
> >>  When I first started doing this it took a while to catch on to the idea
> >> of when to alter the net and when to alter the .cfg (I can't think of a
> >> purpose for which both are needed). But I'll assume for now that you're
> >> smarter than I was and don't need that explanation. I'll just say that
> >> it depends on whether you are just trying to save on the number of user
> >> button-pushing (gui) actions for a large number of cases, or want a
> >> completely automated process (e.g. run overnight and look at output
> >> files or images rather than the screen).
> >>
> >>  I'm not sure what you mean exactly by "autogenerate", but if your
> >> net/cfg is of any substantial size, then you will want to merely change
> >> the lines that are needed rather than output the entire code. For this
> >> it is best to get in the habit of naming anything important using a
> >> Transmitter. Then it is much easier to search for and change the value
> >> assignments of each item.
> >>
> >>  -Sharon
> >>
> >>  >Hi-
> >>  >
> >>  >Has anyone ever written any perl modules for OpenDX? I would imagine
> >>  > that if one had a batch of data to visualize, it would be nice to
> >>  > have a script which could auto-generate the network and config files.
> >>
> >>  Cheers,
> >>  Dan
//
// time: Sat Jul 26 12:17:41 2003
//
// version: 3.1.2 (format), 4.1.3 (DX)
//
//
// MODULE main
// workspace: width = 369, height = 355
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
    // 
    // node Caption[1]: x = 138, y = 68, inputs = 9, label = Caption
    // input[1]: defaulting = 0, visible = 1, type = 32, value = "TEXTSTRING"
    //
main_Caption_1_out_1 = 
    Caption(
    main_Caption_1_in_1,
    main_Caption_1_in_2,
    main_Caption_1_in_3,
    main_Caption_1_in_4,
    main_Caption_1_in_5,
    main_Caption_1_in_6,
    main_Caption_1_in_7,
    main_Caption_1_in_8,
    main_Caption_1_in_9
    ) [instance: 1, cache: 1];
    // 
    // node AutoCamera[1]: x = 277, y = 134, inputs = 9, label = AutoCamera
    //
main_AutoCamera_1_out_1 = 
    AutoCamera(
    main_Caption_1_out_1,
    main_AutoCamera_1_in_2,
    main_AutoCamera_1_in_3,
    main_AutoCamera_1_in_4,
    main_AutoCamera_1_in_5,
    main_AutoCamera_1_in_6,
    main_AutoCamera_1_in_7,
    main_AutoCamera_1_in_8,
    main_AutoCamera_1_in_9
    ) [instance: 1, cache: 1];
    // 
    // node Render[1]: x = 152, y = 195, inputs = 3, label = Render
    //
main_Render_1_out_1 = 
    Render(
    main_Caption_1_out_1,
    main_AutoCamera_1_out_1,
    main_Render_1_in_3
    ) [instance: 1, cache: 1];
    // 
    // node WriteImage[1]: x = 150, y = 293, inputs = 4, label = WriteImage
    // input[2]: defaulting = 0, visible = 1, type = 32, value = "FILENAME"
    // input[3]: defaulting = 0, visible = 1, type = 32, value = "tiff"
    //
    WriteImage(
    main_Render_1_out_1,
    main_WriteImage_1_in_2,
    main_WriteImage_1_in_3,
    main_WriteImage_1_in_4
    ) [instance: 1, cache: 1];
// network: end of macro body
}
main_Caption_1_in_1 = "TEXTSTRING";
main_Caption_1_in_2 = NULL;
main_Caption_1_in_3 = NULL;
main_Caption_1_in_4 = NULL;
main_Caption_1_in_5 = NULL;
main_Caption_1_in_6 = NULL;
main_Caption_1_in_7 = NULL;
main_Caption_1_in_8 = NULL;
main_Caption_1_in_9 = NULL;
main_Caption_1_out_1 = NULL;
main_AutoCamera_1_in_2 = NULL;
main_AutoCamera_1_in_3 = NULL;
main_AutoCamera_1_in_4 = NULL;
main_AutoCamera_1_in_5 = NULL;
main_AutoCamera_1_in_6 = NULL;
main_AutoCamera_1_in_7 = NULL;
main_AutoCamera_1_in_8 = NULL;
main_AutoCamera_1_in_9 = NULL;
main_AutoCamera_1_out_1 = NULL;
main_Render_1_in_3 = NULL;
main_Render_1_out_1 = NULL;
main_WriteImage_1_in_2 = "FILENAME";
main_WriteImage_1_in_3 = "tiff";
main_WriteImage_1_in_4 = NULL;
Executive("product version 4 1 3");
$sync
main();

Reply via email to