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

Question: What image file do you use to import Image Data for RTSTRUCT extraction? #2

Open
jmarsil opened this issue Apr 21, 2022 · 1 comment

Comments

@jmarsil
Copy link

jmarsil commented Apr 21, 2022

Just to clarify, you are getting your original patient info from the original structure set?

@jasbach
Copy link
Owner

jasbach commented Apr 22, 2022

Ref: New_Interface_React branch, backend/extract_DICOM_data.py

Lines 58-59 instantiate empty dictionaries, keyed by patient ID, values are sub-dictionaries.

Patient IDs are matched as the function walks through the directory to ensure files are only paired same-patient.

Function uses the SliceLocation value in the metadata for each image to associate that image array with the position along the Z axis (line 88)

For the structure set, the contour data is stored as triplets, where the third value is the position in the Z axis. That value is stripped out of the data (line 159) and used to map that set of points to a Z axis position.

The function build_parallel_arrays at line 183 takes these dictionaries and uses the Z position of image/contour pairs to generate mask arrays that are aligned with the corresponding images.

Note that if the patient orientation is not orthogonal (such that a contour might have different Z-axis values across the points) this won't work. This comes up sometimes in MRI data but I haven't encountered it for CT (all of my training data was CT).

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

2 participants