itk-snap无法读取金马扬名导出的MR,santeDICOM Viewer可以。 下面代码使用matlab借助CT的头文件重新MR
patient_path = 'C:\Users\MrXie\Desktop\ART-CMR148167';
patient_outpath = [patient_path, '_out'];
if ~exist(patient_outpath, 'dir')
mkdir(patient_outpath)
end
names = dir(patient_path);
info_standard = dicominfo(fullfile('C:\Users\MrXie\Desktop\CMR148167-CCT374784_out\1000.dcm'));
for i = 3: length(names)
name = names(i).name;
info = dicominfo(fullfile(patient_path, name));
img = info.RequestAttributesSequence.Item_1.PixelData;
img = reshape(img, [512,512])'+1024;
info= info_standard;
info.InstanceNumber=info.InstanceNumber+i;%保存时保持层数与序列一致
info.ImagePositionPatient=[info.ImagePositionPatient(1), info.ImagePositionPatient(2),info.ImagePositionPatient(3)+1.0*(i-3)];
info.SliceLocation=info.SliceLocation+1.0*(i-3);
dicomwrite(img, fullfile(patient_outpath, name), info);
end
|