The error message you got says it all: fft2
is not meant to work with uint16
input type.
Convert Y to double
before you process it:
Y = im2double( Y );
or even just
Y = double( Y );
Question
I want to perform a 2 dimensional fourier transform on an image slice of a cranial MRI. I have tried the following codes and have not been successful: (error messages included below)
>> clear all
>>
>> info = dicominfo('MR000026.dcm');
Y = dicomread(info);
J=imadjust(Y,stretchlim(Y),[0 1]);
F = fftshift(fft2(fftshift(J)));
Undefined function 'fftn' for input arguments of type 'int16'.
Error in fft2 (line 19)
f = fftn(x);
>> info = dicominfo('MR000026.dcm');
Y = dicomread(info);
F = fftshift(fft2(fftshift(Y)));
Undefined function 'fftn' for input arguments of type 'int16'.
Error in fft2 (line 19)
f = fftn(x);
>> info = dicominfo('MR000026.dcm');
Y = dicomread(info);
F = fft2(Y);
Undefined function 'fftn' for input arguments of type 'int16'.
Error in fft2 (line 19)
f = fftn(x);
Solution
The error message you got says it all: fft2
is not meant to work with uint16
input type.
Convert Y to double
before you process it:
Y = im2double( Y );
or even just
Y = double( Y );