/** Performs a forward transform, converting this image into the frequency domain. The image contained in this FHT must be square and its width must be a power of 2. */ public void transform() { transform(false); }
/** Performs an inverse transform, converting this image into the space domain. The image contained in this FHT must be square and its width must be a power of 2. */ public void inverseTransform() { transform(true); }
/** Performs a forward transform, converting this image into the frequency domain. The image contained in this FHT must be square and its width must be a power of 2. */ public void transform() { transform(false); }
/** Performs an inverse transform, converting this image into the space domain. The image contained in this FHT must be square and its width must be a power of 2. */ public void inverseTransform() { transform(true); }
private static FHT createPaddedFFTImage(FloatProcessor nextImage, int paddedSize) { FHT imageFFT = new FHT(Padding.PADDING_ZERO.padToBiggerSquare(nextImage, paddedSize)); imageFFT.setShowProgress(false); imageFFT.transform(); return imageFFT; }
void doForwardTransform(FHT fht) { showStatus("Forward transform"); fht.transform(); showStatus("Calculating power spectrum"); long t0 = System.currentTimeMillis(); ImageProcessor ps = fht.getPowerSpectrum(); if (!(displayFHT||displayComplex||displayRawPS)) displayFFT = true; if (displayFFT) { ImagePlus imp2 = new ImagePlus("FFT of "+imp.getTitle(), ps); if (showOutput) imp2.show((System.currentTimeMillis()-t0)+" ms"); imp2.setProperty("FHT", fht); imp2.setCalibration(imp.getCalibration()); String properties = "Fast Hartley Transform\n"; properties += "width: "+fht.originalWidth + "\n"; properties += "height: "+fht.originalHeight + "\n"; properties += "bitdepth: "+fht.originalBitDepth + "\n"; imp2.setProperty("Info", properties); if (!showOutput) this.imp2 = imp2; } }
/** * Convert an image into a Fourier image with real and imaginary parts * * @param ip - image * @return the real and imaginary parts */ public FloatProcessor[] getComplexFFT(ImageProcessor ip) { FloatProcessor taperedDataImage = getSquareTaperedImage(ip); FHT fht = new FHT(taperedDataImage); fht.setShowProgress( false ); fht.transform(); FloatProcessor[] ret = new FloatProcessor[2]; ImageStack stack1 = fht.getComplexTransform(); ret[0] = ((FloatProcessor) stack1.getProcessor(1)); ret[1] = ((FloatProcessor) stack1.getProcessor(2)); return ret; }
void doForwardTransform(FHT fht) { showStatus("Forward transform"); fht.transform(); showStatus("Calculating power spectrum"); long t0 = System.currentTimeMillis(); ImageProcessor ps = fht.getPowerSpectrum(); if (!(displayFHT||displayComplex||displayRawPS)) displayFFT = true; if (displayFFT) { ImagePlus imp2 = new ImagePlus("FFT of "+imp.getTitle(), ps); if (showOutput) imp2.show((System.currentTimeMillis()-t0)+" ms"); imp2.setProperty("FHT", fht); imp2.setCalibration(imp.getCalibration()); String properties = "Fast Hartley Transform\n"; properties += "width: "+fht.originalWidth + "\n"; properties += "height: "+fht.originalHeight + "\n"; properties += "bitdepth: "+fht.originalBitDepth + "\n"; imp2.setProperty("Info", properties); if (!showOutput) this.imp2 = imp2; } }
public void run(ImageProcessor ip) { slice++; if (done) return; FHT fht = newFHT(ip); if (slice==1) { filter = getFilter(fht.getWidth()); if (filter==null) { done = true; return; } } ((FHT)fht).transform(); customFilter(fht); doInverseTransform(fht, ip); if (slice==1) ip.resetMinAndMax(); if (slice==stackSize) { new ContrastEnhancer().stretchHistogram(imp, 0.0); imp.updateAndDraw(); } IJ.showProgress(1.0); if (Recorder.record && slice==1) Recorder.recordCall("FFT.filter(imp,filter); //see Help/Examples/JavaScript/FFT Filter"); }
public void run(ImageProcessor ip) { slice++; if (done) return; FHT fht = newFHT(ip); if (slice==1) { filter = getFilter(fht.getWidth()); if (filter==null) { done = true; return; } } ((FHT)fht).transform(); customFilter(fht); doInverseTransform(fht, ip); if (slice==1) ip.resetMinAndMax(); if (slice==stackSize) { new ContrastEnhancer().stretchHistogram(imp, 0.0); imp.updateAndDraw(); } IJ.showProgress(1.0); if (Recorder.record && slice==1) Recorder.recordCall("FFT.filter(imp,filter); //see Help/Examples/JavaScript/FFT Filter"); }
FHT fht = new FHT(ip2); fht.setShowProgress(false); fht.transform(); IJ.showProgress(9,20);
FHT fht = new FHT(ip2); fht.setShowProgress(false); fht.transform(); IJ.showProgress(9,20);