<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
What is the pixel type of "ImageType"?<br>
<br>
On 04.08.2010 21:11, Ming Chao wrote:
<blockquote
cite="mid:AANLkTikhDJdV9oASHreBjpTF=eTZHamt_SGer26yXgHy@mail.gmail.com"
type="cite">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 class="Apple-tab-span" style="white-space: pre;"> </span>writer->Update();</div>
<div> }</div>
<div> catch( itk::ExceptionObject & excp )</div>
<div> {</div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span>std::cerr
<< "Error writing the real image: " << std::endl;</div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span>std::cerr
<< excp << std::endl;</div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </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 class="Apple-tab-span" style="white-space: pre;"> </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">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>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>
Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a>
Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>
Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
</blockquote>
</body>
</html>