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

Projective Spatial Transformer: preliminary code explore #26

Open
msrepo opened this issue May 22, 2023 · 3 comments
Open

Projective Spatial Transformer: preliminary code explore #26

msrepo opened this issue May 22, 2023 · 3 comments
Assignees

Comments

@msrepo
Copy link
Collaborator

msrepo commented May 22, 2023

Quick setup and run https://github.com/gaocong13/Projective-Spatial-Transformers

RuntimeError: Subtraction, the - operator, with a bool tensor is not supported. If you are trying to invert a mask, use the ~ or logical_not() operator instead.
from https://stackoverflow.com/questions/65637222/runtimeerror-subtraction-the-operator-with-a-bool-tensor-is-not-supported
replace

    mask_c0 = mask_d2 * mask_d0_d1
    mask_c1 = mask_d2 * (1 - mask_d0_d1)
    mask_c2 = (1 - mask_d2) * mask_d0_nd1
    mask_c3 = (1 - mask_d2) * (1 - mask_d0_nd1)

with

    mask_c0 = mask_d2 * mask_d0_d1
    mask_c1 = mask_d2 * ~(mask_d0_d1)
    mask_c2 = ~(mask_d2) * mask_d0_nd1
    mask_c3 = ~(mask_d2) * ~(mask_d0_nd1) 
@msrepo msrepo self-assigned this May 22, 2023
@msrepo
Copy link
Collaborator Author

msrepo commented May 22, 2023

Tasks

  • Apply ProST to obtain X-ray from CT

@msrepo
Copy link
Collaborator Author

msrepo commented May 22, 2023

Understand these predefined hard-coded geometry

    # Pre-defined hard coded geometry
    src_det = 1020
    iso_center = 400
    det_size = 128
    pix_spacing = 0.73 * 512 / det_size #0.194*1536 / det_size
    step_size = 1.75
    vol_size = CT_vol.shape[0]

    norm_factor = (vol_size * vol_spacing / 2)
    src = (src_det - iso_center) / norm_factor
    det = -iso_center / norm_factor
    pix_spacing = pix_spacing / norm_factor
    step_size = step_size / norm_factor

Normalizing factor: normalizes the input volume such that it occupies the normalized physical space (-1,1)
image

@msrepo
Copy link
Collaborator Author

msrepo commented May 24, 2023

Expected:
s0004_hip-ap
Got:
s0004_hip_projection
Using Camera Parameters:
image

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

1 participant