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

Cannot slice image objects; consider using img.slicer[slice] to generate a sliced image (see documentation for caveats) or slicing image array data with img.dataobj[slice] or img.get_fdata()[slice] #107

Open
DrKrabs opened this issue Jun 8, 2023 · 2 comments

Comments

@DrKrabs
Copy link

DrKrabs commented Jun 8, 2023

Hi. I'm currently using the the muscle_adipose_tissue pipeline and it works perfectly.
However, I run into some issues when trying to use the spine_muscle_adipose_tissue and liver_spleen_pancreas pipelines, they all give the same type error:

force_separate_z: None interpolation order: 0
Traceback (most recent call last):
  File ".../.Trash/Comp2Comp/comp2comp/spine/spine.py", line 135, in spine_seg
    img, seg = nnUNet_predict_image(
  File "....../lib/python3.9/site-packages/nibabel/spatialimages.py", line 645, in __getitem__
    raise TypeError(
TypeError: Cannot slice image objects; consider using `img.slicer[slice]` to generate a sliced image (see documentation for caveats) or slicing image array data with `img.dataobj[slice]` or `img.get_fdata()[slice]`

Are there any specific modifications needed for the DICOM files to run these pipelines?

@louisblankemeier
Copy link
Collaborator

@DrKrabs , thanks for trying C2C and your feedback. Are you passing in a single DICOM file? spine_muscle_adipose_tissue and liver_spleen_pancreas are 3D methods so require DICOM series. Let me know if this doesn't fix your issue.

@DrKrabs
Copy link
Author

DrKrabs commented Jun 9, 2023

DICOM series likes this?
Screenshot 2023-06-09 at 21 37 27
Or a whole study with multiple series like this?
Screenshot 2023-06-09 at 21 45 10
Still the same error.

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