ikolesov / kslice

interactive medical image processing
1 stars 1 forks source link

flawed assumption; modfied happens in many situations, not necessarily drawing #15

Closed pkarasev3 closed 11 years ago

pkarasev3 commented 11 years ago

This block has a flawed assumption; modfied happens in many situations, not necessarily drawing! Eg: switch modules, resize window, etc.

'''''

put a listener on label, so we know when user has drawn

 labelImg=self.labelNode.GetImageData()
 self.ladMod_tag=labelImg.AddObserver("ModifiedEvent", self.labModByUser)
 self.labelImg=labelImg

'''''

ikolesov commented 11 years ago

i dont think this is true. a modified event on the label is only called if there is a vtkImageData.Update() issued. perhaps youre thinking of "ModifedEvent" on a sliceLogic node. in that case, youre right, but we repeat a few operations (unnecessary, sure) but no real harm .

pkarasev3 commented 11 years ago

Ah, yeah I was thinking of the widgets. But in general there are some weird things with volumes being sync'd, hence my caution. Also it's an easy way to "leak" memory, if a reference remains somewhere after being left behind by a later operation.