////////////////////////////////////////////////////////////////////////////// // macro 3D flight has some functions useful // for scripting Kai Barthel's Volume viewer plugin // author : Jerome Mutterer ////////////////////////////////////////////////////////////////////////////// var display_mode, axes, markers, lut, scale, zaspect, dist, depth, thresh, angle_x, angle_z, arguments, stack2; macro "3Dflight" { requires("1.33r"); // example run("MRI Stack (528K)"); saveSettings(); stack1 = getImageID; if (nSlices==1) exit("Stack required"); setBatchMode(true); ////////////////////////////////////////////////////////////////////////////// // movements implemented here ////////////////////////////////////////////////////////////////////////////// resetview(); fly (2.5,90,0,5); for (dist =-110; dist <0; dist=dist+20) addview(1); ////////////////////////////////////////////////////////////////////////////// // clean exit setSlice(1); setBatchMode(false); restoreSettings(); print (arguments); // start animation run("Animation Options...", "speed=3 start"); } ////////////////////////////////////////////////////////////////////////////// // functions implemented here ////////////////////////////////////////////////////////////////////////////// function addview(frames) { arguments=""; arguments=arguments+" display_mode="+ display_mode; arguments=arguments+" markers="+ markers; arguments=arguments+" lut="+ lut; arguments=arguments+" axes="+ axes; arguments=arguments+" scale="+ scale; arguments=arguments+" z-aspect="+ zaspect; arguments=arguments+" dist="+ dist; arguments=arguments+" depth="+ depth; arguments=arguments+" thresh="+ thresh; arguments=arguments+" angle_x="+ angle_x; arguments=arguments+" angle_z="+ angle_z; // print (arguments); selectImage(stack1); run("Volume Viewer", arguments ); run("Copy"); w = getWidth; h = getHeight; close(); for (i=0;i