<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>&nbsp;
<div>&nbsp;
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b>&nbsp;Mittwoch, 24. Juli 2013 um 11:23 Uhr<br/>
<b>Von:</b>&nbsp;&#31456;&#24378; &lt;15891495523@126.com&gt;<br/>
<b>An:</b>&nbsp;&quot;Robert Haase&quot; &lt;robert_haase@gmx.de&gt;<br/>
<b>Betreff:</b>&nbsp;Re:Aw: [Insight-users] I want to fulfill a function with ITK , read from a dcm picture and write to a jpg picture .Please help !</div>

<div name="quoted-content">
<div style="line-height: 1.7;color: rgb(0,0,0);font-size: 14.0px;font-family: arial;">Dear:
<div>&nbsp; &nbsp; &nbsp; Thank you for your reply
<div>&nbsp; &nbsp; &nbsp; &nbsp;I am sorry , &nbsp;the problem you pointed out is due to my carelessness .&nbsp;</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp;some errors in my code should be corrected are :</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;const char * outfile = &quot;C:&#92;&#92;Users&#92;&#92;zhq&#92;&#92;Desktop&#92;&#92;2.jpg&quot;;</div>

<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; writer-&gt;SetImageIO( jpgIO );</div>

<div>&nbsp; &nbsp; &nbsp; when I run the program , the result is :</div>

<div><img src="cid:77fc34db&#36;1&#36;1400ffd4049&#36;Coremail&#36;15891495523&#36;126.com"/><br/>
<br/>
<br/>
<br/>
&nbsp;
<div>&nbsp;</div>

<div id="divNeteaseMailCard">&nbsp;</div>
<br/>
At 2013-07-24 17:11:28,&quot;Robert&nbsp;Haase&quot;&nbsp;&lt;robert_haase@gmx.de&gt; wrote:
<blockquote id="isReplyContent" style="PADDING-LEFT: 1.0ex;MARGIN: 0.0px 0.0px 0.0px 0.8ex;BORDER-LEFT: rgb(204,204,204) 1.0px solid;">
<div style="font-family: Verdana;font-size: 12.0px;">
<div>
<div>Dear ,</div>

<div>&nbsp;</div>

<div>could you please describe the problem you have with your code? The only things I see immediately is that you should write</div>

<div>&nbsp;</div>

<div><br/>
&nbsp; const char * outfile = &quot;C:&#92;&#92;Users&#92;&#92;zhq&#92;&#92;Desktop&#92;&#92;2.jpg&quot;;</div>

<div>&nbsp;</div>

<div>...</div>

<div>&nbsp;</div>

<div>write-&gt;SetImageIO(jpgIO);</div>

<div>
<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>Best,</div>

<div>Robert</div>

<div>&nbsp;</div>

<div style="margin: 10.0px 5.0px 5.0px 10.0px;padding: 10.0px 0 10.0px 10.0px;border-left: 2.0px solid rgb(195,217,229);">
<div style="margin: 0 0 10.0px 0;"><b>Gesendet:</b>&nbsp;Mittwoch, 24. Juli 2013 um 10:31 Uhr<br/>
<b>Von:</b>&nbsp;&#31456;&#24378; &lt;<a href="15891495523@126.com" target="_parent">15891495523@126.com</a>&gt;<br/>
<b>An:</b>&nbsp;<a href="insight-users@itk.org" target="_parent">insight-users@itk.org</a><br/>
<b>Betreff:</b>&nbsp;[Insight-users] I want to fulfill a function with ITK , read from a dcm picture and write to a jpg picture .Please help !</div>

<div>
<div style="line-height: 1.7;color: rgb(0,0,0);font-size: 14.0px;font-family: arial;">Hello , &nbsp; I have just started learning ITK , and I have some difficulty with it .
<div>&nbsp;Now &#65292;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>&nbsp;</div>

<div>#include &quot;itkImageFileReader.h&quot;</div>

<div>#include &quot;itkImageFileWriter.h&quot;</div>

<div>#include &quot;itkRescaleIntensityImageFilter.h&quot;</div>

<div>#include &quot;itkGDCMImageIO.h&quot;</div>

<div>#include &quot;itkJPEGImageIO.h&quot;</div>

<div>&nbsp;</div>

<div>&nbsp;</div>

<div>void main( )</div>

<div>{</div>

<div>&nbsp; typedef signed short InputPixelType;</div>

<div>&nbsp; const unsigned int &nbsp; InputDimension = 2;</div>

<div>&nbsp;</div>

<div>&nbsp; typedef itk::Image&lt; InputPixelType, InputDimension &gt; InputImageType;</div>

<div>&nbsp;</div>

<div>&nbsp; typedef itk::ImageFileReader&lt; InputImageType &gt; ReaderType;</div>

<div>&nbsp;</div>

<div>&nbsp; ReaderType::Pointer reader = ReaderType::New();</div>

<div>&nbsp;</div>

<div>&nbsp; const char * filename = &quot;C:&#92;&#92;Users&#92;&#92;zhq&#92;&#92;Desktop&#92;&#92;data&#92;&#92;SNAP_CR&#92;&#92;E403434298&#92;&#92;E403434298S1901I301.dcm&quot;;</div>

<div>&nbsp;</div>

<div>&nbsp; reader-&gt;SetFileName( filename );</div>

<div>&nbsp;</div>

<div>&nbsp; typedef itk::GDCMImageIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ImageIOType;</div>

<div>&nbsp;</div>

<div>&nbsp; ImageIOType::Pointer gdcmImageIO = ImageIOType::New();</div>

<div>&nbsp;</div>

<div>&nbsp; reader-&gt;SetImageIO( gdcmImageIO );</div>

<div>&nbsp;</div>

<div>&nbsp; reader-&gt;Update();</div>

<div>&nbsp;</div>

<div>&nbsp; typedef itk::ImageFileWriter&lt;InputImageType&gt; &nbsp;WriteType ;</div>

<div>&nbsp;</div>

<div>&nbsp; WriteType::Pointer write = WriteType::New();</div>

<div>&nbsp;</div>

<div>&nbsp; const char * outfile = &quot;C:&#92;&#92;Users&#92;&#92;zhq&#92;&#92;Desktop&#92;&#92;2.dcm&quot;;</div>

<div>&nbsp;</div>

<div>&nbsp; write-&gt;SetFileName(outfile);</div>

<div>&nbsp;</div>

<div>&nbsp; typedef itk::JPEGImageIO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;OutPutIOType ;&nbsp;</div>

<div>&nbsp;</div>

<div>&nbsp; OutPutIOType::Pointer jpgIO = OutPutIOType::New();</div>

<div>&nbsp;</div>

<div>&nbsp; write-&gt;SetImageIO(gdcmImageIO);</div>

<div>&nbsp;</div>

<div>&nbsp; write-&gt;SetInput(reader-&gt;GetOutput());</div>

<div>&nbsp;</div>

<div>&nbsp; write-&gt;Update();</div>

<div>}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</div></div></body></html>