[Insight-developers] type of modification time

M.Staring at lumc.nl M.Staring at lumc.nl
Mon Sep 24 07:45:34 EDT 2012


Hi all,

The type of the modified time in ITK (m_MTime in Object) is itk::TimeStamp which in turn has a member:

unsigned long m_ModifiedTime;

So this member can count in the range 0 till ulong max, which is about 4 x 10^9.

For my particular case this member overflows. I'm using the itk::VectorContainer and every time an item is inserted Modified() is called which increases the unsigned long value. In my case I am using minimal spanning trees and a simple algorithm would have N^2 inserts with N the number of points of the tree, which is about 5000 for my application so 5000^2 = 25 x 10^6. Then I re-use the container in an iterative algorithm, which makes the problem worse. I can do about 85 iterations and then it overflows. (This causes my filter to never update anymore, even if  I explicitly call modified on it, or on the output, or call ResetPipeline().)

A solution to this issue would be to use an unsigned long long for this variable. From itkIntTypes.h there is the typedef SizeValueType which may be appropriate.

Before I start preparing a patch: Does this seem like a good approach to you?

Regards, Marius

Marius Staring, PhD
Division of Image Processing (LKEB)
Department of Radiology
Leiden University Medical Center
PO Box 9600, 2300 RC Leiden, The Netherlands
phone: +31 (0)71 526 2137, fax: +31 (0)71 524 8256
m.staring at lumc.nl

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20120924/5a3638c9/attachment.htm>


More information about the Insight-developers mailing list