[Insight-users] The saved file is always empty

chuc b9003211 at stmail2.cgu.edu.tw
Mon, 8 Mar 2004 19:14:18 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0005_01C40541.8DE16AB0
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

Hello :

I had a problem.When I reading an image successfully and want to save it =
,

however ,the image which I saved is empty (0 kB) .

I don't know where the problem is.      =20
                                                           =20

This is my code:

BOOL CMy1Doc::OnSaveDocument(LPCTSTR lpszPathName)=20
{
 // TODO: Add your specialized code here and/or call the base class
 m_ImageWriter->SetFileName( lpszPathName );
 m_ImageWriter->SetInput(m_image);

 try {
  m_ImageWriter->Update();
 }
 catch (itk::ExceptionObject & err)
 {
  AfxMessageBox("err");
 }

 return CDocument::OnSaveDocument(lpszPathName);
}
                                                                         =
                                            Thanks!!    =20
                                                                         =
                                                                         =
                              
------=_NextPart_000_0005_01C40541.8DE16AB0
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>Hello :</DIV>
<DIV>&nbsp;</DIV>
<DIV>I had a problem.When I reading an image successfully and want to =
save it=20
,</DIV>
<DIV>&nbsp;</DIV>
<DIV>however ,the image which I saved is empty (0 kB) .</DIV>
<DIV>&nbsp;</DIV>
<DIV>I don't know where the problem =
is.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
</DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV>This is my code:</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#ff0000>BOOL CMy1Doc::OnSaveDocument(LPCTSTR =
lpszPathName)=20
<BR>{<BR>&nbsp;// TODO: Add your specialized code here and/or call the =
base=20
class<BR>&nbsp;m_ImageWriter-&gt;SetFileName( lpszPathName=20
);<BR>&nbsp;m_ImageWriter-&gt;SetInput(m_image);</FONT></DIV>
<DIV><FONT color=3D#ff0000></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#ff0000>&nbsp;try=20
{<BR>&nbsp;&nbsp;m_ImageWriter-&gt;Update();<BR>&nbsp;}<BR>&nbsp;catch=20
(itk::ExceptionObject &amp;=20
err)<BR>&nbsp;{<BR>&nbsp;&nbsp;AfxMessageBox("err");<BR>&nbsp;}</FONT></D=
IV><FONT=20
size=3D2>
<DIV><BR><FONT color=3D#ff0000 size=3D3>&nbsp;return=20
CDocument::OnSaveDocument(lpszPathName);<BR>}</FONT></DIV>
<DIV><FONT=20
size=3D3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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