You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: imSurfaceLut.m
    path of file: ./repos/matImage/matImage/imMinkowski
    
    the code of the file until where you have to start completion: function lut = imSurfaceLut(varargin)
%IMSURFACELUT Look-Up Table for computing surface area of a 3D binary image
%
%   Deprecated, use 'imSurfaceLut' instead.
%
%   LUT = surfaceLut
%   return an array of size 256, which can be used with function imLUT to
%   create map of contribution to the surface. We consider here tiles
%   located in the interior of image (none of the pixels is located on the
%   edge).
%
%   LUT = surfaceLut(SCALE)
%   Also specify size of the elementary tile, in user units (Default is
%   [1 1 1]).
%
%   LUT = surfaceLut(SCALE, NDIR)
%   Also specify the number of directions for computing intersections,
%   which can be either 3 (the default), or 13.
%
%   
%   Example
%     % Create a binary image of a ball
%     [x, y, z] = meshgrid(1:100, 1:100, 1:100);
%     IMG = sqrt( (x-50.12).^2 + (y-50.23).^2 + (z-50.34).^2) < 40;
%     % compute surface area of the ball
%     HISTO = imBinaryConfigHisto(IMG);
%     LUT = imSurfaceLut(13);
%     S = sum(HISTO .* LUT)
%     S =

    
function lut = imSurfaceLut(varargin)
%IMSURFACELUT Look-Up Table for computing surface area of a 3D binary image
%
%   Deprecated, use 'imSurfaceLut' instead.
%
%   LUT = surfaceLut
%   return an array of size 256, which can be used with function imLUT to
%   create map of contribution to the surface. We consider here tiles
%   located in the interior of image (none of the pixels is located on the
%   edge).
%
%   LUT = surfaceLut(SCALE)
%   Also specify size of the elementary tile, in user units (Default is
%   [1 1 1]).
%
%   LUT = surfaceLut(SCALE, NDIR)
%   Also specify the number of directions for computing intersections,
%   which can be either 3 (the default), or 13.
%
%   
%   Example
%     % Create a binary image of a ball
%     [x, y, z] = meshgrid(1:100, 1:100, 1:100);
%     IMG = sqrt( (x-50.12).^2 + (y-50.23).^2 + (z-50.34).^2) < 40;
%     % compute surface area of the ball
%     HISTO = imBinaryConfigHisto(IMG);
%     LUT = imSurfaceLut(13);
%     S = sum(HISTO .* LUT)
%     S =
%         2.0103e+04
%     % compare with theoretical value
%     Sth = 4*pi*40^2;
%     100 * (S - Sth) / Sth
%     ans = 
%         -0.0167
%
%     % Verifies the additivity property: the sum of measures on sub-images 
%     % (with one voxel overlap) should equal the measure on the whole
%     % image. 
%     sub1 = 1:51; sub2 = 51:100;
%     imgList = {...
%         IMG(sub1, sub1, sub1), IMG(sub1, sub1, sub2), ...
%         IMG(sub1, sub2, sub1), IMG(sub1, sub2, sub2), ...
%         IMG(sub2, sub1, sub1), IMG(sub2, sub1, sub2), ...
%         IMG(sub2, sub2, sub1), IMG(sub2, sub2, sub2)};
%     bList = zeros(8, 1);
%     for i = 1:8
%         HISTO = imBinaryConfigHisto(imgList{i});
%         bList(i) = sum(HISTO .* LUT);
%     end