//Stage_Movement.mac is a macro designed for NIS Elements (Nikon Instruments) and validated with the version 5.21.30 (Build 1489) of the software. //This macro generates an micropatterned array of a desired size on the PVA-coated coverslips by photoablating the coating with an IR laser. //To generate arrays that are larger than the microscope field of view, the macro moves the coverslip in a meander pattern. //Hardcoded Variables //The provided macro creates a micoropatterned array of 5x5 fields of views located next to each other. //These values (PatternLength, PatternHeight, StepSize) are hardcoded and should be adjusted if an array of different size is required. //Two other input parameters required for the macro are file path of a desired pattern ablation protocol and file path of a binary map of the pattern. //These parameters can be either hardcoded or provided through a GUI (the default option). int PatternLength = 5; //Length of the patterned array counted in fields of view int PatternHeight = 5; //Height of the patterned array counted in fields of view double StepSize = 532.48; //Microscope stage translocation between subsequent fields of view measured in micrometers //File paths of pattern ablation protocol (line 17) and binary pattern map (line 18). //To hardcode the location of these files, replace the provided paths with correct ones and uncomment the commands. //char PatternAblationMacroPath[256] = "C:\program files\nis-elements\macros\Pattern_Stimulation.mac"; //char PatternMapPath[256] = "C:\Micropatterning\SquarePattern_100um.tif"; //Then comment or remove the entire module 'GUIs to select the ablation protocol and pattern map' (lines 23-52). int i, j; double delta; //Temporary variables //GUIs to select the ablation protocol and pattern map. char PatternAblationMacroPath[256]; global char PatternMapPath[256]; int returned; //By default NIS macros are saved in 'C:\Program Files\NIS-Elements\Macros\' folder. //Update the file path below to specify the default folder for the NIS Elements macro containing the pattern ablation protocol strcpy(PatternAblationMacroPath, "C:\Program Files\NIS-Elements\Macros\"); returned = SelectFile(PatternAblationMacroPath, "Macro for Pattern Ablation (*.mac;)|*.mac|", 0); if (returned==TRUE) { WaitText(0, PatternAblationMacroPath); } else { WaitText(0, "The user did not select macro for patterning"); } //Path below should be updated to specify the default folder for binary maps of the micropatterns strcpy(PatternMapPath, "C:\"); returned = SelectFile(PatternMapPath, "Pattern Map (*.tif;*.tiff)|*.tif;*.tiff|", 0); if (returned==TRUE) { WaitText(0, PatternMapPath); } else { WaitText(0, "The user did not select pattren map"); } //Micropatterning routine SetVariableValue("delta", StepSize); for(i = 1; i <= PatternLength; i = i + 1) { if(i % 2 == 1) { for(j = 1; j <= PatternHeight; j = j +1) { if(j < PatternHeight) { RunMacro(PatternAblationMacroPath); StgMoveXY(delta, 0, 1); } else { RunMacro(PatternAblationMacroPath); StgMoveXY(0, delta, 1); } } } else { for(j = PatternHeight; j >= 1; j = j -1) { if(j > 1) { RunMacro(PatternAblationMacroPath); StgMoveXY(-1*delta, 0, 1); } else { RunMacro(PatternAblationMacroPath); StgMoveXY(0, delta, 1); } } } }