[Insight-users] Detaching an image from the pipeline and probing a filter's state from Java.

Julia Smith julia.smith at ondiagnostics.com
Wed Jun 27 20:42:46 EDT 2007


What's the one-true way to ensure an image is detached from the pipeline? After applying a filter, I'd like to destroy it, but keep the image around and use it as input to other filters. I have a problem where some filters seem to work correctly (connected and object-morphological filters) but binary morphological filters do not.

I've tried making a new image instance, then graft the output of the doomed filter to the new image, but am still seeing some filters (binary erode/dilate) failing to operate correctly. Although I am not certain this is my problem in this case, I need to have a better way of figuring out what a filter's status is.

Here I am assuming that I have some condition not satisfied and this is the reason the binary morphological filters above  GetOutput() calls return a shifted left and up by one source image after an Update().

I have to say the transliteration from C++ to Java causes a lot of problems.

Example: create a filter, generate an image from that filter, GetOutput() and save the reference off in a class' field (the image should not be deallocated as a result -- then again the filter should not be gc-ed as well), garbage collect the filter, and bingo, the image was de-allocated. Next time you interact with your image from Java you get a SegV. And if you have preserved the image by sticking it in a wrapped smart pointer, has the filter reference on the native side remained valid or has the filter instance been destroyed leaving the image with a crap reference?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070627/e8b68c34/attachment.html


More information about the Insight-users mailing list