Label Every Voxel in an ROI nifti and display the image together with the label

2 ビュー (過去 30 日間)
Lameck Amugongo
Lameck Amugongo 2019 年 2 月 13 日
編集済み: Lameck Amugongo 2019 年 2 月 13 日
CBCTFilteredSorted %Contains all images
%Extract and plot
%mask (3D matrix) - cbcts (4D matrix, ijk per image, last dimension is the image nr)
%t is time of each cbct in days after planning
maskData = maskIm.img; %ROI
slopes = maskData*0;
labes = maskData*0; %label for each voxel
for z=1:size(maskData,3)
%Make sure we extract pixel in every voxel in the area defined by
%the mask
for j=1:size(maskData,2)
for y=1:size(maskData,1)
if(maskData(y,j,z) >= 50 )
pixvals = squeeze(CBCTFilteredSorted(y,j,z,:))-1024;
%plot(pixvals);
p = polyfit(x,pixvals,1); %Fit a slope
slopes(y,j,z) = p(1);
%c = polyfit(x,pixvals,2); %Fit a curve (polynomial)
%c = polyval(p,x);
y_pred = ClassifySlope(p(1)); %Classify slope
if strcmp(y_pred, 'No Change')
label = 0;
labels(y,j,z) = label;
elseif strcmp(y_pred, 'progression')
label = 1;
labels(y,j,z) = label;
elseif strcmp(y_pred, 'Regression')
label = 2;
labels(y,j,z) = label;
end
end
end
end
end
%Here I would like to label each voxel across all images with the label. How do i plot the number on that voxel on the image
figure(100);
hold on;
for v=1:size(maskData, 3)
imshow() %All images are stored in 4D array - CBCTFilteredSorted
end
hold off;

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by