[ITK] Memory leaks with ITK and MFC

Dženan Zukić dzenanz at gmail.com
Tue Mar 8 18:06:23 EST 2016


Hi Kit,

since you didn't use CMake to configure your project, you need to register
IO factories
<http://itk.org/ITKExamples/src/IO/ImageBase/RegisterIOFactories/Documentation.html>
manually.

Add to the beginning of TestMFCITK2015View.cpp:
#include "itkMetaImageIOFactory.h"
and in void CTestMFCITK2015View::OnTestItk():
itk::MetaImageIOFactory::RegisterOneFactory(); //support .mha and .mhd

With these two changes in runs on my machine.

HTH

On Mon, Mar 7, 2016 at 10:34 AM, Lee, Kyungmoo <kyungmoo-lee at uiowa.edu>
wrote:

> Dear Matt and all,
>
>
>
> I made a simple MFC example to use ITK (
> http://user.engineering.uiowa.edu/~kyungmle/share/TestMFCITK2015.zip). 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!
>
>
>
> Kit
>
>
>
> *From:* Lee, Kyungmoo
> *Sent:* Tuesday, March 01, 2016 4:24 PM
> *To:* 'Matt McCormick' <matt.mccormick at kitware.com>
> *Cc:* community at itk.org
> *Subject:* RE: [ITK] Memory leaks with ITK and MFC
>
>
>
> Hi Matt,
>
>
>
> 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!!!
>
>
>
> Kit
>
>
>
> -----Original Message-----
> From: Matt McCormick [mailto:matt.mccormick at kitware.com
> <matt.mccormick at kitware.com>]
> Sent: Tuesday, March 01, 2016 4:04 PM
> To: Lee, Kyungmoo <kyungmoo-lee at uiowa.edu>
> Cc: community at itk.org
> Subject: Re: [ITK] Memory leaks with ITK and MFC
>
>
>
> Hi Kit,
>
>
>
> We are in the process of deprecating InsightApplications.
>
>
>
> However, if you create an MFC application that uses ITK, there should be
> no issues or memory leaks.
>
>
>
> HTH,
>
> Matt
>
>
>
> On Mon, Feb 29, 2016 at 3:32 PM, Lee, Kyungmoo <kyungmoo-lee at uiowa.edu>
> wrote:
>
> > Dear all,
>
> >
>
> >
>
> >
>
> > When I run InsightApplications-4.8.0/ItkMFC using ITK-4.8.2, MS
>
> > Windows, and Visual Studio 2010/2012, I found memory leaks. Other
>
> > persons in the following links have the same problem. I cannot find
>
> > any solution on the web. Please help me. Thank you.
>
> >
>
> >
>
> >
>
> > https://cmake.org/pipermail/insight-users/2007-July/022885.html
>
> >
>
> > http://itk-insight-users.2283740.n2.nabble.com/No-one-knows-the-ITK-MF
>
> > C-memory-leak-problem-td7583950.html
>
> >
>
> >
>
> >
>
> > Kit
>
> >
>
> >
>
> >
>
> >
>
> > _______________________________________________
>
> > Community mailing list
>
> > Community at itk.org
>
> > http://public.kitware.com/mailman/listinfo/community
>
> >
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160308/868047c9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 150441 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20160308/868047c9/attachment-0001.png>


More information about the Community mailing list