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

Make an even more basic example work for runnign Retuve #36

Open
Sharpz7 opened this issue Jun 27, 2024 · 0 comments
Open

Make an even more basic example work for runnign Retuve #36

Sharpz7 opened this issue Jun 27, 2024 · 0 comments
Labels
docs Documentation Additions engineering Engineering

Comments

@Sharpz7
Copy link
Contributor

Sharpz7 commented Jun 27, 2024

Currently the code looks like this:

import pydicom
from radstract.data.dicom import convert_dicom_to_images
from retuve.defaults.hip_configs import default_US
from retuve.defaults.manual_seg import manual_predict_us
from retuve.testdata import Cases, download_case

# Example usage
dcm_file, seg_file = download_case(Cases.ULTRASOUND_DICOM)

dcm = pydicom.dcmread(dcm_file)
images = convert_dicom_to_images(dcm)

hip_data, img, dev_metrics = analyse_hip_2DUS(
    images[0],
    keyphrase=default_US,
    modes_func=manual_predict_us,
    modes_func_kwargs_dict={"seg": seg_file},
)

img.save("2dus.png")

This is not bad, but we should be able to get it down to:

from radstract.funcs import analyse_hip_2DUS_insta
from retuve.testdata import Cases, download_case

# Example usage
dcm_file, _ = download_case(Cases.ULTRASOUND_DICOM)

images = convert_dicom_to_images(dcm)

hip_data, img, dev_metrics = analyse_hip_2DUS_insta(
    images[0],
)

img.save("2dus.png")
@Sharpz7 Sharpz7 added docs Documentation Additions engineering Engineering labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation Additions engineering Engineering
Projects
None yet
Development

No branches or pull requests

1 participant