Here are some examples of conversions in MTEX4, this can be hkil or hkl
%% Conversion between hkl (or hkil) and uvw (or uvtw) and specimen coordinates
% N.B. converted uvw and hkl not always integer values
h = Miller(1,1,1,CS,'Forsterite','hkl')
% change hkl (h) to uvw
uvw = h.uvw
u = Miller(1,1,1,CS,'Forsterite','uvw')
% change uvw (u) to hkl
hkl = u.hkl
%% conversion of hkl and uvw to specimen coordinates
% N.B. converted uvw and hkl not always integer values
% change hkl (h) to vector3d r1
% Miller indices h parallel to specimen direction r1
r1 = vector3d(h)
% change uvw (u) to vector3d r2
% Miller indices u parallel to specimen direction r2
r2 = vector3d(u)
%% conversion of specimen coordinates to hkl and uvw
% N.B. converted uvw and hkl not always integer values
% change vector3d(1,1,1) to hkl
hkl_111 = Miller(vector3d(1,1,1),CS,'Forsterite','hkl')
% change vector3d(1,1,1) to uvw
uvw_111 = Miller(vector3d(1,1,1),CS,'Forsterite','uvw’)
all the best David