// motionStructure-v2 // this version replaces and extends the latest imageToObject 0.1 // Description: // This macro creates a digital 3D object from an image sequence // It asks for a directory path, then impots all images, converts them to 8-bit, substracts background, applies a smooth filter and runs the 3D viewer with some predefined parameters // To run the macro: open ImageJ, from the top menu Plugin, select Macros then Run… choose the file from your local disk. // For information on how to use imageJ, see // http://rsbweb.nih.gov/ij/ // Created: October 29, 2015, in Paris. // By: Everardo Reyes Garcia // http://ereyes.net dir = getDirectory("Choose image sequence"); list = getFileList(dir); print("directory contains " + list.length + " files"); run("Image Sequence...", dir); name = getTitle; print(name); run("8-bit"); run("Subtract Background...", "rolling=50 stack"); run("Smooth", "stack"); // Display as Volume (last parameter in 0). Goes faster if no immediate need to export as OBJ run("3D Viewer"); call("ij3d.ImageJ3DViewer.add", name, "None", name, "0", "true", "true", "true", "2", "0"); selectWindow(name); // Display as Surface (last parameter in 2). 1 as threshold value… higher values mean less shapes because only pixels above such threshold are taken into account. //run("3D Viewer"); //call("ij3d.ImageJ3DViewer.add", name, "None", name, "1", "true", "true", "true", "2", "2"); //selectWindow(name); // Display as Surface (last parameter in 2). 10 as threshold value… higher values handle better large images sequences //run("3D Viewer"); //call("ij3d.ImageJ3DViewer.add", name, "None", name, "10", "true", "true", "true", "2", "2"); //selectWindow(name);