Make one mesh (vtk or stl) file

        :param label: labels from prev use of set_labels are used if None

        :return: filename of output file

        Funkce vrací trojrozměrné porobné jako data['segmentation']
        v data['slab'] je popsáno, co která hodnota znamená

def make_mesh_file(
            self,
            labels=None,
            ):
        """ Make one mesh (vtk or stl) file

        :param label: labels from prev use of set_labels are used if None

        :return: filename of output file

        Funkce vrací trojrozměrné porobné jako data['segmentation']
        v data['slab'] je popsáno, co která hodnota znamená
        """

        if labels is None:
            labels=self.labels

        strlabel = imma.get_nlabels(slab=self.slab, labels=labels, return_mode="str")
        if strlabel is list:
            # if one file with {} in pattern is created
            strlabel = "-".join(strlabel)
        logger.debug(strlabel)
        mesh_filename = self.output_file_pattern.format(strlabel)
        logger.debug(mesh_filename)

        self._resize_if_required()
        # sed3.show_slices(self.resized_segmentation)

        self.select_labels(labels)
        # import sed3
        # sed3.show_slices(self.binar_segmentation)

        # _stats(self.segmentation)
        # _stats(self.binar_segmentation)
        _stats(self.resized_segmentation)

        # import pdb; pdb.set_trace()
        logger.debug("gen_mesh_from_voxels_mc() started")
        mesh_data = gen_mesh_from_voxels_mc(self.resized_binar_segmentation, self.resized_voxelsize_mm)
        if self.smoothing:
            mesh_data.coors = smooth_mesh(mesh_data)
            # mesh_data.coors = seg2fem.smooth_mesh(mesh_data)

        else:
            pass
            # mesh_data = gen_mesh_from_voxels_mc(segmentation, voxelsize_mm * 1.0e-2)
            # mesh_data.coors +=
        logger.debug("gen_mesh_from_voxels_mc() finished")
        pth, ext = op.splitext(mesh_filename)
        if ext == ".stl":
            vtk_filename = mesh_filename + ".vtk"
        else:
            vtk_filename = mesh_filename
        mesh_data.write(vtk_filename)

        if ext == ".stl":
            vtk2stl.vtk2stl(vtk_filename, mesh_filename)
        return mesh_filename