Skip to content

numpy.AxisError: axis 1 is out of bounds for array of dimension 1 #1245

Closed
@yarikoptic

Description

@yarikoptic

originally appeared in

with traceback

  File "/src/heudiconv/heudiconv/convert.py", line 216, in prep_conversion
    seqinfo = group_dicoms_into_seqinfos(
  File "/src/heudiconv/heudiconv/dicoms.py", line 283, in group_dicoms_into_seqinfos
    mwinfo = validate_dicom(filename, dcmfilter)
  File "/src/heudiconv/heudiconv/dicoms.py", line 125, in validate_dicom
    del mw.series_signature[sig]
  File "/opt/miniconda-py39_4.12.0/lib/python3.9/site-packages/nibabel/onetime.py", line 156, in __get__
    val = self.getter(obj)
  File "/opt/miniconda-py39_4.12.0/lib/python3.9/site-packages/nibabel/nicom/dicomwrappers.py", line 625, in series_signature
    signature['image_shape'] = (self.image_shape, eq)
  File "/opt/miniconda-py39_4.12.0/lib/python3.9/site-packages/nibabel/onetime.py", line 156, in __get__
    val = self.getter(obj)
  File "/opt/miniconda-py39_4.12.0/lib/python3.9/site-packages/nibabel/nicom/dicomwrappers.py", line 545, in image_shape
    frame_indices = np.delete(frame_indices, stackid_dim_idx, axis=1)
  File "<__array_function__ internals>", line 200, in delete
  File "/opt/miniconda-py39_4.12.0/lib/python3.9/site-packages/numpy/lib/function_base.py", line 5136, in delete
    axis = normalize_axis_index(axis, ndim)
numpy.AxisError: axis 1 is out of bounds for array of dimension 1

so it feels that may be hardcoded axis=1 should be "reconsidered" there?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions