[Dcmlib] Loading twice the same File

Benoit Regrain benoit.regrain at creatis.insa-lyon.fr
Thu Jul 7 17:31:22 CEST 2005


Hi


----- Original Message ----- 
From: "Mathieu Malaterre" <mathieu.malaterre at kitware.com>
To: "Jean-Pierre Roux" <Jean-Pierre.Roux at creatis.insa-lyon.fr>
Cc: <dcmlib at creatis.univ-lyon1.fr>
Sent: Thursday, July 07, 2005 5:13 PM
Subject: Re: [Dcmlib] Loading twice the same File


> Jean-Pierre Roux wrote:
>> Mathieu Malaterre wrote:
>>
>>> JP,
>>>
>>>     Excellent analysis !
>>>     Now maybe you don't remember but you ask me -long time ago- why we 
>>> need to define accessor to set member variables of a class. Here are 
>>> some more examples, the goal is to know when the file is supposed to be 
>>> read (which line du the actual reading):
>>>
>>> #1
>>> gdcm::File file("bla");
>>> file.SetLoadMode(NO_SEQ);
>>>
>>> #2
>>> gdcm::File file();
>>> file.Load("bla");
>>> file.SetLoadMode(NO_SEQ);
>>>
>>> #3
>>> gdcm::File file();
>>> file.SetLoadMode(NO_SEQ);
>>> file.Load("bla");
>>> file.Load("bla2");
>>> file.Load("bla23");
>>> file.Load("bla2");
>>> file.Load("bla");
>>>
>>> #1 and #2 are pretty straigforward to understand, the load mode is never 
>>> taken into account.
>>> #3 Is a completely degenerate case where the user don't know exactly 
>>> what he is doing. But anyway gdcm will read 5 files... and at the end we 
>>> would only need to read one. So far it is ok since the reading a file is 
>>> fast enough not to be troublesome.
>>
>>
>> I do agree with you.
>> I'm gonna add the gdcm::File::SetFileName() method.
>> and a 'bool Modified' private member.

I don't agree with the use of the Modified flag.
It's used in VTK because we have a pipeline... but in gdcm, we can't have 
this
mechanism (it has been discussed in an older mail).

Moreover, if the user change it's file with an other soft and would reread 
its
file with gdcm (without closing this application), the file isn't re read.
I think that's bad !

Benoit 




More information about the Dcmlib mailing list