It is possible, but you'd need to reverse engineer the spm_dicom_convert.m function. My guess is that you'll then need to determine Pixel Spacing and Image Position (Patient) for each slice in order to get the positioning correct. The relevant bits of code to work backwards from are....
analyze_to_dicom = [diag([1 -1 1]) [0 (dim(2)+1) 0]'; 0 0 0 1]; % Flip voxels in y
patient_to_tal = diag([-1 -1 1 1]); % Flip mm coords in x and y directions
R = [reshape(hdr{1}.ImageOrientationPatient,3,2)*diag(hdr{1}.PixelSpacing); 0 0];
x1 = [1;1;1;1];
y1 = [hdr{1}.ImagePositionPatient(:); 1];
if length(hdr)>1
x2 = [1;1;dim(3); 1];
y2 = [hdr{end}.ImagePositionPatient(:); 1];
else
orient = reshape(hdr{1}.ImageOrientationPatient,[3 2]);
orient(:,3) = null(orient');
if det(orient)<0, orient(:,3) = -orient(:,3); end
if checkfields(hdr{1},'SliceThickness')
z = hdr{1}.SliceThickness;
else
z = 1;
end
x2 = [0;0;1;0];
y2 = [orient*[0;0;z];0];
end
dicom_to_patient = [y1 y2 R]/[x1 x2 eye(4,2)];
mat = patient_to_tal*dicom_to_patient*analyze_to_dicom;