我正在使用 3D 原始图像(PET 图像(浮动)的大小为 [84*71*103],间距大小为 4.07*4.07*3 mm)。
我想要:
- 使用对应于肿瘤中心的体素坐标
[116,177,86]
(由我定义),并创建一个与肿瘤中心同心的球体。 - 将球体的直径更改为比肿瘤本身大一点。
所以球体将用作覆盖图像的蒙版,我可以获得该球体形状内图像值的统计信息。
我希望我已经说得够清楚了。我将衷心感谢您的帮助。我的代码无法正常工作,我不知道如何继续。
fid_1 = fopen('I:\PatientData\patient3\case1\DIR_CT1toCT2\New-
crop\PET1FEM_PET2_DIFF.img','r','l');
pet1fem_pet2_diff = fread(fid_1,'float32');
pet1fem_pet2_diff = reshape(pet1fem_pet2_diff, [84 71 103]);
% interpolation is nearest neighbour, and 'crop' Makes output the same size as the input image
pet1fem_pet2_diff = imrotate(pet1fem_pet2_diff,90,'nearest','crop');
% create the image
imageSizeX = 84;
imageSizeY = 71;
imageSizeZ = 103;
% columns are in the x direction and, rows are in the y direction
[columnsInImage rowsInImage pagesInImage] = meshgrid(1:imageSizeX, 1:imageSizeY,1:imageSizeZ);
% Next create the sphere in the image.
centerX = 29;
centerY = 26;
centerZ = 74;
radius = 5;
nonSphereVoxels = (rowsInImage - centerY).^2 ...
+ (columnsInImage - centerX).^2 + (pagesInImage - centerZ).^2 > radius.^2;
pet1fem_pet2_diff(nonSphereVoxels) = 0;
figure(1);
imagesc(pet1fem_pet2_diff(:,:,30));
title('PET1FEM-PET2-DIFF');