http://imagej.273.s1.nabble.com/FFT-and-Inverse-FFT-problem-for-an-Electron-Microscope-Image-tp5013915p5013929.html
Thanks so much for your detailed response which has given me so much to work with with more confidence.
I just tried what you suggested in Image J and I got much further and the reverse FFT made more sense.
Thanks once again.
> On 6 Aug 2015, at 11:05, Michael Schmid <
[hidden email]> wrote:
>
> Hi Mark,
>
> 'swap quadrants' is in the Process>FFT menu.
> For conversion to 16 bits, you have to scale your data first:
> Find the maximum and minimum (including real&imaginary) and take the the highest absolute value, let's call it globalMax
> Then multiply your images with 32767/globalMax, and add 32768.
> In Edit>Options>Conversions, have 'scale when converting' off and with Image>Type, convert to 16 bits.
>
> Then, make sure your external program interprets the image as signed integers (-32768 to +32767)
>
> Note that 16-bit accuracy might be insufficient for some FFTs. Especially the 'DC component', i.e. the zero-frequency component can be very high compared to all other Fourier components. So it makes sense to convert the image to 32 bits (float) first, and then subtract the mean value, before doing the FFT.
>
> ---
> Image Magick: I have no experience with it.
>
> Michael
> ________________________________________________________________
> On Aug 6, 2015, at 11:53, Rosenberg, Mark F wrote:
>
>> Hi Michael,
>> I am excited by your reply. Thank you for that great information.
>> Can you suggest another program that can do a forward transform ? I tried Image Magick but I am struggling to install it but I could persevere !
>> Thanks to your advice I tried the “Complex Fourier Transform” in ImageJ which worked. However, I found I do need to swap the quadrants as you suggest. Can you suggest how I might achieve this please ? Also is there a way of saving the information in 16 bit as the subsequent program only seems to read this.
>> I really feel I have progressed thanks to your help.
>> Thank you once again.
>> Mark
>>
>>
>>> On 6 Aug 2015, at 10:29, Michael Schmid <
[hidden email]> wrote:
>>>
>>> Hi Mark,
>>>
>>> if you have a program (other than ImageJ) that can do a back transform, for sure it can also to the forward transform, so why not open the input image and do the FFT in that program?
>>>
>>> Otherwise, in the FFT options you can select 'Complex Fourier Transform'. These data include all the information, so in principle you could transform them back. Then you just need a program that can read 32-bit float tiffs (or 32-bit raw data) and do the inverse transform based on the complex amplitudes. You might need to swap quadrants if the external program wants to have the origin in the corner, not the center.
>>>
>>> Michael
>>> ________________________________________________________________
>>> On Aug 6, 2015, at 10:15, Rosenberg, Mark F wrote:
>>>
>>>> Hi Michael,
>>>>
>>>> I am so grateful for your detailed reply and the time you have taken with this.
>>>>
>>>> Can you suggest another way in Image J (which does not sound possible based on your reply) or alternative program for saving the FFT so I could transform it back please (apologies since this is an Image J only board )?
>>>>
>>>> This would be a great help to me .
>>>>
>>>> Thank you in advance.
>>>>
>>>> Mark
>>>>> On 6 Aug 2015, at 08:48, Michael Schmid <
[hidden email]> wrote:
>>>>>
>>>>> Hi Mark,
>>>>>
>>>>> this is a restriction of the way how FFTs are handled in ImageJ.
>>>>>
>>>>> What you see as an image is not the FFT but an 8-bit version of the power spectrum with logarithmic grayscale and pixel values 0 and 255 omitted (reserved for filtering/masking). This information is not sufficient for an inverse transform. The FFT (actually an FHT) is a hidden property of the image, not visible for the user.
>>>>>
>>>>> If you save the image as "FFT of..." it actually saves the FFT (strictly speaking, the FHT), not the displayed image, and recovers the displayed image from the FHT data. You may notice that any modifications to the displayed image (e.g. by painting on it, cropping, etc.) are not saved, you will always get what 'Redisplay power spectrum' would show you. If you save it under a different name, ImageJ assumes that you want to save the displayed image (including any modifications by the user), not the FHT.
>>>>>
>>>>> If you want to do any analysis or further processing of FFTs in a different program, apart from measuring peak positions etc., you need a quantitative relationship between the pixel value and the power spectrum. You get this when you select 'Raw Power Spectrum' in the FFT options. Nevertheless, also the power spectrum is insufficient for the inverse transform because the it contains only the amplitude (squared), not the phase of the Fourier components.
>>>>>
>>>>> To summarize, if you want to do further processing on an FFT in ImageJ, save it as "FFT of..." as .tif or .zip, but beware that modifications of the displayed image will get lost. For analysis in other programs, save the power spectrum, but you won't be able to transform it back.
>>>>>
>>>>> Michael
>>>>> ________________________________________________________________
>>>>> On Aug 5, 2015, at 22:21, Rosenberg, Mark F wrote:
>>>>>
>>>>>> I would be so grateful for any direction to this problem I have encountered with Image J please.
>>>>>>
>>>>>> I am using OS X 10.10.3 and Image J 1.50 a.
>>>>>>
>>>>>> If I open an Electron Microscope Image in Image J and generate an FFT and then save the FFT as “FFT of IMAGENAME” in tif or zip format, reopen the FFT in Image J and do an Inverse FFT I can regenerate the original image as expected.
>>>>>>
>>>>>> However, if I rename “FFT of IMAGENAME” to any other name but exclude “FFT of ” in the filename I cannot do an Inverse FFT and if I do an FFT the Image is "lower resolution” .
>>>>>>
>>>>>> I have looked at the Info for FFT and all I can see is a change in ID number from -79 to -80 and a change in “Screen Location” coordinates. I don’t know how to edit these.
>>>>>>
>>>>>> Does anyone have any suggestions how to get round this renaming problem please because I would like to use the filename in a subsequent program which requires a different format ?
>>>>>>
>>>>>> Thank you for your help.
>>>>>>
>>>>>> --
>>>>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>>>
>>>>> --
>>>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>>
>>>> --
>>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>>
>>> --
>>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>>
>> --
>> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html