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

suggestion to avoid issue when multiple types of files are in the same folder #51

Open
EmmaSkarsoe opened this issue May 12, 2022 · 4 comments

Comments

@EmmaSkarsoe
Copy link

Hi rt_Utils authors,

Thanks for a great tool !

I've experienced some problems, when I am running the add_roi function.
I got the following error-message: Mask must have the same number of layers (In the 3rd dimension) as input series. Expected 130, got 129.

The problem arises, because my folder contains both RT structs, CT scans, RT dose and RT plan. The RT dose file do also have a 'pixel_array' attribute.

I changed a line in the function: load_dcm_images_from_path

from
if hasattr(ds, "pixel_array"):
series_data.append(ds)

to
if ds.Modality == 'CT':
series_data.append(ds)

It solved my problem. :)

@EmmaSkarsoe EmmaSkarsoe changed the title suggestion to avoid issue when multiple modality files are in the same folder suggestion to avoid issue when multiple types of files are in the same folder May 13, 2022
@mathiser
Copy link

This is a really good idea! Perhaps instead of hardcoding it to "CT", there could be an option which defaults to CT, but is changable to other modalities. It could even be set with SOPClassUID to avoid overlapping uses of Modality?

@asim-shrestha
Copy link
Contributor

Thanks for reaching out @EmmaSkarsoe, and good call @mathiser. I'm not sure when I can work on that but that seems like a good solution.

@mathiser
Copy link

Dear @asim-shrestha
It's so great there is some activity on the repo again!

Are you open to pull requests?

@asim-shrestha
Copy link
Contributor

Yes of course! Please feel free to submit any of your desired 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

3 participants