Skip to content

Instantly share code, notes, and snippets.

@tfmoraes
Created September 8, 2021 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfmoraes/9fb1bb7592bae0db77e21a9c782db429 to your computer and use it in GitHub Desktop.
Save tfmoraes/9fb1bb7592bae0db77e21a9c782db429 to your computer and use it in GitHub Desktop.
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