We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utils.files.is_dicom
Inspired by contrib-pydicom:
https://github.com/pydicom/contrib-pydicom/blob/cbd27f1ac523863aeba820edf796bf040d63993f/input-output/dicom_model/dicom_dir.py#L43-L50
Looks like the following should complement medio's is_dicom function:
is_dicom
def is_dcm(filename): with open(filename, 'rb') as f: x = f.read(132) return x[128:] == b"DICM"
It is particularly useful since many times dicom files lack any extension. I checked the above is_dcm on some data and it looks reliable.
is_dcm
With that, we can change the default dicom reader backend to pydicom (single and series).
Edit: Even better, use pydicom's built-in is_dicom function (equivalent to the above is_dcm function).
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Inspired by contrib-pydicom:
https://github.com/pydicom/contrib-pydicom/blob/cbd27f1ac523863aeba820edf796bf040d63993f/input-output/dicom_model/dicom_dir.py#L43-L50
Looks like the following should complement medio's
is_dicom
function:It is particularly useful since many times dicom files lack any extension.
I checked the above
is_dcm
on some data and it looks reliable.With that, we can change the default dicom reader backend to pydicom (single and series).
Edit:
Even better, use pydicom's built-in
is_dicom
function (equivalent to the aboveis_dcm
function).The text was updated successfully, but these errors were encountered: