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

issue with saggital MR scans #32

Open
ceps1986 opened this issue Nov 16, 2021 · 4 comments
Open

issue with saggital MR scans #32

ceps1986 opened this issue Nov 16, 2021 · 4 comments

Comments

@ceps1986
Copy link

I have a 3D MR series with 160 dicom files. x, y, z dims for the series are (160, 256, 256). If I've followed the code properly, i think it assumes that image series files are acquired in z direction, is that a correct?

@ceps1986
Copy link
Author

terrific tool by the way, first time I've run into issues using it!

@asim-shrestha
Copy link
Contributor

Hi @ceps1986, glad you like the tool!

What exactly is the issue you were having? Were you expecting it to be acquired in a different manner? Would you also mind clarifying what you mean by acquired? We don't do much when the DICOM files are loaded in, it is mostly just handled by Pydicom. We do assume that the contour points are arranged in [x, y, z].

@ceps1986
Copy link
Author

Hi @asim-shrestha, thanks for the prompt response.

Here's what I think is happening... (I haven't gone down the rabbit hole just yet):

What exactly is the issue you were having?

  • rtstruct.add_roi requires mask.shape[-1] to be equal to the number of DICOM files. if I reshape my mask (i.e. from [160, 256, 256] -> [256, 256, 160]) then the contour points are being place on the wrong axis in get_contours_coords (
    def get_contours_coords(roi_data: ROIData, series_data):
    )
    Doing this writes a RTSTRUCT file, but the contours in the file do not match the image space so several dicom viewers won't import/load the DICOM file properly.

Would you also mind clarifying what you mean by acquired?

  • MR scans can be acquired in any direction (axial, sagittal, coronal, etc.). In my case (where images where acquired sagittally) this leads to the array_data loaded for a single file using pydicom to show as below.
    image

We don't do much when the DICOM files are loaded in, it is mostly just handled by Pydicom. We do assume that the contour points are arranged in [x, y, z].

  • Yes, points are always arranged in [x, y, z]. Here though (
    for i, series_slice in enumerate(series_data):
    ) the assumption is that the slices are in the z direction, therefore contour coordinates in the wrong space.

Hope this makes sense! I will look for a publicly available dataset that I can share so that we can test this

@asim-shrestha
Copy link
Contributor

Thank you for the in-depth response @ceps1986! This clears a lot up. I'll have to discuss ways we can update RT-Utils to handle files acquired in different axes.

If you have any ideas yourself, feel free to submit a pull request with your changes :)

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