(FHT fht)
| 205 | } |
| 206 | |
| 207 | void doInverseTransform(FHT fht) { |
| 208 | fht = fht.getCopy(); |
| 209 | doMasking(fht); |
| 210 | showStatus("Inverse transform"); |
| 211 | fht.inverseTransform(); |
| 212 | if (fht.quadrantSwapNeeded) |
| 213 | fht.swapQuadrants(); |
| 214 | fht.resetMinAndMax(); |
| 215 | ImageProcessor ip2 = fht; |
| 216 | if (fht.originalWidth>0) { |
| 217 | fht.setRoi(0, 0, fht.originalWidth, fht.originalHeight); |
| 218 | ip2 = fht.crop(); |
| 219 | } |
| 220 | int bitDepth = fht.originalBitDepth>0?fht.originalBitDepth:imp.getBitDepth(); |
| 221 | if (!showOutput && bitDepth!=24) |
| 222 | bitDepth = 32; |
| 223 | switch (bitDepth) { |
| 224 | case 8: ip2 = ip2.convertToByte(false); break; |
| 225 | case 16: ip2 = ip2.convertToShort(false); break; |
| 226 | case 24: |
| 227 | showStatus("Setting brightness"); |
| 228 | if (fht.rgb==null || ip2==null) { |
| 229 | IJ.error("FFT", "Unable to set brightness"); |
| 230 | return; |
| 231 | } |
| 232 | ColorProcessor rgb = (ColorProcessor)fht.rgb.duplicate(); |
| 233 | rgb.setBrightness((FloatProcessor)ip2); |
| 234 | ip2 = rgb; |
| 235 | fht.rgb = null; |
| 236 | break; |
| 237 | case 32: break; |
| 238 | } |
| 239 | if (bitDepth!=24 && fht.originalColorModel!=null) |
| 240 | ip2.setColorModel(fht.originalColorModel); |
| 241 | String title = imp.getTitle(); |
| 242 | if (title.startsWith("FFT of ")) |
| 243 | title = title.substring(7, title.length()); |
| 244 | ImagePlus imp2 = new ImagePlus("Inverse FFT of "+title, ip2); |
| 245 | imp2.setCalibration(imp.getCalibration()); |
| 246 | if (showOutput) |
| 247 | imp2.show(); |
| 248 | else |
| 249 | this.imp2 = imp2; |
| 250 | } |
| 251 | |
| 252 | void doForwardTransform(FHT fht) { |
| 253 | showStatus("Forward transform"); |
no test coverage detected