https://github.com/Gregor-Mendel-Institute/RKP2021-CMT3
Raw File
Tip revision: 89d7e2ea78af1969bb161640baed09296ed2485f authored by Papareddy on 23 April 2021, 11:18:44 UTC
Update README.md
Tip revision: 89d7e2e
SplitChannels_and_convert_2_8bit
run("Close All");


 input = getDirectory("/Users/ranjith.papareddy/Downloads/seed_size/transgenics");
 output = getDirectory("/Users/ranjith.papareddy/Downloads/seed_size/transgenics");

 suffix = ".czi";



processFolder(input);

// function to scan folders/subfolders/files to find files with correct suffix
function processFolder(input) {
	list = getFileList(input);
	list = Array.sort(list);
	for (i = 0; i < list.length; i++) {
		if(File.isDirectory(input + File.separator + list[i]))
			processFolder(input + File.separator + list[i]);
		if(endsWith(list[i], suffix))
			processFile(input, output, list[i]);
	}
}

function processFile(input, output, file) {

  run("Bio-Formats Importer", "open=" + input + list[i] +" ");
  run("8-bit");
  run("Split Channels");
  title = getTitle();
  saveAs("Tiff", output + file + "_tl.tif");
  close();
  title = getTitle();
  saveAs("Tiff", output + file + "_fl.tif");
  close();
  print(title);
  print("Processing: " + input + File.separator + file);
  print("Saving to: " + output);
}
back to top