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

Ch10.10 dsets.py Why do you convert to 3x3 matrix? #90

Open
cmosguy opened this issue May 15, 2022 · 0 comments
Open

Ch10.10 dsets.py Why do you convert to 3x3 matrix? #90

cmosguy opened this issue May 15, 2022 · 0 comments

Comments

@cmosguy
Copy link

cmosguy commented May 15, 2022

In the function for reading in the XYZ space of the CT .mhd file, why do you convert to 3x3 matrix?

class Ct:
  def __init__(self, series_uid):
    mhd_path = glob.glob('data-unversioned/part2/luna/subset*/{}.mhd'.format(series_uid))[0]
 
        ct_mhd = sitk.ReadImage(mhd_path)
        # ... line 91
        self.origin_xyz = XyzTuple(*ct_mhd.GetOrigin())
        self.vxSize_xyz = XyzTuple(*ct_mhd.GetSpacing())
        self.direction_a = np.array(ct_mhd.GetDirection()).reshape(3, 3)

I see the text to Converts the directions to an array, and reshapes the nine-element array to it's proper 3x3 matrix but why is 3x3 matrix for xyz?

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