<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Kit,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">since you didn't use CMake to configure your project, you need to <a href="http://itk.org/ITKExamples/src/IO/ImageBase/RegisterIOFactories/Documentation.html">register IO factories</a> manually.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-family:verdana,sans-serif">Add to the beginning of </span><font face="monospace, monospace">TestMFCITK2015View.cpp</font><font face="verdana, sans-serif">:</font></div><div class="gmail_default" style=""><font face="monospace, monospace">#include "itkMetaImageIOFactory.h"</font><br></div><div class="gmail_default" style=""><font face="verdana, sans-serif">and in </font><font face="monospace, monospace">void CTestMFCITK2015View::OnTestItk()</font><font face="verdana, sans-serif">:</font></div><div class="gmail_default" style=""><font face="monospace, monospace">itk::MetaImageIOFactory::RegisterOneFactory(); //support .mha and .mhd</font><br></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif">With these two changes in runs on my machine.</font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="verdana, sans-serif">HTH</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 7, 2016 at 10:34 AM, Lee, Kyungmoo <span dir="ltr"><<a href="mailto:kyungmoo-lee@uiowa.edu" target="_blank">kyungmoo-lee@uiowa.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div>
<p class="MsoNormal"><span style="color:#1f497d">Dear Matt and all,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">I made a simple MFC example to use ITK (<a href="http://user.engineering.uiowa.edu/~kyungmle/share/TestMFCITK2015.zip" target="_blank">http://user.engineering.uiowa.edu/~kyungmle/share/TestMFCITK2015.zip</a>). I am using MS
Windows 7, MS Visual C++ 2015, ITK-4.9.0, and CMake 3.4.3. When I click [Test]-[ITK] in the menu in Debug, x64 mode, the example clashes in itkImageFileReader.hxx. Can you check my source code? Thanks a lot!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d">Kit<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#1f497d"><u></u> <u></u></span></p>
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Lee, Kyungmoo <br>
<b>Sent:</b> Tuesday, March 01, 2016 4:24 PM<br>
<b>To:</b> 'Matt McCormick' <<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>><br>
<b>Cc:</b> <a href="mailto:community@itk.org" target="_blank">community@itk.org</a><br>
<b>Subject:</b> RE: [ITK] Memory leaks with ITK and MFC<u></u><u></u></p>
</div>
</div><span class="">
<p class="MsoNormal"><u></u> <u></u></p>
<p>Hi Matt,<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>Thank you for replying. I would like to use ITK in my MFC application. It has another memory-related problem in my application (See the following figure). I guess that there is a conflict between ITK smart pointer and MFC structure.
If you fix InsightApplications-4.8.0/ItkMFC, it would be a good reference for my MFC programming. Thank you so much!!!<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>Kit<u></u><u></u></p>
<p><u></u> <u></u></p>
<p><img border="0" width="1359" height="940" src="cid:image001.png@01D17853.C8C49480"><u></u><u></u></p>
<p>-----Original Message-----<br>
From: Matt McCormick [<a href="mailto:matt.mccormick@kitware.com" target="_blank">mailto:matt.mccormick@kitware.com</a>]
<br>
Sent: Tuesday, March 01, 2016 4:04 PM<br>
To: Lee, Kyungmoo <<a href="mailto:kyungmoo-lee@uiowa.edu" target="_blank">kyungmoo-lee@uiowa.edu</a>><br>
Cc: <a href="mailto:community@itk.org" target="_blank">community@itk.org</a><br>
Subject: Re: [ITK] Memory leaks with ITK and MFC<u></u><u></u></p>
<p><u></u> <u></u></p>
</span><p>Hi Kit,<u></u><u></u></p><span class="">
<p><u></u> <u></u></p>
<p>We are in the process of deprecating InsightApplications.<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>However, if you create an MFC application that uses ITK, there should be no issues or memory leaks.<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>HTH,<u></u><u></u></p>
<p>Matt<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>On Mon, Feb 29, 2016 at 3:32 PM, Lee, Kyungmoo <<a href="mailto:kyungmoo-lee@uiowa.edu" target="_blank"><span style="color:windowtext;text-decoration:none">kyungmoo-lee@uiowa.edu</span></a>> wrote:<u></u><u></u></p>
<p>> Dear all,<u></u><u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>> When I run InsightApplications-4.8.0/ItkMFC using ITK-4.8.2, MS
<u></u><u></u></p>
<p>> Windows, and Visual Studio 2010/2012, I found memory leaks. Other
<u></u><u></u></p>
<p>> persons in the following links have the same problem. I cannot find
<u></u><u></u></p>
<p>> any solution on the web. Please help me. Thank you.<u></u><u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>> <a href="https://cmake.org/pipermail/insight-users/2007-July/022885.html" target="_blank">
<span style="color:windowtext;text-decoration:none">https://cmake.org/pipermail/insight-users/2007-July/022885.html</span></a><u></u><u></u></p>
<p>><u></u> <u></u></p>
<p>> <a href="http://itk-insight-users.2283740.n2.nabble.com/No-one-knows-the-ITK-MF" target="_blank">
<span style="color:windowtext;text-decoration:none">http://itk-insight-users.2283740.n2.nabble.com/No-one-knows-the-ITK-MF</span></a><u></u><u></u></p>
<p>> C-memory-leak-problem-td7583950.html<u></u><u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>> Kit<u></u><u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>><u></u> <u></u></p>
<p>> _______________________________________________<u></u><u></u></p>
<p>> Community mailing list<u></u><u></u></p>
<p>> <a href="mailto:Community@itk.org" target="_blank"><span style="color:windowtext;text-decoration:none">Community@itk.org</span></a><u></u><u></u></p>
<p>> <a href="http://public.kitware.com/mailman/listinfo/community" target="_blank">
<span style="color:windowtext;text-decoration:none">http://public.kitware.com/mailman/listinfo/community</span></a><u></u><u></u></p>
<p>><u></u> <u></u></p>
</span></div>
</div>
<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
<br></blockquote></div><br></div>