Skip to content

Add base dcm class#7

Draft
Illviljan wants to merge 29 commits intodkuschmierz:mainfrom
Illviljan:align_classes_numpy_like
Draft

Add base dcm class#7
Illviljan wants to merge 29 commits intodkuschmierz:mainfrom
Illviljan:align_classes_numpy_like

Conversation

@Illviljan
Copy link
Copy Markdown
Contributor

@Illviljan Illviljan commented Jan 2, 2023

Example attempt to align return types for values.

The API is inspired by numpy and xarray.

High level ideas:

  • Inherit/use only a single dcm class, reduces typo risks etc, Risk of getting too much clutter.
  • Follow typical conventions popular in data analysis tools like numpy /xarray
    • Use self.shape instead of x_dimension y_dimension. -> Following numpy.array.shape standard.
    • Use list of list for WERT values. -> Easy to initialize numpy.array then.
    • Use tuple of lists for axis values. -> Matching order of numpy.array.shape-tuples
    • Move remaining metadata to a self.attrs dict. -> In similar fashion as xarray/pandas
  • A lot of type hints to clarify intention of methods and attributes.

Only maps works in this form for now. I want some discussion before going all in on this.

References:
https://www.etas.com/download-center-files/products_ASCET_Software_Products/TechNote_DCM_File_Formats.pdf

@dkuschmierz
Copy link
Copy Markdown
Owner

Wouldn't it be better to directly use numpy within the project instead of generating compatible interfaces?

@Illviljan
Copy link
Copy Markdown
Contributor Author

Illviljan commented Jan 8, 2023

That's ok as well. I was just thinking dcmReader didn't wan't to have numpy as a dependency. Should numpy be a dependency?

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