@vsoch

Signed up since Sept. 12, 2017

Points

Timestamp Points Contributor Ad-hoc References
Sept. 12, 2017 3 @vsoch No Issues #109

Activity

@vsoch commented on issue #109: Broken test: dicom.errors.InvalidDicomError in interface

You could do a dicom.get("PatientId") which will default to None if not present (the Dataset class itself works like a dictionary) and then skip creation. It's very rare for PatientID to be missing, at least for the datasets I've used.
1 year, 3 months ago

@vsoch commented on issue #109: Broken test: dicom.errors.InvalidDicomError in interface

Which metadata fields are you concerned about? This error (afaik) mostly triggers due to the metadata of the file, not header fields (as maybe you are referring to?) One of those fields is called the preamble, which mostly serves to identify the file type (eg, DICM). For example, here is the metadata / preamble of a file: ``` from pydicom import read_file dcm = read_file("AAA_1_11.dcm") # note not using force dcm.__dict__ {'_parent_encoding': 'iso8859', 'file_meta': (0002, 0000) File Meta Information Group Length UL: 94 (0002, 0001) File Meta Information Version OB: b'\x00\x01' (0002, 0002) Media Storage SOP Class UID UI: '' (0002, 0003) Media Storage SOP Instance UID UI: '' (0002, 0010) Transfer Syntax UID UI: Explicit VR Little Endian (0002, 0012) Implementation Class UID UI: '' (0002, 0013) Implementation Version Name SH: '' (0002, 0016) Source Application Entity Title SH: 'ARCHIVE', 'filename': 'AAA_1_11.dcm', 'fileobj_type': <function io.open>, 'is_implicit_VR': False, 'is_little_endian': True, 'preamble': b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'timestamp': 111111111111.0} ``` So if you are needing the preamble (or anything in the file above that isn't present), then you wouldn't want to set force=True. But I'm guessing for most machine learning you just need pixel data, and in this case most dicom (image data and header fields) are still readable with corrupt metadata, so setting force=True is a good idea. I generally do force=True, and then have checks down the line for the specific things that I need.
1 year, 3 months ago

@vsoch commented on issue #109: Broken test: dicom.errors.InvalidDicomError in interface

A lot of images have various bugs that will deem them unreadable (and I'm guessing by the error and suggestion you are using pydicom). Is there any reason you can't set force=True, as suggested by the output?
1 year, 3 months ago