Comp2Comp icon indicating copy to clipboard operation
Comp2Comp copied to clipboard

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]

Open DrKrabs opened this issue 2 years ago • 2 comments

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?

DrKrabs avatar Jun 08 '23 16:06 DrKrabs

@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.

louisblankemeier avatar Jun 08 '23 18:06 louisblankemeier

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.

DrKrabs avatar Jun 09 '23 14:06 DrKrabs