PK ¹nhN :’ç99IdentifyUpperSurfacev2.ijm// Macro to remove all image voxels except those near the top surface of a 3D image. // requires a thresholded binary image to identify upper surface layer. // Take the resulting image and use as mask on your original image. // Written by Dale Moulding, °×С½ãÂÛ̳ GOS ICH Light Microscopy Facility. February 2017. /* Copyright (c) [2017] [°×С½ãÂÛ̳ written by Dale Moulding] made available for use under the MIT license. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // As first used in the paper: // Galea GL, Nychyk O, Mole MA, Moulding D, Savery D, Nikolopoulou E, Henderson DJ, Greene NDE, Copp AJ. // Vangl2 disruption alters the biomechanics of late spinal neurulation leading to spina bifida in mouse embryos. // Dis Model Mech. 2018 Mar 21;11(3). PMID: 29590636 macro "IdentifyUpperSurface"{ image=getTitle(); getDimensions(width, height, channels, slices, frames); newImage("SurfaceMask", "8-bit white", width, height, slices); selectWindow(image); x = 0; y = 0; pixelvalue = 0; xcoord = newArray(1); ycoord = newArray(1); row = 0; run("Colors...", "foreground=black background=white selection=yellow"); run("Line Width...", "line=10"); // How thick is your surface in pixels? Set line= to double the width of your surface layer. run("Clear Results"); for (z=0; z