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

Ts types possible improvement #28

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

caoshouse
Copy link

Added DICOM VRs in order to easily get/set Dataset Elements (including sequences)
For instance:
`
new Dataset({fakeProperty:'anyValue})
// throws a tsc error

const ds=new Dataset({})
ds.setElement('PatientName',1234)
// throws a tsc error

const ds=new Dataset({})
ds.setElement('PatientName','JOHN^DOE')
// it works

const ds=new Dataset({})
ds.getElement('ReferencedImageSequence').push({...blahblah})
// it works

`

@caoshouse caoshouse changed the title Add files via upload Ts types possible improvement Sep 21, 2022
@PantelisGeorgiadis
Copy link
Owner

Hello @caoshouse! Thank you for this PR!
I was wondering... is there any way to extract the datasetElements information from dcmjs's dictionary?
I'm not a huge fan of keeping the same (and large) information twice.

@PantelisGeorgiadis PantelisGeorgiadis self-assigned this Sep 22, 2022
@PantelisGeorgiadis PantelisGeorgiadis added the enhancement New feature or request label Sep 22, 2022
@caoshouse
Copy link
Author

Hello @PantelisGeorgiadis
I just published a simple package here:
https://www.npmjs.com/package/@caoshouse/dcmjs-dictionary
It also generates a .d.ts file if needed

Anyway, I found the dictionary data here: dcmjs.data.DicomMetaDictionary.dictionary

@PantelisGeorgiadis
Copy link
Owner

Great work @caoshouse!
So, if I understand correctly, there is no way to generate and use the types dynamically, right? We need to somehow (re)include the dictionary.

@caoshouse
Copy link
Author

Maybe I will have a solution to automatically update definition files by grabbing data from nema website.
Almost easy
Probably Next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants