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

Enhance DICOM Parser to Handle Missing Attributes #22

Open
PranshuLakhotia opened this issue Feb 24, 2025 · 1 comment
Open

Enhance DICOM Parser to Handle Missing Attributes #22

PranshuLakhotia opened this issue Feb 24, 2025 · 1 comment

Comments

@PranshuLakhotia
Copy link

The current DICOM parser in DICOMHawk is not robust enough to handle DICOM files with missing attributes. This can lead to AttributeErrors and potential crashes when processing diverse DICOM files.

Specific problems:

  1. The parser assumes all DICOM files will have standard attributes like PatientID, PatientName, and PatientBirthDate.
  2. When these attributes are missing, the parser raises an AttributeError, potentially crashing the application.
  3. The current implementation doesn't provide a clear way to identify missing data in the parsed output.

Proposed solution:
Modify the parser to use getattr() with default values for all attributes.
Update the parser to return 'N/A' for any missing attributes.
Enhance test cases to verify the parser's behavior with missing attributes.

@PranshuLakhotia
Copy link
Author

@gtheodoridis raising a PR for the implementation of the proposed solution.

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