//
// time: Wed Apr  9 15:40:14 1997
//
// version: 3.1.1 (format), 3.1.4 (DX Beta)
//
//
// MODULE main
//
// comment: This visualization shows a sequence of slices of mri data of a human head. The data consists of 16 slices, each 128x128. The data is imported using the general array header file mri.general.
// comment: 
// comment: Two methods of display are shown. In the first, the data are simply autocolored and displayed. In the second, "delayed colors" are used to speed display and reduce memory use. In order to use delayed colors, it is necessary to convert the data to bytes, as is done here using Compute.  Use the control panel to choose between these methods. Play the sequencer to see the 16 slices. See the AutoColor manual page for more information about "delayed colors".
// workspace: width = 413, height = 617
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
    // 
    // node Import[1]: x = 25, y = 20, inputs = 6, label = Import
    // input[1]: defaulting = 0, visible = 1, type = 32, value = "mri.general"
    //
main_Import_1_out_1 = 
    Import(
    main_Import_1_in_1,
    main_Import_1_in_2,
    main_Import_1_in_3,
    main_Import_1_in_4,
    main_Import_1_in_5,
    main_Import_1_in_6
    ) [instance: 1, cache: 1];
    // 
    // node Sequencer[1]: x = 201, y = 37, inputs = 7, label = Sequencer
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "Sequencer_1"
    // input[4]: defaulting = 1, visible = 1, type = 1, value = 0
    // input[5]: defaulting = 1, visible = 1, type = 1, value = 15
    // input[6]: defaulting = 1, visible = 0, type = 1, value = 1
    // input[7]: defaulting = 0, visible = 0, type = 16777217, value = { 0 15 1 0 15 1 }
    // vcr[1]: min = 0, max = 15, beg = 0, end = 15, cur = 0, inc = 1, loop = off, step = off, pal = off
    // window: position = (0.1484,0.0918), size = 0.2188x0.0781
    //
    main_Sequencer_1_out_1 = @frame;
    // 
    // node Slice[1]: x = 42, y = 126, inputs = 3, label = Slice
    // input[2]: defaulting = 0, visible = 1, type = 1, value = 2
    //
main_Slice_1_out_1 = 
    Slice(
    main_Import_1_out_1,
    main_Slice_1_in_2,
    main_Sequencer_1_out_1
    ) [instance: 1, cache: 1];
    // 
    // node AutoColor[1]: x = 89, y = 359, inputs = 10, label = AutoColor
    //
main_AutoColor_1_out_1,
main_AutoColor_1_out_2 = 
    AutoColor(
    main_Slice_1_out_1,
    main_AutoColor_1_in_2,
    main_AutoColor_1_in_3,
    main_AutoColor_1_in_4,
    main_AutoColor_1_in_5,
    main_AutoColor_1_in_6,
    main_Import_1_out_1,
    main_AutoColor_1_in_8,
    main_AutoColor_1_in_9,
    main_AutoColor_1_in_10
    ) [instance: 1, cache: 1];
    // 
    // node Statistics[1]: x = 293, y = 194, inputs = 1, label = Statistics
    //
main_Statistics_1_out_1,
main_Statistics_1_out_2,
main_Statistics_1_out_3,
main_Statistics_1_out_4,
main_Statistics_1_out_5 = 
    Statistics(
    main_Slice_1_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Compute[1]: x = 226, y = 302, inputs = 4, label = Compute
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "byte(255*($0-$1)/($2-$1))"
    // expression: value = byte(255*(data-min)/(max-min))
    // name[2]: value = data
    // name[3]: value = min
    // name[4]: value = max
    //
main_Compute_1_out_1 = 
    Compute(
    main_Compute_1_in_1,
    main_Slice_1_out_1,
    main_Statistics_1_out_4,
    main_Statistics_1_out_5
    ) [instance: 1, cache: 1];
    // 
    // node AutoColor[2]: x = 222, y = 387, inputs = 10, label = AutoColor
    // input[7]: defaulting = 0, visible = 1, type = 5, value = 0.0
    // input[8]: defaulting = 0, visible = 1, type = 5, value = 255.0
    // input[9]: defaulting = 0, visible = 1, type = 3, value = 1
    //
main_AutoColor_2_out_1,
main_AutoColor_2_out_2 = 
    AutoColor(
    main_Compute_1_out_1,
    main_AutoColor_2_in_2,
    main_AutoColor_2_in_3,
    main_AutoColor_2_in_4,
    main_AutoColor_2_in_5,
    main_AutoColor_2_in_6,
    main_AutoColor_2_in_7,
    main_AutoColor_2_in_8,
    main_AutoColor_2_in_9,
    main_AutoColor_2_in_10
    ) [instance: 2, cache: 1];
    // 
    // node Toggle[1]: x = 4, y = 231, inputs = 6, label = Toggle
    // input[1]: defaulting = 0, visible = 0, type = 32, value = "Toggle_1"
    // input[2]: defaulting = 0, visible = 0, type = 29, value = 1
    // input[3]: defaulting = 0, visible = 0, type = 3, value = 0
    // input[4]: defaulting = 1, visible = 1, type = 29, value = 2
    // input[5]: defaulting = 1, visible = 1, type = 29, value = 1
    // output[1]: visible = 1, type = 29, value = 1
    // toggle : 0
    //
    // 
    // node Switch[1]: x = 83, y = 472, inputs = 3, label = Switch
    //
main_Switch_1_out_1 = 
    Switch(
    main_Toggle_1_out_1,
    main_AutoColor_1_out_1,
    main_AutoColor_2_out_1
    ) [instance: 1, cache: 1];
    // 
    // node Display[1]: x = 115, y = 555, inputs = 8, label = Display
    // depth: value = 24
    // window: position = (0.6734,0.0781), size = 0.1109x0.2441
    //
main_Display_1_out_1[cache: 2] = 
    Display(
    main_Switch_1_out_1,
    main_Display_1_in_2,
    main_Display_1_in_3,
    main_Display_1_in_4,
    main_Display_1_in_5,
    main_Display_1_in_6,
    main_Display_1_in_7,
    main_Display_1_in_8
    ) [instance: 1, cache: 1];
// network: end of macro body
}
main_Import_1_in_1 = "mri.general";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Sequencer_1_in_1 = "Sequencer_1";
main_Sequencer_1_in_2 = NULL;
main_Sequencer_1_in_3 = NULL;
main_Sequencer_1_in_4 = NULL;
main_Sequencer_1_in_5 = NULL;
main_Sequencer_1_in_6 = NULL;
main_Sequencer_1_in_7 = { 0 15 1 0 15 1 };
main_Sequencer_1_out_1 = NULL;

@startframe = 0;
@nextframe  = @startframe;
@endframe   = 15;
@deltaframe = 1;
main_Slice_1_in_2 = 2;
main_Slice_1_out_1 = NULL;
main_AutoColor_1_in_2 = NULL;
main_AutoColor_1_in_3 = NULL;
main_AutoColor_1_in_4 = NULL;
main_AutoColor_1_in_5 = NULL;
main_AutoColor_1_in_6 = NULL;
main_AutoColor_1_in_8 = NULL;
main_AutoColor_1_in_9 = NULL;
main_AutoColor_1_in_10 = NULL;
main_AutoColor_1_out_1 = NULL;
main_Statistics_1_out_4 = NULL;
main_Statistics_1_out_5 = NULL;
main_Compute_1_in_1 = "byte(255*($0-$1)/($2-$1))";
main_Compute_1_out_1 = NULL;
main_AutoColor_2_in_2 = NULL;
main_AutoColor_2_in_3 = NULL;
main_AutoColor_2_in_4 = NULL;
main_AutoColor_2_in_5 = NULL;
main_AutoColor_2_in_6 = NULL;
main_AutoColor_2_in_7 = 0.0;
main_AutoColor_2_in_8 = 255.0;
main_AutoColor_2_in_9 = 1;
main_AutoColor_2_in_10 = NULL;
main_AutoColor_2_out_1 = NULL;
main_Toggle_1_in_1 = "Toggle_1";
main_Toggle_1_in_2 = 1;
main_Toggle_1_in_3 = 0;
main_Toggle_1_in_4 = NULL;
main_Toggle_1_in_5 = NULL;
main_Toggle_1_in_6 = NULL;
main_Toggle_1_out_1 = 1;
main_Switch_1_out_1 = NULL;
main_Display_1_in_2 = NULL;
main_Display_1_in_3 = "X24,,";
main_Display_1_in_4 = NULL;
main_Display_1_in_5 = NULL;
main_Display_1_in_6 = NULL;
main_Display_1_in_7 = NULL;
main_Display_1_in_8 = NULL;
Executive("product version 3 1 4");
$sync

sequence main();
play;
