英文:
Predefined event message for 3D images: change slice
问题
有没有在用户改变切片时预定义的3D图像事件消息?
ROI_changed事件在切片更改时不会触发。
data_changed事件在切片更改时也不会触发。
我在线图中看到了切片的事件消息,但在3D数据中没有看到。
有什么想法吗?
英文:
Is there a predefined event message for 3D images when a user changes the slice?
The ROI_changed event does not trigger on a slice change.
The data_changed event does not trigger on a slice change either.
I see event messages for slices in line plots but not for 3D data.
Any thoughts?
答案1
得分: 2
The event is called slice_changed
and is an ImageDisplay event.
While the documentation doesn't mention the 3D images, it is still the event in the ImageDisplays that is triggered here as well.
See example:
class CSliceChangeTest{
void OnSliceChanged( object self, Number disp_flags, ImageDisplay disp, Number flags1, Number flags2, object slice_id_beg, object slice_id_end ) {
number start, end
disp.ImageDisplayGetDisplayedLayers( start, end )
result("\n Slice changed:[" + start + "-" + end + "]")
}
void Do(object self){
image test:=RealImage("TestStack",4,400,400,5) = random()
test.ShowImage()
imageDisplay disp = test.ImageGetImageDisplay(0)
disp.ImageDisplayAddEventListener(self,"slice_changed:OnSliceChanged" )
}
}
Alloc(CSliceChangeTest).Do()
英文:
The event is called slice_changed
and is an ImageDisplay event.
While the documentation doesn't mention the 3D images, it is still the event in the ImageDisplays that is triggered here as well.
See example:
class CSliceChangeTest{
void OnSliceChanged( object self, Number disp_flags, ImageDisplay disp, Number flags1, Number flags2, object slice_id_beg, object slice_id_end ) {
number start, end
disp.ImageDisplayGetDisplayedLayers( start, end )
result("\n Slice changed:["+start+"-"+end+"]")
}
void Do(object self){
image test:=RealImage("TestStack",4,400,400,5) = random()
test.ShowImage()
imageDisplay disp = test.ImageGetImageDisplay(0)
disp.ImageDisplayAddEventListener(self,"slice_changed:OnSliceChanged" )
}
}
Alloc(CSliceChangeTest).Do()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论