suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

DA, DT, TM converters #142

Open suever opened 9 years ago

suever commented 9 years ago

From Dimitri....@gmail.com on April 18, 2014 20:11:27

As suggested in discussion "TM, DA converters?" tags DA, DT, TM could be converted to datetime objects: https://groups.google.com/forum/#!topic/pydicom/4IMwZiFgCkk

Original issue: http://code.google.com/p/pydicom/issues/detail?id=142

suever commented 9 years ago

From Dimitri....@gmail.com on April 18, 2014 17:16:47

Please find a proof-of-concept here: https://code.google.com/r/dimitripapadopoulos-pydicom/source/detail?r=11dac0718ead057e40108337096c22f3c4d0b8a4 For now tested on a pair of DICOM files only. Just wanted some feedback before adding comments and testing more extensively.

suever commented 9 years ago

From Dimitri....@gmail.com on April 18, 2014 17:17:56

Significant additional dependencies: re dateutil.tz

suever commented 9 years ago

From Dimitri....@gmail.com on April 27, 2014 06:10:13

I have a new version with a dicom.config.datetime_conversion switch to toggle between previous behavior and conversion to datetime objects. https://code.google.com/r/dimitripapadopoulos-pydicom/source/detail?r=92da991a405fa8c9e16c6147ba32160eeaacfdcb Any additional changes?

suever commented 9 years ago

From darcymason@gmail.com on April 28, 2014 18:42:57

Looks good. Adding unit tests would be much appreciated, for some normal values and for some corner cases. Also I didn't notice anything yet on the writing side -- the existing "round-trip" read/write unit tests (a couple of files maybe) could be copied to do tests with the config conversion on.

suever commented 9 years ago

From Dimitri....@gmail.com on May 01, 2014 03:44:49

I have added unit tests and documentation: https://code.google.com/r/dimitripapadopoulos-pydicom/source/detail?r=7aa18b660782182d6e72564185f796abeae9ef52 Which are the "round-trip" read/write tests to run with the config conversion on?

suever commented 9 years ago

From Dimitri....@gmail.com on May 01, 2014 06:16:16

And by the way, I must admit I'm not sure what needs to be added on the writing side. A standalone function to create a data element from a datetime object? But that's not in the filewriter code, is t?

suever commented 9 years ago

From Dimitri....@gmail.com on May 02, 2014 01:19:49

I seldom use the part of pydicom that writes DICOM files. I've spent a few hours on it and I think I have understood enough of it:

I'm not sure I'm doing the right thing when it comes to initializing data elements from datetime objects - see the new() method of DA, DT, TM classes.

suever commented 9 years ago

From darcymason@gmail.com on May 07, 2014 06:37:47

Hi Dimitri, I've had a look through the code and everything looks good. I'll pull it into my local clone and go through it in more detail.