diff --git a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
index cf932d9723569cf2321d2ed8e798ce761918e705..4443ff0dbd2d44d0bb33e7276b761dd980036824 100644
--- a/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
+++ b/Applications/DataExplorer/DataView/MeshLayerEditDialog.cpp
@@ -22,6 +22,7 @@
 #include "StringTools.h"
 #include "Mesh.h"
 
+#include "FileIO/AsciiRasterInterface.h"
 #include "TetGenInterface.h"
 
 #include <QCheckBox>
@@ -188,7 +189,9 @@ MeshLib::Mesh* MeshLayerEditDialog::createPrismMesh()
 		std::vector<std::string> raster_paths;
 		for (int i=nLayers; i>=0; --i)
 			raster_paths.push_back(this->_edits[i]->text().toStdString());
-		if (mapper.createLayers(*_msh, raster_paths, minimum_thickness))
+
+		auto const rasters = FileIO::readRasters(raster_paths);
+		if (rasters && mapper.createLayers(*_msh, *rasters, minimum_thickness))
 		{
 			INFO("Mesh construction time: %d ms.", myTimer0.elapsed());
 			return mapper.getMesh("SubsurfaceMesh").release();
@@ -227,7 +230,9 @@ MeshLib::Mesh* MeshLayerEditDialog::createTetMesh()
 		for (int i=nLayers; i>=0; --i)
 			raster_paths.push_back(this->_edits[i]->text().toStdString());
 		LayeredVolume lv;
-		if (lv.createLayers(*_msh, raster_paths, minimum_thickness))
+
+		auto const rasters = FileIO::readRasters(raster_paths);
+		if (rasters && lv.createLayers(*_msh, *rasters, minimum_thickness))
 			tg_mesh = lv.getMesh("SubsurfaceMesh").release();
 
 		if (tg_mesh)
diff --git a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
index f613792be63e4f378fa659d28a453cc7bc8f1eae..a2d40078ea8aeff10095910c31af8ce04e2608b0 100644
--- a/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
+++ b/Applications/Utils/MeshEdit/createLayeredMeshFromRasters.cpp
@@ -23,6 +23,7 @@
 #include "BaseLib/FileTools.h"
 
 #include "FileIO/readMeshFromFile.h"
+#include "FileIO/AsciiRasterInterface.h"
 #include "FileIO/writeMeshToFile.h"
 
 #include "MeshLib/Mesh.h"
@@ -113,7 +114,12 @@ int main (int argc, char* argv[])
 		return EXIT_FAILURE;
 
 	MeshLib::MeshLayerMapper mapper;
-	if (!mapper.createLayers(*sfc_mesh, raster_paths, min_thickness))
+	if (auto rasters = FileIO::readRasters(raster_paths))
+	{
+		if (!mapper.createLayers(*sfc_mesh, *rasters, min_thickness))
+			return EXIT_FAILURE;
+	}
+	else
 		return EXIT_FAILURE;
 
 	std::string output_name (mesh_out_arg.getValue());