Location pixel and slice
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
0 投票
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..
1 件のコメント
mohd akmal masud
2017 年 12 月 13 日
One more thing the slice no.
Example:
[[rows, column, PixelValue, Slice]=
採用された回答
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 件のコメント
mohd akmal masud
2017 年 12 月 13 日
ok thanks sir. but does mean val in command val=X(X(:)>10000 & X(:)<32000); ??
Rik
2017 年 12 月 13 日
The colon transforms the matrix to a vector, so X(:)>10000 will result in a binary vector, which is 1 for positions where the value is larger than 10000, and 0 where X is smaller. Then you can use the logical for the aptly named logical indexing. The reason I did it like this is that I was too lazy to check what the result would be without the colons, and this will make sure you have val in the shape of a vector.
So in short, val is the PixelValue at (r,c,slice).
PS I added an alternative to my answer.
mohd akmal masud
2017 年 12 月 13 日
Very good explanation. thank you so much.
mohd akmal masud
2017 年 12 月 14 日
Dear Rik,
From your code, I have done got all the pixel and the location. Can you help me to build up the volume of that ?? Meaning i want to show them the combine voxel to one volume.
Rik
2017 年 12 月 14 日
Additional question sent by mail:
This function work very well. Now if i want to know the location of Z, is it correct that is my code? [X,Y,Z,slice]=findND(X>10000 & X<32000); val=X(X(:)>10000 & X(:)<32000); Another question is, if i have get the location pixel X, Y, Z location, how to draw the image by location pixel that i get??
Rik
2017 年 12 月 14 日
The slice is already the z-coordinate. Is that what you mean by building up a volume? Or do you mean something else?
How would you want your visualization to be? You could use isosurface, then you don't even need the previous part (unless you use it in further processing of course).
mohd akmal masud
2017 年 12 月 14 日
yes, i mean building up a volume
Rik
2017 年 12 月 14 日
You already have a volume: your data was loaded to 3D to begin with. It is not clear to me what you mean with building up a volume, so you will have to explain what it is you want to do, otherwise I can't help you.
I would also suggest looking into the isosurface function (you can plot the result with patch).
mohd akmal masud
2017 年 12 月 14 日
ok, i will look isosurface function
mohd akmal masud
2017 年 12 月 14 日
thanks rik
mohd akmal masud
2019 年 3 月 24 日
Sorry all, another question i have but i wrote at this space. please help me
Dear all,
this is my code to view CT image by slice
P = zeros(256, 256, 72);
for K = 1 : 72
petname = sprintf('I4%03d.dcm', K);
P(:,:,K) = dicomread(petname);
end
imshow3D(P)
then, this is my code for view SPECT image by slice,
Noted: all my 42 slice SPECT image stored in one file.
[spect map]=dicomread('128x128');
info = dicominfo('128x128');
gp=info.SliceThickness;
spect=(squeeze(spect));%smooth3
aa=size(spect);aa=aa(3);
imshow3D(spect);
Anybody can help me to fuse both SPECT and CT images for all slice?
Rik
2019 年 3 月 24 日
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.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Image Segmentation についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
