--- a
+++ b/CMapSplitter.h
@@ -0,0 +1,53 @@
+#pragma once
+
+#include <vector>
+#include <string>
+#include <cmath>
+#include <stdexcept>
+#include <array>
+#include "VoxelMap.h"
+#include "IO.h"
+
+using namespace std;
+
+#define MY_PI 3.14159265358979323846
+
+
+class CMapSplitter {
+
+public:
+struct MapCube {
+    std::vector<std::vector<std::vector<float>>> cube;
+    std::array<float, 3> origin_cart; //global cartesian origin
+    std::array<int, 3> origin_Ind; //internal global coords of origin
+};
+
+public:
+    CMapSplitter(VoxelMap *Map, int resulted_cube_dim = 48, float resulted_cube_step = 0.2);
+
+    void GetMapEdgesMinMax(float &min, float &max, int direction);
+
+    vector<CMapSplitter::MapCube> &SplitToCubes(int overlap_voxels = 8);
+    
+    //std::vector<std::vector<std::vector<std::vector<float>>>> SplitToCubes();
+    VoxelMap ReassembleMapFromCubes();
+    VoxelMap MakeOrthoMapFromCubes();
+
+    void saveCubes(CString dir);
+
+    //void SetCubes(vector<CMapSplitter::MapCube> cubes);
+
+private:
+
+    VoxelMap *m_map;
+    VoxelMap m_map_reassembled;
+    VoxelMap m_map_cubes;
+    int m_resulted_cube_dim; //nb voxels
+    float m_resulted_cube_step; //e.g. 0.2 Ang
+    float m_normalize_constant;
+    vector<MapCube> m_cubes;
+    float m_cubes_start[3]; //cartesian 
+    float m_cubes_nb_points[3]; //overall nb voxels if you assemble all cubes together to make an orthogonal map
+
+};
+