(FHT fht)
| 250 | } |
| 251 | |
| 252 | void doForwardTransform(FHT fht) { |
| 253 | showStatus("Forward transform"); |
| 254 | long t0 = System.currentTimeMillis(); |
| 255 | fht.transform(); |
| 256 | if (iDisplayRawPS || (displayRawPS&&!IJ.isMacro())) { |
| 257 | ImageProcessor rawps = fht.getRawPowerSpectrum(); |
| 258 | if (rawps!=null) { |
| 259 | swapQuadrants(rawps); |
| 260 | ImagePlus imp2 = new ImagePlus("PS of "+fileName, rawps); |
| 261 | enhanceContrast(imp2); |
| 262 | imp2.show(); |
| 263 | } |
| 264 | } |
| 265 | if (iDisplayFHT || (displayFHT&&!IJ.isMacro())) { |
| 266 | ImageProcessor ip2 = fht.duplicate(); |
| 267 | swapQuadrants(ip2); |
| 268 | ImagePlus imp2 = new ImagePlus("FHT of "+FFT.fileName, ip2); |
| 269 | enhanceContrast(imp2); |
| 270 | setImageProperties(imp2, "Fast Hartley Transform"); |
| 271 | imp2.show(); |
| 272 | } |
| 273 | if (iDisplayComplex || (displayComplex&&!IJ.isMacro())) { |
| 274 | ImageStack ct = fht.getComplexTransform(); |
| 275 | ImagePlus imp2 = new ImagePlus("Complex of "+FFT.fileName, ct); |
| 276 | enhanceContrast(imp2); |
| 277 | setImageProperties(imp2, "Complex Fourier Transform"); |
| 278 | imp2.show(); |
| 279 | } |
| 280 | if (!(iDisplayFHT || iDisplayComplex || iDisplayRawPS)) |
| 281 | iDisplayFFT = true; |
| 282 | if (iDisplayFFT) { |
| 283 | showStatus("Calculating power spectrum"); |
| 284 | ImageProcessor ps = fht.getPowerSpectrum(); |
| 285 | String title = "FFT of "+imp.getTitle(); |
| 286 | ImagePlus imp2 = new ImagePlus(title, ps); |
| 287 | if (showOutput) { |
| 288 | ImagePlus fftImage = reuseWindow?WindowManager.getImage(title):null; |
| 289 | if (fftImage!=null) |
| 290 | fftImage.setImage(imp2); |
| 291 | else |
| 292 | imp2.show((System.currentTimeMillis()-t0)+" ms"); |
| 293 | } |
| 294 | fht.powerSpectrumMean = ps.getStats().mean; |
| 295 | imp2.setProperty("FHT", fht); |
| 296 | imp2.setCalibration(imp.getCalibration()); |
| 297 | String properties = "Fast Hartley Transform\n"; |
| 298 | properties += "width: "+fht.originalWidth + "\n"; |
| 299 | properties += "height: "+fht.originalHeight + "\n"; |
| 300 | properties += "bitdepth: "+fht.originalBitDepth + "\n"; |
| 301 | imp2.setProperty("Info", properties); |
| 302 | if (!showOutput) |
| 303 | this.imp2 = imp2; |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | private void setImageProperties(ImagePlus imp, String type) { |
| 308 | imp.setProp(" ", type); |
no test coverage detected