I'm trying to stack different DICOM files into one multi-slice series, so to visualize them on ITK-Snap. However, I don't seem to be able to obtain a functioning DICOM series.
I have sorted all files with regards to their slice positioning, and I have a number of ordered single .dcm files, with their original info. I substituted all their original series instance UIDs with one single uid, and their series number with one custom series number I have set to '999' (so to make them belong to one series). Image orientation is set to [1;0;0;0;1;0] for all files, and slice thickness at 8 mm for all files.
I have then created an array of info structures, with the original slice positionings [info(num)].
I have tried something like:
for i=1:num %where num is the number of dicom files
k = num2str(i);
dicomwrite(imm,k,info(i),'CreateMode','Copy'); %where imm is the matrix I obtained with dicomread
end
I have obtained a new set of dicom files, named as numbers from 1 to num, however when I try to open the series on ITK-snap, it runs into an exception stating the vector is too long. I can open single dicom files on ITK-snap, however when more than one images are part of the series, and the series is visualized as 256x212xnum where num is the number of files, I run into the exception.
What am I doing wrong?