<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hello , &nbsp; I have just started learning ITK , and I have some difficulty with it .<div>&nbsp;Now £¬I want to fulfill a function with ITK , read from a dcm picture and write to a jpg picture . My code has some problem ,could you please correct it ? the following is my code :</div><div><div><br></div><div>#include "itkImageFileReader.h"</div><div>#include "itkImageFileWriter.h"</div><div>#include "itkRescaleIntensityImageFilter.h"</div><div>#include "itkGDCMImageIO.h"</div><div>#include "itkJPEGImageIO.h"</div><div><br></div><div><br></div><div>void main( )</div><div>{</div><div>&nbsp; typedef signed short InputPixelType;</div><div>&nbsp; const unsigned int &nbsp; InputDimension = 2;</div><div><br></div><div>&nbsp; typedef itk::Image&lt; InputPixelType, InputDimension &gt; InputImageType;</div><div><br></div><div>&nbsp; typedef itk::ImageFileReader&lt; InputImageType &gt; ReaderType;</div><div><br></div><div>&nbsp; ReaderType::Pointer reader = ReaderType::New();</div><div><br></div><div>&nbsp; const char * filename = "C:\\Users\\zhq\\Desktop\\data\\SNAP_CR\\E403434298\\E403434298S1901I301.dcm";</div><div><br></div><div>&nbsp; reader-&gt;SetFileName( filename );</div><div><br></div><div>&nbsp; typedef itk::GDCMImageIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImageIOType;</div><div><br></div><div>&nbsp; ImageIOType::Pointer gdcmImageIO = ImageIOType::New();</div><div><br></div><div>&nbsp; reader-&gt;SetImageIO( gdcmImageIO );</div><div><span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div>&nbsp; reader-&gt;Update();</div><div><br></div><div>&nbsp; typedef itk::ImageFileWriter&lt;InputImageType&gt; &nbsp;WriteType ;</div><div><br></div><div>&nbsp; WriteType::Pointer write = WriteType::New();</div><div><br></div><div>&nbsp; const char * outfile = "C:\\Users\\zhq\\Desktop\\2.dcm";</div><div><br></div><div>&nbsp; write-&gt;SetFileName(outfile);</div><div><br></div><div>&nbsp; typedef itk::JPEGImageIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OutPutIOType ;&nbsp;</div><div><br></div><div>&nbsp; OutPutIOType::Pointer jpgIO = OutPutIOType::New();</div><div><br></div><div>&nbsp; write-&gt;SetImageIO(gdcmImageIO);</div><div><br></div><div>&nbsp; write-&gt;SetInput(reader-&gt;GetOutput());</div><div><br></div><div>&nbsp; write-&gt;Update();</div><div>}</div></div></div>