comparison stack_max_projs.groovy @ 3:24004ccd992e draft default tip

planemo upload for repository https://github.com/lldelisle/tools-lldelisle/tree/master/tools/max_projections_stack_and_upload_omero commit 3c3c4d7009b9ca03d1e88142f090ea70d136f2e8
author lldelisle
date Fri, 13 Dec 2024 09:55:12 +0000
parents 3fd95c753cff
children
comparison
equal deleted inserted replaced
2:3fd95c753cff 3:24004ccd992e
27 * ********************************************* DO NOT MODIFY **************************************************** 27 * ********************************************* DO NOT MODIFY ****************************************************
28 * **************************************************************************************************************** 28 * ****************************************************************************************************************
29 */ 29 */
30 30
31 // Version number = date of last modif 31 // Version number = date of last modif
32 VERSION = "20241213.1" 32 VERSION = "20241213.2"
33 33
34 /** 34 /**
35 * ***************************************************************************************************************** 35 * *****************************************************************************************************************
36 * **************************************** Beginning of the script *********************************************** 36 * **************************************** Beginning of the script ***********************************************
37 * **************************************************************************************************************** 37 * ****************************************************************************************************************
114 } 114 }
115 } 115 }
116 116
117 // Explore the HashMap and save to tiff 117 // Explore the HashMap and save to tiff
118 for(String unique_identifier : samplesMap.keySet()){ 118 for(String unique_identifier : samplesMap.keySet()){
119 println "Merging " + unique_identifier
119 // get the channel map 120 // get the channel map
120 Map<String, ImagePlus> channelsMap = samplesMap.get(unique_identifier) 121 Map<String, ImagePlus> channelsMap = samplesMap.get(unique_identifier)
121 ArrayList<String> channels = [] 122 ArrayList<String> channels = []
122 ArrayList<ImagePlus> current_images = [] 123 ArrayList<ImagePlus> current_images = []
123 int ref_nT = 0 124 int ref_nT = 0
133 all_compatibles = false 134 all_compatibles = false
134 } 135 }
135 } 136 }
136 } 137 }
137 138
139 ImagePlus final_imp
138 if (all_compatibles) { 140 if (all_compatibles) {
139 // Merge all 141 // Merge all
140 ImagePlus merged_imps = Concatenator.run(current_images as ImagePlus[]) 142 ImagePlus merged_imps = Concatenator.run(current_images as ImagePlus[])
141 // Re-order to make a multi-channel, time-lapse image 143 // Re-order to make a multi-channel, time-lapse image
142 ImagePlus final_imp
143 if (channels.size() == 1 && ref_nT == 1) { 144 if (channels.size() == 1 && ref_nT == 1) {
144 final_imp = merged_imps 145 final_imp = merged_imps
145 } else { 146 } else {
146 try { 147 try {
147 final_imp = HyperStackConverter.toHyperStack(merged_imps, channels.size() , 1, ref_nT, "xytcz", "Color") 148 final_imp = HyperStackConverter.toHyperStack(merged_imps, channels.size() , 1, ref_nT, "xytcz", "Color")