Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
brainmesh_handler
diff --git a/invesalius/data/brainmesh_handler.py b/invesalius/data/brainmesh_handler.py
index 172b3c3a..a6f6732b 100644
--- a/invesalius/data/brainmesh_handler.py
+++ b/invesalius/data/brainmesh_handler.py
@@ -33,6 +33,8 @@ class Brain:
tmpPeel = downsample(refSurface)
# Standard space coordinates
mask_sFormMatrix = mask_reader.GetSFormMatrix()
+ if mask_sFormMatrix is None:
+ mask_sFormMatrix = vtk.vtkMatrix4x4()
# Apply coordinate transform to the meshed mask
mask_ijk2xyz = vtk.vtkTransform()
@@ -58,6 +60,8 @@ class Brain:
# Scanner coordinates from image
qFormMatrix = T1_reader.GetQFormMatrix()
+ if qFormMatrix is None:
+ qFormMatrix = vtk.vtkMatrix4x4()
refImageSpace2_xyz_transform = vtk.vtkTransform()
refImageSpace2_xyz_transform.SetMatrix(qFormMatrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment