dke-questions
dke-questions > RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
May 4, 2018 12:05 PM | Xinman Liu
RE: After using Matlab to change DICOM sequence name, new problem appear while running DKE
Hi, Dave.
I think I did not describe it clearly. So now I have data from two different volunteers. The first one is a healthy volunteer, and there is only 61 DCM (sorry, not 67, my mistake) in one Folder. And I can run DKE perfectly with this data. And then I have data from the Patient which is in the second folder. And it contains altogether 85 DCM. And the Sequence Name is wrong. And that's why I Need to use Matlab to Change the Name. As Emilie recomended above, I use the data of the healthy volunteer as reference to Change the Name like, ep_b0, ep_b1000# and ep_b2000#, and I used the following lines in Matlab.
% info=dicominfo('1.3.12.2.1107.5.2.32.35420.2018010410543453162206454');
% info.SequenceName = '*ep_b0';
dbstop if error
filenames = dir('*.dcm');
X =dicomread(filenames(1).name);
info = dicominfo(filenames(1).name);
info.SequenceName = '*ep_b0';
fname= strcat('test',num2str(1), '.dcm');
dicomwrite(X, fname ,info)
for i = 2: size(filenames,1)
X =dicomread(filenames(i).name);
info = dicominfo(filenames(i).name);
info.SequenceName = strcat('*ep_b1000#',num2str(i-1));
fname= strcat('test',num2str(i), '.dcm');
dicomwrite(X, fname ,info)
end
for j = 43: size(filenames,1)
X =dicomread(filenames(j).name);
info = dicominfo(filenames(j).name);
info.SequenceName = strcat('*ep_b2000#',num2str(j-42));
% fname= ['./result/',info.MediaStorageSOPInstanceUID, '.dcm']
fname= strcat('test',num2str(j), '.dcm');
dicomwrite(X, fname ,info)
end
So I did have 85 DCM where all the SequenceName are already changed. The reason why I divided the DCM in half was because in the healthy volunteer's data ''ep_b2000' starts at 31st DCM. And then I assumed that in this 85-patient data it may start at 43rdDCM. But after I run it with the changed data, it still reads in the command window,
Error in spm_coreg>optfun (line 165)
Error in spm_coreg (line 88)
Error in spm_powell (line 27)
Error in spm_coreg (line 143)
Error in dke_preprocess_dicom>coregister (line 207)
Error in dke_preprocess_dicom (line 78)
Reading input images... Error using dke_estimate (line 165)
Input NIfTI image F:\P10\intermediate_processing\combined\rdki does not exist!
Error in dke (line 182)
[color=#ff0000]So I think either my assumption is wrong that 'ep-b2000#' did not start at 43rd DCM or there may be other Problems except the SequenceName of the data. Do you have any clues about when the 'ep-b2000#' starts? By the way, I also try to Change 43rd to 31st, and it doesn't work either.[/color]
[color=#ff0000]Best,[/color]
[color=#ff0000]Xinman
[/color]
I think I did not describe it clearly. So now I have data from two different volunteers. The first one is a healthy volunteer, and there is only 61 DCM (sorry, not 67, my mistake) in one Folder. And I can run DKE perfectly with this data. And then I have data from the Patient which is in the second folder. And it contains altogether 85 DCM. And the Sequence Name is wrong. And that's why I Need to use Matlab to Change the Name. As Emilie recomended above, I use the data of the healthy volunteer as reference to Change the Name like, ep_b0, ep_b1000# and ep_b2000#, and I used the following lines in Matlab.
% info=dicominfo('1.3.12.2.1107.5.2.32.35420.2018010410543453162206454');
% info.SequenceName = '*ep_b0';
dbstop if error
filenames = dir('*.dcm');
X =dicomread(filenames(1).name);
info = dicominfo(filenames(1).name);
info.SequenceName = '*ep_b0';
fname= strcat('test',num2str(1), '.dcm');
dicomwrite(X, fname ,info)
for i = 2: size(filenames,1)
X =dicomread(filenames(i).name);
info = dicominfo(filenames(i).name);
info.SequenceName = strcat('*ep_b1000#',num2str(i-1));
fname= strcat('test',num2str(i), '.dcm');
dicomwrite(X, fname ,info)
end
for j = 43: size(filenames,1)
X =dicomread(filenames(j).name);
info = dicominfo(filenames(j).name);
info.SequenceName = strcat('*ep_b2000#',num2str(j-42));
% fname= ['./result/',info.MediaStorageSOPInstanceUID, '.dcm']
fname= strcat('test',num2str(j), '.dcm');
dicomwrite(X, fname ,info)
end
So I did have 85 DCM where all the SequenceName are already changed. The reason why I divided the DCM in half was because in the healthy volunteer's data ''ep_b2000' starts at 31st DCM. And then I assumed that in this 85-patient data it may start at 43rdDCM. But after I run it with the changed data, it still reads in the command window,
Error in spm_coreg>optfun (line 165)
Error in spm_coreg (line 88)
Error in spm_powell (line 27)
Error in spm_coreg (line 143)
Error in dke_preprocess_dicom>coregister (line 207)
Error in dke_preprocess_dicom (line 78)
Reading input images... Error using dke_estimate (line 165)
Input NIfTI image F:\P10\intermediate_processing\combined\rdki does not exist!
Error in dke (line 182)
[color=#ff0000]So I think either my assumption is wrong that 'ep-b2000#' did not start at 43rd DCM or there may be other Problems except the SequenceName of the data. Do you have any clues about when the 'ep-b2000#' starts? By the way, I also try to Change 43rd to 31st, and it doesn't work either.[/color]
[color=#ff0000]Best,[/color]
[color=#ff0000]Xinman
[/color]
Threaded View
| Title | Author | Date |
|---|---|---|
| Xinman Liu | Apr 27, 2018 | |
| Kirk Feindel | Apr 27, 2018 | |
| Xinman Liu | Apr 29, 2018 | |
| Emilie McKinnon | Apr 27, 2018 | |
| Xinman Liu | Apr 29, 2018 | |
| David Lewis | May 2, 2018 | |
| David Lewis | May 2, 2018 | |
| Xinman Liu | May 3, 2018 | |
| David Lewis | May 3, 2018 | |
| Xinman Liu | May 4, 2018 | |
| Emilie McKinnon | May 4, 2018 | |
| Xinman Liu | May 5, 2018 | |
| Xinman Liu | May 3, 2018 | |
| David Lewis | May 3, 2018 | |
