Subscripted Assignment between dissimilar structures when reading DICOM
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi all, I'm using the dicominfo function to read the DICOM headers from a series of DICOM files. I am going through each successive file and storing the header in info(x):
for x = 1:nFiles
info(x) = dicominfo([pathname,Directory(x,1).name]);
SliceLocation(x) = info(x).SliceLocation;
TimeIndex(x) = info(x).InstanceNumber;
end
The problem I'm running into is that for whatever reason, some of the DICOM files contain an extra header. When the loop runs into the file with the extra header I get the "Subscripted assignment between dissimilar structures" error. This is troublesome, especially since I don't even need the information in the extra header. I'm only using a few of the header fields. I got around this by checking to see if that field exists and then passing it to another array, but doing this check significantly slows down the code since I have 1000+ images. Can anyone think of a way to deal with this without slowing down the code?
0 comentarios
Respuestas (1)
Jan
el 22 de Ag. de 2012
for x = nFiles:-1:1 % backwards for pre-allocation
data = dicominfo([pathname,Directory(x,1).name]);
data = fRMField(data, 'UnwantedField');
info(x) = data;
SliceLocation(x) = data.SliceLocation;
TimeIndex(x) = data.InstanceNumber;
end
0 comentarios
Ver también
Categorías
Más información sobre DICOM Format en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!