<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
I just looked at the code in the example and all seems working (at
leasts for me).<br>
What do you expect as output?<br>
Change the "WriteImageType" to float or double and try it again.<br>
Open the image with paraview, imagej or any other suited image viewer.<br>
It may be useful to take the log of the real and complex images for a
better contrast.<br>
<br>
On 04.08.2010 21:45, Ming Chao wrote:
<blockquote
cite="mid:AANLkTi=8g=ytZzm6CKFmNmUDQtGiCdmnfoYv9Dxx_GsN@mail.gmail.com"
type="cite">float<br>
<br>
<div class="gmail_quote">On Wed, Aug 4, 2010 at 2:38 PM, Markus
Neuner <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:neuner.markus@gmx.net">neuner.markus@gmx.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff">What is the pixel type of
"ImageType"?
<div>
<div class="h5"><br>
<br>
On 04.08.2010 21:11, Ming Chao wrote:
</div>
</div>
<blockquote type="cite">
<div>
<div class="h5">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, respectively. They both are fine. The problem started to
happen when rescaling the real/imaginary image into an interger-type
image. Here is part of the rescaling code:
<div><br>
</div>
<div>
<div> typedef unsigned char WritePixelType;</div>
<div> typedef itk::Image< WritePixelType, Dimension >
WriteImageType;</div>
<div> </div>
<div> typedef itk::RescaleIntensityImageFilter<ImageType,
WriteImageType > RescaleFilterType;</div>
<div><br>
</div>
<div> RescaleFilterType::Pointer intensityRescaler =
RescaleFilterType::New();</div>
<div> intensityRescaler->SetOutputMinimum( 0 );</div>
<div> intensityRescaler->SetOutputMaximum( 255 );</div>
<div> </div>
<div> intensityRescaler->SetInput( realFilter->GetOutput()
);</div>
<div><br>
</div>
<div> typedef itk::ImageFileWriter< WriteImageType >
WriterType;</div>
<div> WriterType::Pointer writer = WriterType::New();</div>
<div> writer->SetFileName( argv[2] );</div>
<div> writer->SetInput( intensityRescaler->GetOutput() );</div>
<div><br>
</div>
<div> try</div>
<div> {</div>
<div><span style="white-space: pre-wrap;"> </span>writer->Update();</div>
<div> }</div>
<div> catch( itk::ExceptionObject & excp )</div>
<div> {</div>
<div><span style="white-space: pre-wrap;"> </span>std::cerr
<< "Error writing the real image: " << std::endl;</div>
<div><span style="white-space: pre-wrap;"> </span>std::cerr
<< excp << std::endl;</div>
<div><span style="white-space: pre-wrap;"> </span>return
EXIT_FAILURE;</div>
<div> }</div>
<div><br>
</div>
<div> typedef itk::ImageRegionConstIterator< WriteImageType
>
ConstIteratorType;</div>
<div> WriteImageType::Pointer RealImage =
intensityRescaler->GetOutput();</div>
<div> ConstIteratorType in( RealImage,
RealImage->GetRequestedRegion() );</div>
<div> </div>
<div> for ( in.GoToBegin(); !in.IsAtEnd(); ++in )</div>
<div> {</div>
<div><span style="white-space: pre-wrap;"> </span> std::cout
<< in.Get() << std::endl;</div>
<div> }</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>From the output I got all zeros....Apparently 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="gmail_quote">On Wed, Aug 4, 2010 at 9:35 AM, Ming
Chao <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mingchao2005@gmail.com" target="_blank">mingchao2005@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; 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 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
<div><br>
</div>
<div>
<div> intensityRescaler->SetOutputMinimum( 0 );</div>
<div> intensityRescaler->SetOutputMaximum( 255 );</div>
</div>
<div><br>
</div>
<div>in the code. What did I do wrong? Many thanks,</div>
<div><br>
</div>
<font color="#888888">
<div>Ming</div>
<div><br>
</div>
</font></blockquote>
</div>
<br>
</div>
</div>
</div>
<pre><fieldset></fieldset>
_____________________________________
Powered by <a moz-do-not-send="true" href="http://www.kitware.com"
target="_blank">www.kitware.com</a>
Visit other Kitware open-source projects at
<a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
target="_blank">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a moz-do-not-send="true"
href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a>
Please keep messages on-topic and check the ITK FAQ at:
<a moz-do-not-send="true" href="http://www.itk.org/Wiki/ITK_FAQ"
target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a moz-do-not-send="true"
href="http://www.itk.org/mailman/listinfo/insight-users"
target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
</blockquote>
</div>
</blockquote>
</div>
<br>
</blockquote>
</body>
</html>