[Dcmlib] concatenation buglet in Python wrapping on Windows: gdcm.Directory with nested dir

Charl Botha c.p.botha at tudelft.nl
Tue Mar 11 17:38:13 CET 2008


Dear Mathieu (and others),

Please see the included Python example.  In short, with gdcm-2-0
branch and some nested dirs:

top_dir\\sub_dir\\some_dicom_file.dcm

Starting gdcm.Directory('top_dir\\') will yield as one of its filenames:
top_dir\\sub_dirsome_dicom_file.dcm
Note the concatenation error between the file name and the sub_dir. If
you start Directory with 'top_dir\\sub_dir\\' there is no problem.

Could you take a look at this?  It should be easily reproducible.

Thanks,
Charl

The example:

import os
d = gdcm.Directory()
# inside of simvis_2008_data there is a directory AbdPel containing
# files IM-*.dcm
nfiles = d.Load('C:\\Documents and
       Settings\\cpbotha\\Desktop\\simvis_2008_data\\', True)
# this following statement returns: C:\Documents and
# Settings\cpbotha\Desktop\simvis_2008_data\AbdPelIM-0001-0001.dcm so
# it finds AbdPel, but somehow when it concatenates the filenames, it
# forgets the slashes between AbdPel and the filename.  If I give it
# AbdPel as start directory, it correctly concatenates
print os.path.normpath(d.GetFilenames()[0])



More information about the Dcmlib mailing list