typo: do not overwrite 'label'

This commit is contained in:
Martin Diehl 2023-11-28 14:35:30 +01:00
parent 9aa68e83a2
commit 59765ab0df
1 changed files with 2 additions and 2 deletions

View File

@ -197,7 +197,7 @@ class GeomGrid:
@staticmethod
def _load(fname: Union[str, Path],label) -> 'GeomGrid':
def _load(fname: Union[str, Path], label: str) -> 'GeomGrid':
"""
Load from VTK ImageData file.
@ -218,7 +218,7 @@ class GeomGrid:
v = VTK.load(fname if str(fname).endswith('.vti') else str(fname)+'.vti')
cells = np.array(v.vtk_data.GetDimensions())-1
bbox = np.array(v.vtk_data.GetBounds()).reshape(3,2).T
ic = {label:v.get(l).reshape(cells,order='F') for l in set(v.labels['Cell Data']) - {label}}
ic = {l:v.get(l).reshape(cells,order='F') for l in set(v.labels['Cell Data']) - {label}}
return GeomGrid(material = v.get(label).reshape(cells,order='F'),
size = bbox[1] - bbox[0],