Predefined event message for 3D images: change slice.

huangapple go评论54阅读模式
英文:

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()

huangapple
  • 本文由 发表于 2023年5月25日 06:07:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/76327702.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定