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!