How to visualize every frame of an fmri image
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carlotta Fabris
am 23 Dez. 2016
Beantwortet: Carlotta Fabris
am 10 Jan. 2017
I have an fmri image and I'm opening it udìsing load_nii and the implay. Now I would make a for cycle to select rois for every frame, but I don't know how to do it, some of you know it?
I did this code but I don't know how I could go on:
nii = load_nii(filename);
data = im2double(nii.img);
implay(data);
Thanks, Carlotta.
0 Kommentare
Akzeptierte Antwort
Prashant Arora
am 29 Dez. 2016
I am assuming that "nii.img" returns a 4-D matrix of true color images and you would like to select ROIs for each frame using a loop. You can use the following code to create a interactive "ROI" polygon selector. The final "ROIs" will be stored in the mask variable as logical 3-D array.
nii = load_nii(filename);
I = im2double(nii.img);
mask = zeros(size(I,1),size(I,2),size(I,4));
mask = logical(mask);
for i = 1:size(I,4)
figure(1)
imshow(I(:,:,:,i))
BW = roipoly;
mask(:,:,i) = BW;
figure(2)
imshow(mask(:,:,i));
end
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Neuroimaging finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!