indi
indi > RE: NKI/DTI64 1351931
Aug 16, 2011 11:08 AM | leonardo cerliani
RE: NKI/DTI64 1351931
dear Marteen,
I used some time of this morning to play a bit with subject 1351931, particularly referring to this link:
http://www.na-mic.org/Wiki/index.php/NAM...
I tried to extract the bvecs directly from the dicom header, and it looks like (but read below) it worked to some extent, as you can also see in the attached image.
Then I tried to repeat the same procedure with another subject, for whom the bvecs table was given. There are indeed some differences, the first being that the sign of the Y direction appears to be flipped (but that's ok). However, by reading further in the link that I sent you, it appears that just taking the indicated fields in the dcm file doesn't give a very good result.
Below is the script in matlab that I used to extract the bvecs (sorry for not being a very good code...). On the basis of the software that you used to create the bvecs file, it would be nice if you could contact him/her and see whether the problem of extracting the bvecs in subject 1351931 can be fixed, since in the header file this information is indeed present.
all the best!
leonardo
I used some time of this morning to play a bit with subject 1351931, particularly referring to this link:
http://www.na-mic.org/Wiki/index.php/NAM...
I tried to extract the bvecs directly from the dicom header, and it looks like (but read below) it worked to some extent, as you can also see in the attached image.
Then I tried to repeat the same procedure with another subject, for whom the bvecs table was given. There are indeed some differences, the first being that the sign of the Y direction appears to be flipped (but that's ok). However, by reading further in the link that I sent you, it appears that just taking the indicated fields in the dcm file doesn't give a very good result.
Below is the script in matlab that I used to extract the bvecs (sorry for not being a very good code...). On the basis of the software that you used to create the bvecs file, it would be nice if you could contact him/her and see whether the problem of extracting the bvecs in subject 1351931 can be fixed, since in the header file this information is indeed present.
all the best!
leonardo
%%%%%%%%%%%%
% extracts the bvecs info from the dcm
header
% of subject 1351931, using
% spm_dicom_headers
%
% created using snippets and info from:
% http://www.na-mic.org/Wiki/index.php/NAM...
%
% 17 aug 2011
clear all
clc
% cd dwi_dcm_data
for i = 1:76
provv = ls(['1351931.MR.nki_rockland.8.' num2str(i) '.102431.468000.*']);
hdr = spm_dicom_headers(provv);
test = hdr{1}.CSAImageHeaderInfo(22).item;
if isempty(test)
table(i,1) = 0;
table(i,2) = 0;
table(i,3) = 0;
else
table(i,1) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(1).val);
table(i,2) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(2).val);
table(i,3) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(3).val);
end
disp(num2str(i))
end
table=table';
table(2,:) = table(2,:).*-1;
dlmwrite('bvecs_1351931', table, '\t')
!mv bvecs_1351931 ../
% of subject 1351931, using
% spm_dicom_headers
%
% created using snippets and info from:
% http://www.na-mic.org/Wiki/index.php/NAM...
%
% 17 aug 2011
clear all
clc
% cd dwi_dcm_data
for i = 1:76
provv = ls(['1351931.MR.nki_rockland.8.' num2str(i) '.102431.468000.*']);
hdr = spm_dicom_headers(provv);
test = hdr{1}.CSAImageHeaderInfo(22).item;
if isempty(test)
table(i,1) = 0;
table(i,2) = 0;
table(i,3) = 0;
else
table(i,1) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(1).val);
table(i,2) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(2).val);
table(i,3) = str2num(hdr{1}.CSAImageHeaderInfo(22).item(3).val);
end
disp(num2str(i))
end
table=table';
table(2,:) = table(2,:).*-1;
dlmwrite('bvecs_1351931', table, '\t')
!mv bvecs_1351931 ../
%%
figure; hold on
table_apod = table.*-1;
for i = 1:76
plot3(table(1,i), table(2,i), table(3,i), '.');
plot3(table_apod(1,i), table_apod(2,i), table_apod(3,i), '.r');
end
axis equal
grid on
figure; hold on
table_apod = table.*-1;
for i = 1:76
plot3(table(1,i), table(2,i), table(3,i), '.');
plot3(table_apod(1,i), table_apod(2,i), table_apod(3,i), '.r');
end
axis equal
grid on
Threaded View
| Title | Author | Date |
|---|---|---|
| leonardo cerliani | Aug 11, 2011 | |
| Maarten Mennes | Aug 14, 2011 | |
| leonardo cerliani | Aug 14, 2011 | |
| Samantha Adelsberg | Aug 15, 2011 | |
| Maarten Mennes | Aug 15, 2011 | |
| leonardo cerliani | Aug 16, 2011 | |
| Maarten Mennes | Aug 16, 2011 | |
| leonardo cerliani | Aug 16, 2011 | |
