// Macros for ImageJ 1.45m12 written by Michael Cammer on 20110801 for // Preetha Balu [preet3384@gmail.com] in MLD lab for imaging transwells. // These macros were written to register images taken on the Zeiss 710 with the // external detectors and the internal detectors. // 1. Fluorescence images by multiphoton are excited by long wavelength light that focuses at // a different plane than fluorescence or reflection by visible light. In this case, reflection // was imaged at 488 nm and fluorescence by 2 photon excitation at 840 nm. Calibrated using // fluorescence beads, three um of Z axis needs to be added to the multiphoton images to put them // in register in the Z axis with the reflection at 488 nm. The two macros "push slices on beginning of 840nm stack" // and "add slices to end of 488nm stack" are used to make the shift. In the case where Zadjust = 3, the // original Z series were taken at 1 um steps. // 2. Due to the detectors not being aligned, the images may be translated in X and Y. The macro // fixes the XY misregistration. var Zadjust = 3; // number of slices to shift by //================================================================= // Macros to adjust volumes in the Z axis // macro "push slices on beginning of 840nm stack" { run("Colors...", "foreground=white background=black selection=yellow"); setPasteMode("Copy"); setSlice(1); for (i=0; i= 0) position2 = "Left"; if (yoffset < 0) position1 = "Bottom"; if (yoffset >= 0) position1 = "Top"; makeRectangle(xoffset, yoffset, width, height); run("Crop"); run("Canvas Size...", "width="+width+" height="+height+" position="+position1+"-"+position2+" zero"); } // Shift in XY by variable pixels