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

dcm2mha preprocessing #5

Merged
merged 9 commits into from
May 25, 2022
Merged

dcm2mha preprocessing #5

merged 9 commits into from
May 25, 2022

Conversation

joeranbosma
Copy link
Collaborator

Implemented:

  • Allow user-defined scan postprocessing function
  • Made variable names descriptive
  • Allow to disable checking DICOM filenames

- allow user to specify if DICOM filenames should be verified
- make variable names descriptive
- towards user-defined custom pre/postprocessing functions
@joeranbosma joeranbosma requested a review from snorthman May 25, 2022 12:56
@@ -36,6 +37,8 @@ def __init__(
input_path: PathLike,
output_path: PathLike,
settings_path: PathLike,
verify_dicom_filenames: bool = True,
scan_postprocess_func: Optional[Callable[[sitk.Image], sitk.Image]] = None,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request to minimize the number of complicated non-obvious parameters of the constructor, and instead plop these in a **kwargs. so kwargs.get('verify_dicom_filenames', True) instead

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Furthermore, if put in a self.kwargs for example, these can be consumed at an arbitrary point during processing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but better to make a settings class for it. That way, the available settings are clear and can be checked upon initialisation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's tackle this in the Item refactoring?


self.info(f"Collected {plural(total, 'DICOM file')} from {self.valid_items_str()}.", self.get_history_report())

@staticmethod
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Only one usage.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stacked functions make it difficult to follow what's going on, so it there is no benefit, better to keep it simple.

@joeranbosma joeranbosma merged commit 8be955a into main May 25, 2022
@joeranbosma joeranbosma deleted the dcm2mha-preprocessing branch May 25, 2022 17:29
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

Successfully merging this pull request may close these issues.

2 participants