Is there a way to acquire an image depicting all of the voxels that are treated as 'brain' across subjects in PLS, similar to a group mask in SPM?
For PET, E.R.fMRI and Blocked fMRI module, there is a check box called "Consider all voxels as brain" in "Create Datamat" window. If you select check for this check box, all of the voxels will be treated as "Brain Region".
Hi Jimmy - thanks for your reply. If I haven't checked that box, and instead chose to define the brain region automatically using the default, is there a way to visualize the included voxels across participants?
Answers:
Workaround:
img=squeeze(zeros(st_dims));
img(st_coords)=1;
nii=make_nii(img);
view_nii(nii);
That is the way to visualize the included voxels across participants.
Thank you very much! I will try this tomorrow :)
Thanks Jimmy - those commands worked perfectly! I tried saving this image as a .nii file and overlaying it on a template image in MRIcron, but the resulting .nii image was very very small (seemingly not in MNI space like the functional images are). Do you happen to know if there is any way to correct this so that I can overlay it properly?
Thanks Jimmy - those commands worked perfectly! I tried saving this image as a .nii file and overlaying it on a template image in MRIcron, but the resulting .nii image was very very small (seemingly not in MNI space like the functional images are). Do you happen to know if there is any way to correct this so that I can overlay it properly?
This is because the voxel size of your raw image for PLS is larger than that in your template image. The following workaround should work:
If you overlay 'new2_binary.nii' to 'template.nii', they should match.
The above steps seems overwhelming, but it is not that difficult. I like to expand things into very details so you can follow.
Please let me know if I still did not express myself clearly.
One more word: Please don't get surprised if you find some of the brain voxels are out of the scalp boundary.
Because the subjects data are real data, and the template data is ideal data, there could be some discrepancies between these two.
However, if your template data was specially tailored and was only built from the selected subjects, all brain voxels should be inside the boundary.
Hi Jimmy,
Thanks again for all your help, and sorry for all the questions! - I got to the clip_nii stage but have encountered this error:
??? Attempt to reference field of non-structure array.
Error in ==> clip_nii at 39
dims = abs(nii.hdr.dime.dim(2:4));
I'm sure I've done something wrong here, and you might need more details to help. The dimensions of the resliced image were very large [1405 2357 811], with the origin being [27 38 18] and so I entered the following:
option.cut_from_L = 24
option.cut_from_R = 1201
option.cut_from_P = 2105
option.cut_from_A = 35
option.cut_from_I = 616
option.cut_from_S = 14
I then entered:
nii = 'NewFunctionalCoverage.nii' %this is the name of the resliced image
and nii = clip_nii(nii, option)
I'm still a MATLAB beginner so am sure I've just done something silly. If you have any insight I would be very grateful!
The originator should be at least close to the middle of L-R direction. Therefore, dimension of [1405 2357 811] with originator of [27 38 18] is obviously wrong.
Please upload your template.nii and the original binary.nii that you obtained this morning to somewhere that I can have access (e.g. dropbox), and post the link here. I will look into it tomorrow, and post the detail script here.
Thank you so much - sorry for not being able to do it correctly!
Here is the original binary image:
https://www.dropbox.com/s/fposzcy48kn94ti/FunctionalBrainCoverage.nii
Here is the template:
https://www.dropbox.com/s/mw4hwc5mak0jxwk/ch2bet.nii
Here is the binary image made with the origin:
https://www.dropbox.com/s/plqvv9glnyh0isk/FunctionalCoverageOrigin.nii
I just took a quick look, and here's the answer:
nii = load_nii('FunctionalBrainCoverage.nii');
nii=make_nii(nii.img, [2.7 2.7 2.7], [27 38 18]);
save_nii(nii,'binary.nii');
reslice_nii('binary.nii', 'binary2.nii', [1 1 1]);
b=load_nii('binary2.nii');
t=load_nii('ch2bet.nii');
b_org=b.hdr.hist.originator(1:3)
b_dim=b.hdr.dime.dim(2:4)
t_org=t.hdr.hist.originator(1:3)
t_dim=t.hdr.dime.dim(2:4)
% Since b_dim is smaller than t_dim, we have to pad it rather than clip it:
opt.pad_from_L=t_org(1)-b_org(1);
opt.pad_from_R=(t_dim(1)-t_org(1))-(b_dim(1)-b_org(1));
opt.pad_from_P=t_org(2)-b_org(2) ;
opt.pad_from_A=(t_dim(2)-t_org(2))-(b_dim(2)-b_org(2));
opt.pad_from_I=t_org(3)-b_org(3);
opt.pad_from_S=(t_dim(3)-t_org(3))-(b_dim(3)-b_org(3));
b2=pad_nii(b,opt);
save_nii(b2,'binary2.nii'); % if you overlay binary2.nii to template, they should match
% As a matter of fact, you don't need MRIcron, and you can view result immediately via "view_nii.m":
t.img(b2.img>0) = 255;
view_nii(t);
Hi Jimmy,
Thanks for spotting what I'd done wrong, I was wondering why it was so huge!
I've done what you suggested and it all works perfectly now, it overlays just as it should. Thank you so much for all your time and help, especially for responding so quickly, it's very much appreciated!
Victoria
Baycrest is an academic health sciences centre fully affiliated with the University of Toronto
Privacy Statement - Disclaimer - © 1989-2024 BAYCREST HEALTH SCIENCE. ALL RIGHTS RESERVED