Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
software:fiji_mvr [2019/07/16 20:50] Jon Daniels added script |
software:fiji_mvr [2019/07/27 18:19] (current) Jon Daniels [Fiji MVR scripts] |
||
|---|---|---|---|
| Line 90: | Line 90: | ||
| // Open MultiView Application | // Open MultiView Application | ||
| IJ.run(" | IJ.run(" | ||
| + | |||
| + | </ | ||
| + | |||
| + | This script did some other pre-processing: | ||
| + | |||
| + | <code groovy> | ||
| + | |||
| + | |||
| + | #@File main_folder (label=" | ||
| + | |||
| + | // Iterate and find all files | ||
| + | import static groovy.io.FileType.FILES | ||
| + | import ij.IJ | ||
| + | import ij.plugin.ChannelSplitter | ||
| + | import ij.io.Opener | ||
| + | |||
| + | import groovyx.gpars.GParsPool | ||
| + | |||
| + | |||
| + | def save_folder = new File(main_folder, | ||
| + | save_folder.mkdir() | ||
| + | |||
| + | |||
| + | def opener = new Opener() | ||
| + | // Find all files. | ||
| + | def all_files = [] | ||
| + | main_folder.eachFile(FILES) { file -> | ||
| + | if(file.getName().endsWith(" | ||
| + | all_files.add(file) | ||
| + | // | ||
| + | } | ||
| + | } | ||
| + | |||
| + | Collections.reverse(all_files) | ||
| + | |||
| + | |||
| + | //all_files = all_files.take(1) | ||
| + | |||
| + | // | ||
| + | // | ||
| + | all_files.each { file -> | ||
| + | //def temp_image = opener.openTiff(file.getParent()+File.separator, | ||
| + | |||
| + | println(" | ||
| + | |||
| + | def temp_image = IJ.openImage(file.getAbsolutePath()) | ||
| + | |||
| + | def images = ChannelSplitter.split(temp_image) | ||
| + | |||
| + | // 0 is ch1 view 1 | ||
| + | // 1 is ch1 view 2 | ||
| + | // 2 is ch2 view 1 | ||
| + | // 3 is ch2 view 2 | ||
| + | | ||
| + | //resave all | ||
| + | def image_name = file.name.take(file.name.lastIndexOf(' | ||
| + | IJ.saveAsTiff(images[0], | ||
| + | IJ.saveAsTiff(images[1], | ||
| + | IJ.saveAsTiff(images[2], | ||
| + | IJ.saveAsTiff(images[3], | ||
| + | images.each{it.close()} | ||
| + | | ||
| + | temp_image.close() | ||
| + | |||
| + | println(" | ||
| + | } | ||
| + | //} | ||
| </ | </ | ||