float<br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 2:38 PM, Markus Neuner <span dir="ltr"><<a href="mailto:neuner.markus@gmx.net">neuner.markus@gmx.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div text="#000000" bgcolor="#ffffff">
What is the pixel type of "ImageType"?<div><div></div><div class="h5"><br>
<br>
On 04.08.2010 21:11, Ming Chao wrote:
</div></div><blockquote type="cite"><div><div></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 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 href="http://www.kitware.com" target="_blank">www.kitware.com</a>
Visit other Kitware open-source projects at
<a 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 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 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 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>