// Macro for calculating percentage of fibrose componnent compared to cardiomyocyte component // taking into account the lumen part or not in batch // // Folder structure: // Source folder selected contains subfolders that contain the images // Result folder, just a folder to store results // // Artificial example of folder structure // C:\temp\rat_images contains subfolders per rat with images like // C:\temp\rat_images\rat1\LV1.tif // C:\temp\rat_images\rat1\RV1.tif // C:\temp\rat_images\rat1\... (etc. for rat1) // C:\temp\rat_images\rat2\LV1.tif // C:\temp\rat_images\rat2\RV1.tif // C:\temp\rat_images\rat2\... (etc. for rat2) // // The colour thresholding algorithm used by this macro is based on an algorithm written by G. Landini (version v1.8) available at: // http://www.dentistry.bham.ac.uk/landinig/software/software.html // // Note: This only works with Black background and White foreground! run("Colors...", "foreground=white background=black selection=yellow"); run("Options...", "iterations=1 black count=1"); // // All image calculation using logical operators take zero values as zero and 255 as "one" in the case below // So inverted luts only change black to white and white to black but zero stays zero meaning black was zero and after // inverting the LUT white is now zero. // Anything measured needs to have value 255 // So 255 or '1' is the object // Creation 18-07-2007 J.A.M. Belien // Update history: // Small modifications with respect to version updates: // - last modification: modified to operate correctly with latest version 1.43u, dd 19-07-2010 // Required ImageJ version requires("1.43u"); dir1 = getDirectory("Choose Source Directory "); list1 = getFileList(dir1); setBatchMode(true); for (my_list1=0; my_list1Save As> run("Measure") run("Text..."); // File>Save As> selectWindow("fibrosis_area"); saveAs("Tiff..."); // File>Save As.\> } }//End of for my_list }//End if list.length>0 }//End of for my_list1