Robert, I have noticed a potential issue with the traditionaldipfit.m function you wrote. The roll does not seem functional. See the example below where the sphere is flattened when you change the roll.
clear
[x,y,z] = sphere;
angle_that_create_issue = pi/4;
ht1 = traditionaldipfit([ 0 -20 -10 -pi/4 angle_that_create_issue pi/4 1 1 1]);
coords = ht1*[ x(:) y(:) z(:) ones(length(x(:)),1)]';
figure;
surf(reshape(coords(1,:), size(x)), reshape(coords(2,:), size(x)), reshape(coords(3,:), size(x)), 'facecolor', 'none');
axis equal
view(21,36);
Robert, I have noticed a potential issue with the traditionaldipfit.m function you wrote. The roll does not seem functional. See the example below where the sphere is flattened when you change the roll.
This function is extensively used in DIPFIT. CC @robertoostenveld