diff --git a/helpers/cube2ctis.py b/helpers/cube2ctis.py
index 13f684491e0306ad305230b7734781f5a069b356..c512fd15f90a1373c4dbc1c05754835380a6754f 100644
--- a/helpers/cube2ctis.py
+++ b/helpers/cube2ctis.py
@@ -44,8 +44,8 @@ def create_CTIS_from_HSI(HSI, CTIS_geom_params, o0_attenuator, gain, wl_range, L
 
     # Get the cube
     H, W, L = HSI.shape
-    mid_H = int(H/2)
-    mid_W = int(W/2)
+    mid_H = int(L_CTIS/2)
+    mid_W = int(L_CTIS/2)
 
     # Create empty CTIS image
     CTIS = np.zeros((L_CTIS,L_CTIS))