Skip to content

itk(GDCM|DCMTK)SeriesFileNames: memory leaks, bad behavior #2735

@PHLF

Description

@PHLF

Hello,

I may have not searched thoroughly but I am surprised not to have found an issue about this:

  • itkGDCMSeriesFileNames seems to suffer from a huge memory leak: it relies on the gdcm::SerieHelper class which... has some issues like this commented call to delete
    And looking at GCDM API doc, its authors seem well aware of the situation:

image

But you know... who read the doc anyway? (Please don't take this too seriously ;) )

So out of luck and running out of time, instead of patching ITK's GDCM I tried to use itkDCMTKSeriesFileNames which does not suffer from memory leaks, but... when you are out of luck you should stop trying:

  • itkDCMTKSeriesFileNames stores SeriesUID in a vector... which means that when you are querying Series UIDs you end up with duplicates (n files of the same series => n duplicated seriesUID): they should be stored in a set/unordered_set (or maybe in a hash map for linking series with their files). Not to mention that it lags behind itkGDCMSeriesFileName in terms of features:
    • The recursive flag is not used
    • The AddSeriesRestriction function is a NOOP
    • The series uids and filenames are recomputed at each call to GetInputFileNames/GetFileNames("seriesUID")/GetSeriesUID but are stored as member variables: they could be used as cache values

Thank you very much for your time and for your work on this library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status:Use_Milestone_BacklogUse "Backlog" milestone instead of label for issues without a fixed deadline

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions