Skip to content
New issue

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

Not support old version DICOM #31

Closed
doumeng opened this issue Nov 15, 2021 · 0 comments
Closed

Not support old version DICOM #31

doumeng opened this issue Nov 15, 2021 · 0 comments

Comments

@doumeng
Copy link

doumeng commented Nov 15, 2021

No DICOM magic number found, but the file appears to be DICOM without a preamble.
Proceeding without caution.No DICOM magic number found, but the file appears to be DICOM without a preamble.
Proceeding without caution.

solution:
use dcmread force=True, and
`def load_dcm_images_from_path(dicom_series_path: str) -> List[Dataset]:
series_data = []
for root, _, files in os.walk(dicom_series_path):
for file in files:
try:
ds = dcmread(os.path.join(root, file), force=True)
if hasattr(ds, 'PixelData'):
series_data.append(ds)

        except Exception:
            # Not a valid DICOM file
            continue

return series_data`

and delete the validation function
` def create_from(dicom_series_path: str, rt_struct_path: str) -> RTStruct:
"""
Method to load an existing rt struct, given related DICOM series and existing rt struct
"""

    series_data = image_helper.load_sorted_image_series(dicom_series_path)
    ds = dcmread(rt_struct_path)
    # RTStructBuilder.validate_rtstruct(ds)
    # RTStructBuilder.validate_rtstruct_series_references(ds, series_data)

    # TODO create new frame of reference? Right now we assume the last frame of reference created is suitable 
    return RTStruct(series_data, ds)`
@doumeng doumeng closed this as completed Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant