Viewing same slice of 2 different image stacks with sliceViewer
4 ビュー (過去 30 日間)
古いコメントを表示
I have a CT reconstruction and the relative segmentation, both image stacks made by 140 slices. I'm using sliceViewer to display them in two different figures:
fig1 = figure("Name","CT image", "NumberTitle", "off");
s1 = sliceViewer(imm);
fig2 = figure("Name","Segmentated image", "NumberTitle", "off");
s2 = sliceViewer(seg);
I would like to see the same slice of both images by sliding only one of them. I'm trying to use the line
s2.SliceNumber = s1.SliceNumber
but it works only once, while i need to repeat this line every time I use the slider of s1.
Any idea? Thank you for the help!
0 件のコメント
回答 (1 件)
Harsh Sanghai
2023 年 3 月 23 日
Hi,
To achieve this, you can add a listener to the "SliceNumber" property of s1 that updates the "SliceNumber" property of s2 whenever it changes.
% Add listener to s1
addlistener(s1, 'SliceNumber', 'PostSet', @(src,evt) updateSliceNumber(s1, s2));
function updateSliceNumber(s1, s2)
% Update the SliceNumber property of s2 to match s1
s2.SliceNumber = s1.SliceNumber;
end
For more information checkout the below link:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!