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

Adding model to segment bones #134

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open

Adding model to segment bones #134

wants to merge 69 commits into from

Conversation

gattia
Copy link
Contributor

@gattia gattia commented Dec 6, 2022

Starting a pull request while working on this to get feedback. A few things are done differently than other models.

The main things I see myself wanting to do/add are:

  • Create function to build original model so we can skip resampling images up/down?
  • Add a model using same architecture as other stanford_qdess.py models - I think the segmentation performance on this model vs. that are pretty much the same.

@ad12
Copy link
Owner

ad12 commented Aug 14, 2023

@gattia thanks for the PR! could you lint your files and provide some same screenshots of the segmentations

@gattia
Copy link
Contributor Author

gattia commented Aug 29, 2023

Looks like it's getting hungup during CI because Python 3.6 isn't available anymore?

Performed lint on my side + added a photo of the current segs. I'd love to add the two remaining things I have listed on my PR comments, but they're not necessary for this PR and maybe I can do at a later date.

gattia added 30 commits August 16, 2024 16:29
- using non-tuple for multidimensional indexing was deprecated.
- also remove debug print statements
- if scipy >= 2.0.0 then import center_of_mass from scipy.ndimage
- else, if earlier then import from scipy.ndimage.measurements.
- This is only available in python>3.10, therefore removing the
requirement in flake8
- Dont need docs for each specific version...
- Number was due to an error in a specifc version (that numba is now past)
- SITK was due to change in basis (don't accept non-orthonormal) - but this hasnt been an issue running tests upto now.
- np.complex is deprecated.
- Different versions of tensorflow/keras were returning `tuple` or `tf.TensorShape`.
    - Create new function to handle both
    - refactor utils to create this function and the current model loading util functions.
- Codecoverage was throwing rate limiting errors and thus failing CI.
-https://github.com/ad12/DOSMA/actions/runs/10459944994/job/28965177349#step:7:83
- Therefore, add if statement to no push codecov under these circumstances.
The current implementation worked somewhat to fix errors with specific image
acquisitions, but was somewhat specific to sagittal images. It has now been
updated to reformat and then export images to sitk as would be expected
for a specific image acquisition type (e.g., sagittal, coronal, axial).

Essentially, based on if its sag, ax, or coral, the `mv` will be reformatted.
Then, this reformatted image along with the affine/spacing information
a new sitk Image will be created. Finally, if the dicom was not collected in
this standard orientation, the user can still choose to flip the volume along
any of the three axes using boolean flags.

New tests were also written to ensure the reformatting is such that the
image is roughly what it would be like if SITK itself loaded it.
This is based on a simplification of equations 6/7 of the original Sveinsson et al. paper "A Simple Analytic Method for Estimating T2 in the Knee from DESS". This is required because the new Mensa product sequence does not store these header fields.
This is based on a simplification of equations 6/7 of the original Sveinsson et al. paper "A Simple Analytic Method for Estimating T2 in the Knee from DESS". This is required because the new Mensa product sequence does not store these header fields.
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