xtk volume rendering with .vtk file created from matlab

I am beginning with XTK. I would like to load a .vtk file in order to make volume rendering into XTK.

This .vtk file has been created with a matlab function which saves a 3D data array (voxel) into vtk format :

  function savevtk(array, filename)
    %  savevtk Save a 3-D scalar array in VTK format.
    %  savevtk(array, filename) saves a 3-D array of any size to
    %  filename in VTK format.
        [nx, ny, nz] = size(array);
        fid = fopen(filename, 'wt');
        fprintf(fid, '# vtk DataFile Version 2.0
');
        fprintf(fid, 'Comment goes here
');
        fprintf(fid, 'ASCII
');
        fprintf(fid, '
');
        fprintf(fid, 'DATASET STRUCTURED_POINTS
');
        fprintf(fid, 'DIMENSIONS    %d   %d   %d
', nx, ny, nz);
        fprintf(fid, '
');
        fprintf(fid, 'ORIGIN    0.000   0.000   0.000
');
        fprintf(fid, 'SPACING    1.000   1.000   1.000
');
        fprintf(fid, '
');
        fprintf(fid, 'POINT_DATA   %d
', nx*ny*nz);
        fprintf(fid, 'SCALARS scalars float
');
        fprintf(fid, 'LOOKUP_TABLE default
');
        fprintf(fid, '
');
        for a=1:nx
            for b=1:ny
                for c=1:nz
                    fprintf(fid, '%d ', array(a,b,c));
                end
                fprintf(fid, '
');
            end
        end
        fclose(fid);
    return

Once the 'output.vtk' file is created, I try to load it this way :


    window.onload = function() {
    
    var r = new X.renderer3D();
    r.init();
    
    // create a mesh from a .vtk file
    var skull = new X.mesh();
    skull.file = 'output.vtk';
    
    // add the object
    r.add(skull);
    
    // .. and render it
    r.render();
    
    };

But nothing displays in the browser.

Is my ‘output.vtk’ is not a valid .vtk file for volume rendering ?

How to load into XTK this kind of file ?