MATLAB: I read 3D volume whose size 240x240x155 and I want to read slice by slice and wants to apply feature extraction techniques on them How to read one slice than other

image analysisimage processingMATLAB

Hello Please, may you help me to read the 3D volume in MATLAB?
v=niftiread('Brats17_2013_2_1_flair.nii.gz');
figure, imshow(v(:,:,85),[]);
%how to read slice#1 than slice#2 and so on

Best Answer

for slicenumber = 1 : size(v,3)
this_slice = v(:,:,slicenumber);
this_result = YourFeatureExtractionCallGoesHere(this_slice);
all_results{slicenumber} = this_result;
end
Sometimes other data structures would be more appropriate than a cell array: it depends on what data type is returned by YourFeatureExtractionCallGoesHere