[IGSTK-Users] igstkImageSpatialObject memory management problem

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 21 16:02:16 EDT 2007


Hi Torleif,

Thanks for sending the files.

I had trouble compiling the code under Linux with gcc4.1,

so I made a couple of changes to get it to compile. It seems
that your declarations of event types were inconsistent.

The "using" statements were also removed, since as we explained
before, they do not fit the coding style of IGSTK.

I also replaced the hard-coded name of the DICOM dataset with
one that you can set from the command line arguments, and
added two tests that to the CMakeLists.txt file so that you can
run them with CTest. Note that one of the tests requires you
to specify the IGSTK_SOURCE_DIR so that it can take a DICOM
dataset out of the Testing/Data directory.

When I run the tests, I don't encounter the error that you reported.
so I'm wondering if something platform specific is going on here...

Please find attached the .tgz file the code of the volumemanager
that includes my modifications.

Could you please give it a try to this modified code and let us know
if you still encounter the same problem  ?

If the problem persists we will need more information about the specific
details of your platform and the versions of the software that you are
using.


    Thanks


       Luis



----------------------------------------------------------------------------------
On 6/20/07, Torleif Sandnes <Torleif.Sandnes at sintef.no> wrote:
>
> Hi Louis.
> Thanks for your reply!
>
> Not using the singleton pattern and instantiating a volumemanager
> with VolumeManager::New(), the problem goes away.
> I have put together a mininal application that reproduces the problem
> with singleton pattern/DICOM image loading and attached it with this
> email.
> In the attached example, the VolumeManager is not in a library, but
> the problem is still present.
>
> Please set the constant  TestVolumeManager::DICOMSERIES_PATH to a
> suitable DICOM MR image.
>
> > 1) Why are you using a Singleton for the volume Manager ?
>
> There should never be more than one volume manager in my application.
>
> > 2) Are you creating a shared library with this class ?
>
> No, the class is in a static library. Also, linking the volumemanager
> directly with the executable, the problem is still present.
> (As in the attached example)
>
> >
> > 3) Can you please send the actual source files and
> >    test files ? something we could compile and run
> >    in order to reproduce the problem.
> >
> >    In the code snippets that you sent we can't find
> >    the declaration of "imageSpatialObject_"... for
> >    example
>
> See the attached files.
>
> > BTW:  Please don't do:
> >
> >         using std::vector;
> >         using std::string;
> >
> >
> > This is equivalent to opening the namespace for these
> > symbols. Instead of doing this, you should always use
> > the std:: namespace specifier.
>
> Well, I agree that the "using" directive shouldn't be used in header
> files and thus pollute every file that includes that header file.
> I can also agree that putting "using" directives on the top of
> implementation, (cpp/cxx), files can be bad, but IMHO it is okay in
> more limited scopes to avoid writing the namespace prefix over and
> over again.
>
> Regards,
> Torleif Sandnes
> Sintef Health Resarch
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20070621/2a1360b5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: volumemanager.tgz
Type: application/x-gzip
Size: 2552 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20070621/2a1360b5/attachment.bin>


More information about the IGSTK-Users mailing list