<br>Hi Syrine,<br><br>You should use the SeriesImageReader in order <br>to load a 3D DICOM series from a directory.<br><br><br>Please see the Example:<br><br> Insight/Examples/IO/DicomSeriesReadImageWriter2.cxx<br><br>
<br> Regards,<br><br><br> Luis<br><br><br>------------------------------------------------------------------------------------------<br><div class="gmail_quote">On Mon, Jul 27, 2009 at 9:19 AM, Syrine Sahmim <span dir="ltr"><<a href="mailto:syrine.sahmim@yahoo.fr">syrine.sahmim@yahoo.fr</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><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div>Hi,<br>I try to apply the discrete gaussian filter on a 3D dicom image. So i tried the code below. there's no errors on building step but the problem is after debugging. i don't have result.so i want to know where's the error or even i must do or add some codes to succeed execution.<br>
the code is:<br>#if defined(_MSC_VER)<br>#pragma warning ( disable : 4786 )<br>#endif<br><br>#ifdef __BORLANDC__<br>#define ITK_LEAN_AND_MEAN<br>#endif<br><br>#include "itkImage.h"<br>#include "itkImageFileReader.h"<br>
#include "itkImageFileWriter.h"<br>#include "itkRescaleIntensityImageFilter.h"<br><br><br>#include "itkDiscreteGaussianImageFilter.h"<br><br>int main( int argc, char * argv[] )<br>{argc = 2;<br>
argv[1] = "003F87DA.png";<br> argv[2] = "DA.png";
<br> /*if( argc < 3 ) <br> { <br> std::cerr << "Usage: " << std::endl;<br> std::cerr << argv[0] << " inputImageFile outputImageFile variance maxKernelWidth " << std::endl;<br>
return EXIT_FAILURE;<br> }*/<br><br> <br> typedef float InputPixelType;<br> typedef float OutputPixelType;<br><br> typedef itk::Image< InputPixelType, 3 > InputImageType;<br> typedef itk::Image< OutputPixelType, 3 > OutputImageType;<br>
<br> typedef itk::ImageFileReader< InputImageType > ReaderType;<br><br><br> <br> typedef
itk::DiscreteGaussianImageFilter<<br> InputImageType, OutputImageType > FilterType;<br><br> FilterType::Pointer filter = FilterType::New();<br> <br> ReaderType::Pointer reader = ReaderType::New();<br>
reader->SetFileName( argv[1] );<br> <br> filter->SetInput( reader->GetOutput() );<br> <br> const double gaussianVariance = atof( argv[3] );<br> const unsigned int maxKernelWidth = atoi( argv[4] );<br><br> filter->SetVariance( gaussianVariance );<br>
filter->SetMaximumKernelWidth( maxKernelWidth );<br> <br> <br> filter->Update();<br> <br> typedef unsigned char WritePixelType;<br> typedef itk::Image< WritePixelType, 2 > WriteImageType;<br> typedef itk::RescaleIntensityImageFilter<
<br> OutputImageType, WriteImageType > RescaleFilterType;<br> RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<br><br> rescaler->SetOutputMinimum( 0 );<br> rescaler->SetOutputMaximum( 255 );<br>
<br> typedef itk::ImageFileWriter< WriteImageType > WriterType;<br> WriterType::Pointer writer = WriterType::New();<br> writer->SetFileName( argv[2] );<br> <br> // Software Guide : BeginCodeSnippet<br> rescaler->SetInput( filter->GetOutput() );<br>
writer->SetInput( rescaler->GetOutput() );<br> writer->Update();<br> <br> return EXIT_SUCCESS;<br>}<br><br>Thanks<br><br><br></div></div><br>
</div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
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><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>