Location pixel and slice
1 view (last 30 days)
Show older comments
Hi everyone.
Please help me. Now i have 20 slice image PET(dicom format dimension 256x256). How to determine:
1) The extrat location of pixel value with range 10000-32000 every slice.
Example: [rows, column, PixelValue]=
Below is my code to read all the 20 slice:
first_to_read = 1; last_to_read = 20; num_to_read = last_to_read - first_to_read + 1; for file_idx = 1 : num_to_read img_number = file_idx + first_to_read - 1; filename = fullfile('D:\Images PET and CT\PET', sprintf('PET_I1001_PT%03d.dcm', img_number)); X(:, : , 1, file_idx) = dicomread(filename); end
Help me..
Accepted Answer
Rik
on 13 Dec 2017
Edited: Rik
on 13 Dec 2017
If you had only a 2D question, you could use find, but for some odd reason, it doesn't support more than 3D, so I've made a FEX submission for a similar goal as yours: findND.
[r,c,slice]=findND(X>10000 & X<32000);
val=X(X(:)>10000 & X(:)<32000);
Alternatively:
X_temp=X;
X_temp(X>10000 & X<32000)=0;
[r,c,slice,val]=findND(X_temp);
12 Comments
Rik
on 24 Mar 2019
Please post this as a separate question.
Note that image fusing is only possible if you have the full positional information for both scans. Only then is it possible to resample one scan to the coordinate grid of the other.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!