1
votes

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?

1

1 Answers

0
votes

What you are trying to do is called Multi-frame in the DICOM standard. In short you need to, next to making sure that all your image meta data is still correct, specify Number of Frames (0028,0008) and Frame Increment Pointer (0028,0009). Unfortunately the wording on how the Frame Increment Pointer tag exactly works is a bit vague:

The frames within a Multi-frame Image shall be conveyed as a logical sequence. The information that determines the sequential order of the frames shall be identified by the Data Element Tag or Tags conveyed by the Frame Increment Pointer (0028,0009). Each specific Image IOD that supports the Multi-frame Module specializes the Frame Increment Pointer (0028,0009) to identify the Attributes that may be used as sequences.

Even if only a single frame is present, Frame Increment Pointer (0028,0009) is still required to be present and have at least one value, each of which shall point to an Attribute that is also present in the Data Set and has a value. 1

Hope that helps.