CS_MoCo_LAB
CS_MoCo_LAB copied to clipboard
How to get a .mat file desired by the CS_LAB_GUI program from a .dcm file ?
Hello, I have many .dcm files, and I want to use these files to test the CS_LAB_GUI program. But when I translate the .dcm file to the .mat file desired by the program, it returns error when loading. Am I missing something. The following is the code for translating .dcm to .mat.
%% 读取数据 filename = 'xx.dcm'; dcm = dicomread(filename); info = dicominfo(filename); dcm = double(dcm); % 转为double方便后续处理
%% 归一化处理(此处也可直接使用mat2gray()函数) lv = min(dcm(:)); uv = max(dcm(:)); dcmIM = (dcm - lv)/(uv - lv);
dcmMat.kSpace ={complex(dcmIM)} dcmMat.measPara.dim = [size(dcmIM,1), size(dcmIM,2), 1, 1, 1] dcmMat.measPara.LCall = [1,1,1,1] dcmMat.measPara.dimension = '2D'
If you start from the DICOM image which (looking at your code) only contains the magnitude image, you will not be able to start any reliable reconstruction. K-space rawdata is required for that. For the conversion: Looking at your code, this looks so far correct to me. It would be helpful to know the exact error message that you get.