No subject
Thu May 27 11:52:52 EDT 2010
rescaler. Could anybody take a look? Thanks very much,
Ming
On Wed, Aug 4, 2010 at 9:35 AM, Ming Chao <mingchao2005 at gmail.com> wrote:
> I tried to run FFTImageFilter.cxx to do an FFT of an image. The input image
> is a 512x512, 24 bit thoracic CT image in jpg format. The output of the
> example cxx code are the real and imaginary parts of FFT of the input image.
> However, when I look at the two output images, they are just uniformly
> grey/black, depending on
>
> intensityRescaler->SetOutputMinimum( 0 );
> intensityRescaler->SetOutputMaximum( 255 );
>
> in the code. What did I do wrong? Many thanks,
>
> Ming
>
>
--00163630f7b7f3a322048d043429
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
I checked the complex image FFT created from the input image was fine. Also=
I checked the real and imaginary parts in floating point format, respectiv=
ely. They both are fine. The problem started to happen when rescaling the r=
eal/imaginary image into an interger-type image. Here is part of the rescal=
ing code:<div>
<br></div><div><div>=A0=A0typedef unsigned char WritePixelType;</div><div>=
=A0=A0typedef itk::Image< WritePixelType, Dimension > WriteImageType;=
</div><div>=A0</div><div>=A0=A0typedef itk::RescaleIntensityImageFilter<=
ImageType, WriteImageType > RescaleFilterType;</div>
<div><br></div><div>=A0=A0RescaleFilterType::Pointer intensityRescaler =3D =
RescaleFilterType::New();</div><div>=A0=A0intensityRescaler->SetOutputMi=
nimum( =A00 =A0);</div><div>=A0=A0intensityRescaler->SetOutputMaximum( 2=
55 );</div><div>
=A0</div><div>=A0=A0intensityRescaler->SetInput( realFilter->GetOutpu=
t() );</div><div><br></div><div>=A0=A0typedef itk::ImageFileWriter< Writ=
eImageType > WriterType;</div><div>=A0=A0WriterType::Pointer writer =3D =
WriterType::New();</div>
<div>=A0=A0writer->SetFileName( argv[2] );</div><div>=A0=A0writer->Se=
tInput( intensityRescaler->GetOutput() );</div><div><br></div><div>=A0=
=A0try</div><div>=A0=A0 =A0{</div><div><span class=3D"Apple-tab-span" style=
=3D"white-space:pre"> </span>writer->Update();</div>
<div>=A0=A0 =A0}</div><div>=A0=A0catch( itk::ExceptionObject & excp )</=
div><div>=A0=A0 =A0{</div><div><span class=3D"Apple-tab-span" style=3D"whit=
e-space:pre"> </span>std::cerr << "Error writing the real image=
: " << std::endl;</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>std:=
:cerr << excp << std::endl;</div><div><span class=3D"Apple-tab-=
span" style=3D"white-space:pre"> </span>return EXIT_FAILURE;</div><div>=A0=
=A0 =A0}</div>
<div><br></div><div>=A0=A0typedef itk::ImageRegionConstIterator< WriteIm=
ageType > ConstIteratorType;</div><div>=A0=A0WriteImageType::Pointer Rea=
lImage =3D intensityRescaler->GetOutput();</div><div>=A0=A0ConstIterator=
Type in( RealImage, RealImage->GetRequestedRegion() );</div>
<div>=A0=A0</div><div>=A0=A0for ( in.GoToBegin(); !in.IsAtEnd(); ++in )</di=
v><div>=A0=A0{</div><div><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre"> </span> =A0std::cout << in.Get() << std::endl;</div><di=
v>=A0=A0}</div></div>
<div><br></div><div><br></div><div>From the output I got all zeros....Appar=
ently something wrong with the rescaler. Could anybody take a look? Thanks =
very much,</div><div><br></div><div>Ming</div><div><br><br><div class=3D"gm=
ail_quote">
On Wed, Aug 4, 2010 at 9:35 AM, Ming Chao <span dir=3D"ltr"><<a href=3D"=
mailto:mingchao2005 at gmail.com">mingchao2005 at gmail.com</a>></span> wrote:=
<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-lef=
t:1px #ccc solid;padding-left:1ex;">
I tried to run FFTImageFilter.cxx to do an FFT of an image. The input image=
is a 512x512, 24 bit thoracic CT image in jpg format. The output of the ex=
ample cxx code are the real and imaginary parts of FFT of the input image. =
However, when I look at the two output images, they are just uniformly grey=
/black, depending on=A0<div>
<br></div><div><div>=A0=A0intensityRescaler->SetOutputMinimum( =A00 =A0)=
;</div><div>=A0=A0intensityRescaler->SetOutputMaximum( 255 );</div></div=
><div><br></div><div>in the code. What did I do wrong? Many thanks,</div><d=
iv><br>
</div><font color=3D"#888888">
<div>Ming</div><div><br></div>
</font></blockquote></div><br></div>
--00163630f7b7f3a322048d043429--
More information about the Insight-users
mailing list