Automatically show an image loaded by a background CLI

classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi again,

           we are loading an image into 3DSlicer using a CLI plugin programmatically invoked by a python plugin. Given this, the CLI plugin is executed in background and therefore the image is not automatically shown into the 2D slice viewer in 3DSlicer, as opposed to what happens if you call the CLI plugin manually (by using its Xml GUI, for example), where the image is automatically loaded as background in all the three 2D viewers.

How can we tell to the 2D viewers, inside the python plugin, to automatically load and show the image as background or foreground? Which are the classes we need to refer to?

Thanks very much,

Marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

pieper
Administrator
Hi Marco -

For this you'll probably want to set the values of the SelectionNode and
then call the logic method that copies this into the SliceCompositeNodes
for each of the slice viewers.

Here's a snippet of python code from
Modules/ExtractSubvolume/ExtractSubvolumeGUI.py that does this:

>         appLogic = slicer.ApplicationLogic
>         selectionNode = appLogic.GetSelectionNode()
>         if inputVolume.GetLabelMap():
>           outputVolume.SetLabelMap(1)
>           selectionNode.SetReferenceActiveLabelVolumeID(outputVolume.GetID())
>         else:
>           selectionNode.SetReferenceActiveVolumeID(outputVolume.GetID())
>         appLogic.PropagateVolumeSelection()
>

HTH,
Steve

On 03/07/2011 06:30 AM, ClearPEMSonic wrote:

> Hi again,
>
>             we are loading an image into 3DSlicer using a CLI plugin
> programmatically invoked by a python plugin. Given this, the CLI plugin is
> executed in background and therefore the image is not automatically shown
> into the 2D slice viewer in 3DSlicer, as opposed to what happens if you call
> the CLI plugin manually (by using its Xml GUI, for example), where the image
> is automatically loaded as background in all the three 2D viewers.
>
> How can we tell to the 2D viewers, inside the python plugin, to
> automatically load and show the image as background or foreground? Which are
> the classes we need to refer to?
>
> Thanks very much,
>
> Marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2645810.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Steve,
         thanks for your suggestion, it does indeed work correctly. This, on the other hand, raised a new question/problem: in the python plugin, before executing the CLI, we create some empty volumes and add them to scene by doing, for example


volume1 = slicer.MRMLScene.CreateNodeByClass('vtkMRMLScalarVolumeNode')
slicer.MRMLScene.AddNode(volume)


This volume is passed to the CLI, then after CLI execution at some point in the python plugin we would like to remove the volume from the scene. But this doesn't seem to work, as calling for example


volume = slicer.MRMLScene.GetNodeByID("vtkMRMLScalarVolumeNode3")
slicer.MRMLScene.RemoveNode(volume)


causes 3DSlicer to crash and exit completely. This is quite odd since if the same operation is performed by the python console, i.e.


import Slicer
from Slicer import slicer
volume = slicer.MRMLScene.GetNodeByID("vtkMRMLScalarVolumeNode3")
slicer.MRMLScene.RemoveNode(volume)


it works correctly.
So, are we making any mistake in the way we create, add or remove the node in the scene?


Thanks very much,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
Hi Marco,

the crash of MRMLScene.RemoveNode(..) indicates that the volume is null.

Just check
if volume:
        slicer.MRMLScene.RemoveNode(volume)
else:
        # volume not found
        ..

Daniel

On Mar 10, 2011, at 12:44 PM, ClearPEMSonic wrote:

> Hi Steve,
>         thanks for your suggestion, it does indeed work correctly. This, on
> the other hand, raised a new question/problem: in the python plugin, before
> executing the CLI, we create some empty volumes and add them to scene by
> doing, for example
>
>
> volume1 = slicer.MRMLScene.CreateNodeByClass('vtkMRMLScalarVolumeNode')
> slicer.MRMLScene.AddNode(volume)
>
>
> This volume is passed to the CLI, then after CLI execution at some point in
> the python plugin we would like to remove the volume from the scene. But
> this doesn't seem to work, as calling for example
>
>
> volume = slicer.MRMLScene.GetNodeByID("vtkMRMLScalarVolumeNode3")
> slicer.MRMLScene.RemoveNode(volume)
>
>
> causes 3DSlicer to crash and exit completely. This is quite odd since if the
> same operation is performed by the python console, i.e.
>
>
> import Slicer
> from Slicer import slicer
> volume = slicer.MRMLScene.GetNodeByID("vtkMRMLScalarVolumeNode3")
> slicer.MRMLScene.RemoveNode(volume)
>
>
> it works correctly.
> So, are we making any mistake in the way we create, add or remove the node
> in the scene?
>
>
> Thanks very much,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2661449.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,
           the crash calling slicer.MRMLScene.RemoveNode(volume) has a weird behaviour. I explain the procedure: we create 3 vtkMRMLScalarVolumeNodes, launch a CLI through plugin.Execute passing those 3 nodes, this CLI can fill 1,2 or 3 of them with data (depending on some variables the user specifies), then we delete the empty nodes (we can check if a node is empty because we fill the Description attribute of non-empty ones). The code we use for deleting the nodes is


self.ErrorDialog("Images Loaded Successfully")
for i in range(slicer.MRMLScene.GetNumberOfNodes()):
        node = slicer.MRMLScene.GetNthNode(i)
        if node:
                if node.GetName().find("PEM") > -1:
                        if len(node.GetDescription()) == 0:
                                slicer.MRMLScene.RemoveNode(node)
                if node.GetName().find("Echo") > -1:
                        if len(node.GetDescription()) == 0:
                                slicer.MRMLScene.RemoveNode(node)
                if node.GetName().find("Elasto") > -1:
                        if len(node.GetDescription()) == 0:
                                slicer.MRMLScene.RemoveNode(node)


which works without problems. The weirdness comes if we remove the line

self.ErrorDialog("Images Loaded Successfully")

in fact, without this line, 3DSlicer crashes and exit completely (the same behaviour as in our first post). I don't know if this is a bug or there is something going on that we don't understand. Anyway we don't need to remove the ErrorDialog popup, but it's kind of a strange behaviour. For completeness, I'll also paste the definition of ErrorDialog (although i guess it's the standard one):


    def ErrorDialog(self,text):
        slicer.Application.InformationMessage(text)
        dialog = slicer.vtkKWMessageDialog()
        parent = slicer.ApplicationGUI.GetMainSlicerWindow()
        dialog.SetParent(parent)
        dialog.SetMasterWindow(parent)
        dialog.SetStyleToMessage()
        dialog.SetText(text)
        dialog.Create()
        dialog.Invoke()


Cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
Hi Marco,

this indeed is weird. Your code looks correct to me even if I don't like so much that you use the name of a MRML node to compare for deletion. Can't you keep track of the ids?

Can you post the output of the crash? Which line crashes?

Daniel

On Mar 11, 2011, at 9:48 AM, ClearPEMSonic wrote:

> Hi Daniel,
>           the crash calling slicer.MRMLScene.RemoveNode(volume) has a weird
> behaviour. I explain the procedure: we create 3 vtkMRMLScalarVolumeNodes,
> launch a CLI through plugin.Execute passing those 3 nodes, this CLI can fill
> 1,2 or 3 of them with data (depending on some variables the user specifies),
> then we delete the empty nodes (we can check if a node is empty because we
> fill the Description attribute of non-empty ones). The code we use for
> deleting the nodes is
>
>
> self.ErrorDialog("Images Loaded Successfully")
> for i in range(slicer.MRMLScene.GetNumberOfNodes()):
> node = slicer.MRMLScene.GetNthNode(i)
> if node:
> if node.GetName().find("PEM") > -1:
> if len(node.GetDescription()) == 0:
> slicer.MRMLScene.RemoveNode(node)
> if node.GetName().find("Echo") > -1:
> if len(node.GetDescription()) == 0:
> slicer.MRMLScene.RemoveNode(node)
> if node.GetName().find("Elasto") > -1:
> if len(node.GetDescription()) == 0:
> slicer.MRMLScene.RemoveNode(node)
>
>
> which works without problems. The weirdness comes if we remove the line
>
> self.ErrorDialog("Images Loaded Successfully")
>
> in fact, without this line, 3DSlicer crashes and exit completely (the same
> behaviour as in our first post). I don't know if this is a bug or there is
> something going on that we don't understand. Anyway we don't need to remove
> the ErrorDialog popup, but it's kind of a strange behaviour. For
> completeness, I'll also paste the definition of ErrorDialog (although i
> guess it's the standard one):
>
>
>    def ErrorDialog(self,text):
>        slicer.Application.InformationMessage(text)
>        dialog = slicer.vtkKWMessageDialog()
>        parent = slicer.ApplicationGUI.GetMainSlicerWindow()
>        dialog.SetParent(parent)
>        dialog.SetMasterWindow(parent)
>        dialog.SetStyleToMessage()
>        dialog.SetText(text)
>        dialog.Create()
>        dialog.Invoke()
>
>
> Cheers,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2664993.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,
                       yes I can use IDs as well, in fact it was my first choice, then given the crashes (which I didn't associate to the error dialog yet) i tried other ways.. now I followed your suggestion and I'm again using IDs, and I also tried to narrow down the line that's causing the crash, in this way


                #self.ErrorDialog("Images Loaded Successfully")
               
                for i in range(slicer.MRMLScene.GetNumberOfNodes()):
                        node = slicer.MRMLScene.GetNthNode(i)
                        if node:
                                if node.GetID() == PEMID:
                                        if len(node.GetDescription()) == 0:
                                                os.system("touch /home/clearpem/pem-pre.txt")
                                                slicer.MRMLScene.RemoveNode(node)
                                                os.system("touch /home/clearpem/pem-after.txt")
                                if node.GetID() == echoID:
                                        if len(node.GetDescription()) == 0:
                                                os.system("touch /home/clearpem/echo-pre.txt")
                                                slicer.MRMLScene.RemoveNode(node)
                                                os.system("touch /home/clearpem/echo-after.txt")
                                if node.GetID() == elastoID:
                                        if len(node.GetDescription()) == 0:
                                                os.system("touch /home/clearpem/elasto-pre.txt")
                                                slicer.MRMLScene.RemoveNode(node)
                                                os.system("touch /home/clearpem/elasto-after.txt")

                os.system("touch /home/clearpem/end.txt")


which was the only way I could think of, if I have to avoid using a magic popup. Then I let the plugin load one elasto and one PEM, so I expect it to write to disk only /home/clearpem/echo-pre.txt, /home/clearpem/echo-after.txt and /home/clearpem/end.txt ... which is exactly what happens, but the program crashes anyway. So it reaches the end of the code and after that Slicer crashes. To be clear, the is no other line of code executed after the last line I pasted above, that's the end of the Apply function called by the Apply button, and the end of the python plugin.

The crash itself is strange: I start Slicer from terminal (precisely to have some feedback in case of error) but in this case Slicer just disappears, no new line is written in the terminal and the terminal doesn't seem to recognize Slicer as killed. In fact it just stays like this


[clearpem@omero Slicer3-3.6-2010-06-10-linux-x86_64]$ ./Slicer3
Starting Slicer: /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64


and if want the prompt back I have to press Ctrl+C. Anyway, no feedback from the terminal.
I don't know how to get more feedback in this situation, maybe there is a debug mode for running Slicer?

cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
I forgot to mention, if I get rid of the popup and also of the entire code that deletes the nodes, i.e.


# self.ErrorDialog("Images Loaded Successfully")
               
# for i in range(slicer.MRMLScene.GetNumberOfNodes()):
# node = slicer.MRMLScene.GetNthNode(i)
# if node:
# if node.GetID() == PEMID:
# if len(node.GetDescription()) == 0:
# os.system("touch /home/clearpem/pem-pre.txt")
# slicer.MRMLScene.RemoveNode(node)
# os.system("touch /home/clearpem/pem-after.txt")
# if node.GetID() == echoID:
# if len(node.GetDescription()) == 0:
# os.system("touch /home/clearpem/echo-pre.txt")
# slicer.MRMLScene.RemoveNode(node)
# os.system("touch /home/clearpem/echo-after.txt")
# if node.GetID() == elastoID:
# if len(node.GetDescription()) == 0:
# os.system("touch /home/clearpem/elasto-pre.txt")
# slicer.MRMLScene.RemoveNode(node)
# os.system("touch /home/clearpem/elasto-after.txt")

                os.system("touch /home/clearpem/end.txt")


there is no crash at all (and the "end.txt" file is created). So it really seems some strange interaction between a popup and the messing with node deleting.

cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
I still don't think the errorDialog causes the problem. More likely is that the RemoveNode calls crash Slicer.

Are you working on a debug build of Slicer? Then, you should start slicer through gdb

./Slicer --launch xterm
gdb bin/Slicer3-real
run

and when Slicer crashes, you can track the error down.

where
bt

Daniel

On Mar 11, 2011, at 12:18 PM, ClearPEMSonic wrote:

> I forgot to mention, if I get rid of the popup and also of the entire code
> that deletes the nodes, i.e.
>
>
> # self.ErrorDialog("Images Loaded Successfully")
>
> # for i in range(slicer.MRMLScene.GetNumberOfNodes()):
> # node = slicer.MRMLScene.GetNthNode(i)
> # if node:
> # if node.GetID() == PEMID:
> # if len(node.GetDescription()) == 0:
> # os.system("touch /home/clearpem/pem-pre.txt")
> # slicer.MRMLScene.RemoveNode(node)
> # os.system("touch /home/clearpem/pem-after.txt")
> # if node.GetID() == echoID:
> # if len(node.GetDescription()) == 0:
> # os.system("touch /home/clearpem/echo-pre.txt")
> # slicer.MRMLScene.RemoveNode(node)
> # os.system("touch /home/clearpem/echo-after.txt")
> # if node.GetID() == elastoID:
> # if len(node.GetDescription()) == 0:
> # os.system("touch /home/clearpem/elasto-pre.txt")
> # slicer.MRMLScene.RemoveNode(node)
> # os.system("touch /home/clearpem/elasto-after.txt")
>
> os.system("touch /home/clearpem/end.txt")
>
>
> there is no crash at all (and the "end.txt" file is created). So it really
> seems some strange interaction between a popup and the messing with node
> deleting.
>
> cheers,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2665899.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,
              we are working on a stable 3DSlicer version, the 3.6-2010-06-10-linux-x86_64. Therefore, unfortunately we don't have debugging symbols loaded, so I guess the backtrace is quite unuseful. I'm pasting it anyway.
First of all, if we run Slicer in gdb, upon crash we get


Program received signal SIGSEGV, Segmentation fault.
0x00002aaaac64b1d1 in vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so


so the exit error is in fact a Segmentation fault. Then the output of where or bt is the same


#0  0x00002aaaac64b1d1 in vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
#1  0x00002aaaac64d932 in vtkSlicerApplicationLogic::ProcessReadData() ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
#2  0x00002aaaac6f3806 in vtkSlicerApplicationLogicCppCommand(vtkSlicerApplicationLogic*, Tcl_Interp*, int, char**) ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
#3  0x00002aaab6b6630b in TclInvokeStringCommand () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#4  0x00002aaab6b67b15 in TclEvalObjvInternal () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#5  0x00002aaab6b69184 in Tcl_EvalEx () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#6  0x00002aaab6bc0511 in AfterProc () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#7  0x00002aaab6bbfc7c in TimerHandlerEventProc () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#8  0x00002aaab6bb074a in Tcl_ServiceEvent () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#9  0x00002aaab6bb0975 in Tcl_DoOneEvent () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
#10 0x00002aaaaca3c9e8 in vtkSlicerApplication::DoOneTclEvent() ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
#11 0x00002aaaad27c10f in vtkKWApplication::Start(int, char**) ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
#12 0x00002aaaad27c036 in vtkKWApplication::Start() () from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
#13 0x00002aaaaca3c9bd in vtkSlicerApplication::StartApplication() ()
   from /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
#14 0x000000000043a67f in Slicer3_main(int&, char**) ()
#15 0x000000000044f9d2 in main ()


Cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
Hi Marco,

if you send me your code, I am happy to run the debugger on it this evening.

Cheers,
Daniel

On Mar 14, 2011, at 6:10 AM, ClearPEMSonic wrote:

> Hi Daniel,
>              we are working on a stable 3DSlicer version, the
> 3.6-2010-06-10-linux-x86_64. Therefore, unfortunately we don't have
> debugging symbols loaded, so I guess the backtrace is quite unuseful. I'm
> pasting it anyway.
> First of all, if we run Slicer in gdb, upon crash we get
>
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00002aaaac64b1d1 in
> vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
>
>
> so the exit error is in fact a Segmentation fault. Then the output of where
> or bt is the same
>
>
> #0  0x00002aaaac64b1d1 in
> vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #1  0x00002aaaac64d932 in vtkSlicerApplicationLogic::ProcessReadData() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #2  0x00002aaaac6f3806 in
> vtkSlicerApplicationLogicCppCommand(vtkSlicerApplicationLogic*, Tcl_Interp*,
> int, char**) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #3  0x00002aaab6b6630b in TclInvokeStringCommand () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #4  0x00002aaab6b67b15 in TclEvalObjvInternal () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #5  0x00002aaab6b69184 in Tcl_EvalEx () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #6  0x00002aaab6bc0511 in AfterProc () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #7  0x00002aaab6bbfc7c in TimerHandlerEventProc () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #8  0x00002aaab6bb074a in Tcl_ServiceEvent () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #9  0x00002aaab6bb0975 in Tcl_DoOneEvent () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #10 0x00002aaaaca3c9e8 in vtkSlicerApplication::DoOneTclEvent() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
> #11 0x00002aaaad27c10f in vtkKWApplication::Start(int, char**) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
> #12 0x00002aaaad27c036 in vtkKWApplication::Start() () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
> #13 0x00002aaaaca3c9bd in vtkSlicerApplication::StartApplication() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
> #14 0x000000000043a67f in Slicer3_main(int&, char**) ()
> #15 0x000000000044f9d2 in main ()
>
>
> Cheers,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2675692.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,
            thanks, I really appreciate it.
I've attached our code to this email. Unfortunatelly, being a python plugin that (also) calls a CLI plugin you will have to compile the CLI plugin (it's the Image Loader Marsiglia folder) as well as adding the Image Loader folder to your Slicer. This also contains some python scripts we had to use for managing an external database (those plugins were not written by us). In addition, for testing the plugin you need at least 1 image in an appropriate database, and you can achieve this by copying the data_db folder to your home directory (it's a small directory, 4 MB, i've only incuded one image). You will then find Image Loader plugin in ClearPEM-Sonic category in Slicer. I'm sorry but we couldn't make it simpler for this debugging test.
If everything is set up, you should be able to select patien 1 (Jane Doe) and exam 1, then you can either load full exam or choose a single file.
The version i'm sending you works without crash because (apparently) of line 606 in ImageLoader.py, i.e. the error dialog popup. If I comment that line, I get the Segmentation Fault.
Thanks very much,

marco

2011/3/14 Daniel Haehn <[hidden email]>
Hi Marco,

if you send me your code, I am happy to run the debugger on it this evening.

Cheers,
Daniel

On Mar 14, 2011, at 6:10 AM, ClearPEMSonic wrote:

> Hi Daniel,
>              we are working on a stable 3DSlicer version, the
> 3.6-2010-06-10-linux-x86_64. Therefore, unfortunately we don't have
> debugging symbols loaded, so I guess the backtrace is quite unuseful. I'm
> pasting it anyway.
> First of all, if we run Slicer in gdb, upon crash we get
>
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00002aaaac64b1d1 in
> vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
>
>
> so the exit error is in fact a Segmentation fault. Then the output of where
> or bt is the same
>
>
> #0  0x00002aaaac64b1d1 in
> vtkSlicerApplicationLogic::ProcessReadNodeData(ReadDataRequest&) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #1  0x00002aaaac64d932 in vtkSlicerApplicationLogic::ProcessReadData() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #2  0x00002aaaac6f3806 in
> vtkSlicerApplicationLogicCppCommand(vtkSlicerApplicationLogic*, Tcl_Interp*,
> int, char**) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseLogic.so
> #3  0x00002aaab6b6630b in TclInvokeStringCommand () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #4  0x00002aaab6b67b15 in TclEvalObjvInternal () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #5  0x00002aaab6b69184 in Tcl_EvalEx () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #6  0x00002aaab6bc0511 in AfterProc () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #7  0x00002aaab6bbfc7c in TimerHandlerEventProc () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #8  0x00002aaab6bb074a in Tcl_ServiceEvent () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #9  0x00002aaab6bb0975 in Tcl_DoOneEvent () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/TclTk/lib/libtcl8.4.so
> #10 0x00002aaaaca3c9e8 in vtkSlicerApplication::DoOneTclEvent() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
> #11 0x00002aaaad27c10f in vtkKWApplication::Start(int, char**) ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
> #12 0x00002aaaad27c036 in vtkKWApplication::Start() () from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/KWWidgets/libKWWidgets.so
> #13 0x00002aaaaca3c9bd in vtkSlicerApplication::StartApplication() ()
>   from
> /home/clearpem/Slicer/Slicer3-3.6-2010-06-10-linux-x86_64/lib/Slicer3/libSlicerBaseGUI.so
> #14 0x000000000043a67f in Slicer3_main(int&, char**) ()
> #15 0x000000000044f9d2 in main ()
>
>
> Cheers,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2675692.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject



_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject

ClearPEM-Sonic.tar.gz (4M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi,
          as suggested by Daniel I compiled last stable 3DSlicer version (branches/Slicer-3-6/ , so version 3.6.3 1.0) from source, without disabling python compile, so I can now test the plugin in a compiled version with debugging symbols.

First of all, I confirm that bug is still there, Slicer crashes (segmentation fault) if I comment the line that calls a popup error dialog, and doesn't if line is uncommented. I'm attaching the output of debug commands you suggested to this post

debug.txt

you can safely ignore lines from 20 to 43 and from 55 to 77, they are you some control output we print everytime.

Te python module is called "Image Loader" (the file itself is called ImageLoader.py) while the CLI the we execute inside this python module is called "Image Loader Marsiglia".

Is this debug output somewhat useful to understand what happens? Are there more tests i can run now that could be useful?

cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
Maybe it is a timing problem? Can you try to include a wait statement instead of the dialog?

Daniel

On Mar 15, 2011, at 7:01 PM, ClearPEMSonic wrote:

> Hi,
>          as suggested by Daniel I compiled last stable 3DSlicer version
> (branches/Slicer-3-6/ , so version 3.6.3 1.0) from source, without disabling
> python compile, so I can now test the plugin in a compiled version with
> debugging symbols.
>
> First of all, I confirm that bug is still there, Slicer crashes
> (segmentation fault) if I comment the line that calls a popup error dialog,
> and doesn't if line is uncommented. I'm attaching the output of debug
> commands you suggested to this post
>
> http://slicer-devel.65872.n3.nabble.com/file/n2684300/debug.txt debug.txt
>
> you can safely ignore lines from 20 to 43 and from 55 to 77, they are you
> some control output we print everytime.
>
> Te python module is called "Image Loader" (the file itself is called
> ImageLoader.py) while the CLI the we execute inside this python module is
> called "Image Loader Marsiglia".
>
> Is this debug output somewhat useful to understand what happens? Are there
> more tests i can run now that could be useful?
>
> cheers,
>
> marco
>
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2684300.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,

I tried


time.sleep(20)


instead of the error dialog  the plugin waits 20 seconds, then Slicer crashes as before


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData (this=0x115db60, req=...)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
1665  nd->Modified();


Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,

            I tried, as you suggested, to replace the slicer.MRMLScene.CreateNodeByClass() calls with slicer.vtkMRMLScalarVolumeNode() and slicer.vtkMRMLScalarVolumeDisplayNode(), but nothing changed, we still have a crash with same debug output


Program received signal SIGSEGV, Segmentation fault.
0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData (this=0x115d910, req=...)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
1665  nd->Modified();
(gdb) where
#0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData (this=0x115d910, req=...)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
#1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData (this=0x115d910)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
#2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910, interp=0x795210, argc=2,
    argv=0x7fffffff71e0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
#3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880, interp=0x795210, argc=2,
    argv=0x7fffffff71e0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
#4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#6  0x00007fffe0aa988c in Tcl_EvalEx ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#7  0x00007fffe0b06ec1 in AfterProc ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#8  0x00007fffe0b064cd in TimerHandlerEventProc ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent (this=0xfd4f40)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
#12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1, argv=0x2835ca0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
#13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
---Type <return> to continue, or q <return> to quit---
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
#14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication (this=0xfd4f40)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
#15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c, argv=0x7fffffffbe38)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
#16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583
(gdb) bt
#0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData (this=0x115d910, req=...)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
#1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData (this=0x115d910)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
#2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910, interp=0x795210, argc=2,
    argv=0x7fffffff71e0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
#3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880, interp=0x795210, argc=2,
    argv=0x7fffffff71e0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
#4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#6  0x00007fffe0aa988c in Tcl_EvalEx ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#7  0x00007fffe0b06ec1 in AfterProc ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#8  0x00007fffe0b064cd in TimerHandlerEventProc ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
   from /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
#11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent (this=0xfd4f40)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
#12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1, argv=0x2835ca0)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
#13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
---Type <return> to continue, or q <return> to quit---
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
#14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication (this=0xfd4f40)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
#15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c, argv=0x7fffffffbe38)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
#16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
    at /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583


cheers,

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Daniel Haehn
Hi Marco,

this is not so easy to debug :) It is still hard to believe that the display of a dialog prevents a seg fault..

Maybe we should try to create a minimal example which reproduces the crash. Could you do that - maybe just python without the CLI?

Daniel

On Mar 16, 2011, at 5:57 AM, ClearPEMSonic wrote:

> Hi Daniel,
>
>            I tried, as you suggested, to replace the
> slicer.MRMLScene.CreateNodeByClass() calls with
> slicer.vtkMRMLScalarVolumeNode() and
> slicer.vtkMRMLScalarVolumeDisplayNode(), but nothing changed, we still have
> a crash with same debug output
>
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
> (this=0x115d910, req=...)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
> 1665  nd->Modified();
> (gdb) where
> #0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
> (this=0x115d910, req=...)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
> #1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData
> (this=0x115d910)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
> #2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910,
> interp=0x795210, argc=2,
>    argv=0x7fffffff71e0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
> #3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880,
> interp=0x795210, argc=2,
>    argv=0x7fffffff71e0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
> #4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #6  0x00007fffe0aa988c in Tcl_EvalEx ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #7  0x00007fffe0b06ec1 in AfterProc ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #8  0x00007fffe0b064cd in TimerHandlerEventProc ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent
> (this=0xfd4f40)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
> #12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1,
> argv=0x2835ca0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
> #13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
> ---Type  to continue, or q  to quit---
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
> #14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication
> (this=0xfd4f40)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
> #15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c,
> argv=0x7fffffffbe38)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
> #16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583
> (gdb) bt
> #0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
> (this=0x115d910, req=...)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
> #1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData
> (this=0x115d910)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
> #2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910,
> interp=0x795210, argc=2,
>    argv=0x7fffffff71e0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
> #3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880,
> interp=0x795210, argc=2,
>    argv=0x7fffffff71e0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
> #4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #6  0x00007fffe0aa988c in Tcl_EvalEx ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #7  0x00007fffe0b06ec1 in AfterProc ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #8  0x00007fffe0b064cd in TimerHandlerEventProc ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
>   from
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
> #11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent
> (this=0xfd4f40)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
> #12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1,
> argv=0x2835ca0)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
> #13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
> ---Type  to continue, or q  to quit---
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
> #14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication
> (this=0xfd4f40)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
> #15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c,
> argv=0x7fffffffbe38)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
> #16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
>    at
> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583
>
>
> cheers,
>
> marco
>
> --
> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2686104.html
> Sent from the slicer-devel mailing list archive at Nabble.com.
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

ClearPEMSonic
Hi Daniel,
          yes I can try that, I will post a short python script that reproduces the crash as soon as it's ready.

cheers

marco
Reply | Threaded
Open this post in threaded view
|

Re: Automatically show an image loaded by a background CLI

Andrey Fedorov
In reply to this post by Daniel Haehn
On Wed, Mar 16, 2011 at 07:20, Daniel Haehn <[hidden email]> wrote:
> this is not so easy to debug :) It is still hard to believe that the display of a dialog prevents a seg fault..
>

Can it be that the display of a dialog triggers event processing,
which is required for handling the CLI outputs? You need to get out of
the function that calls CLI to process events, I think. I had similar
issue trying to do the same thing in C some (long) time ago.


> Maybe we should try to create a minimal example which reproduces the crash. Could you do that - maybe just python without the CLI?
>
> Daniel
>
> On Mar 16, 2011, at 5:57 AM, ClearPEMSonic wrote:
>
>> Hi Daniel,
>>
>>            I tried, as you suggested, to replace the
>> slicer.MRMLScene.CreateNodeByClass() calls with
>> slicer.vtkMRMLScalarVolumeNode() and
>> slicer.vtkMRMLScalarVolumeDisplayNode(), but nothing changed, we still have
>> a crash with same debug output
>>
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
>> (this=0x115d910, req=...)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
>> 1665    nd->Modified();
>> (gdb) where
>> #0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
>> (this=0x115d910, req=...)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
>> #1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData
>> (this=0x115d910)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
>> #2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910,
>> interp=0x795210, argc=2,
>>    argv=0x7fffffff71e0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
>> #3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880,
>> interp=0x795210, argc=2,
>>    argv=0x7fffffff71e0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
>> #4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #6  0x00007fffe0aa988c in Tcl_EvalEx ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #7  0x00007fffe0b06ec1 in AfterProc ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #8  0x00007fffe0b064cd in TimerHandlerEventProc ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent
>> (this=0xfd4f40)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
>> #12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1,
>> argv=0x2835ca0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
>> #13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
>> ---Type  to continue, or q  to quit---
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
>> #14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication
>> (this=0xfd4f40)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
>> #15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c,
>> argv=0x7fffffffbe38)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
>> #16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583
>> (gdb) bt
>> #0  0x00007ffff432648d in vtkSlicerApplicationLogic::ProcessReadNodeData
>> (this=0x115d910, req=...)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1665
>> #1  0x00007ffff4323e2c in vtkSlicerApplicationLogic::ProcessReadData
>> (this=0x115d910)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/Logic/vtkSlicerApplicationLogic.cxx:1159
>> #2  0x00007ffff4492abd in vtkSlicerApplicationLogicCppCommand (op=0x115d910,
>> interp=0x795210, argc=2,
>>    argv=0x7fffffff71e0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:414
>> #3  0x00007ffff449164d in vtkSlicerApplicationLogicCommand (cd=0x1163880,
>> interp=0x795210, argc=2,
>>    argv=0x7fffffff71e0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-build/Base/Logic/vtkSlicerApplicationLogicTcl.cxx:31
>> #4  0x00007fffe0aa72e4 in TclInvokeStringCommand ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #5  0x00007fffe0aa8d21 in TclEvalObjvInternal ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #6  0x00007fffe0aa988c in Tcl_EvalEx ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #7  0x00007fffe0b06ec1 in AfterProc ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #8  0x00007fffe0b064cd in TimerHandlerEventProc ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #9  0x00007fffe0af5b17 in Tcl_ServiceEvent ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #10 0x00007fffe0af5e8b in Tcl_DoOneEvent ()
>>   from
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/../Slicer3-lib/tcl-build/lib/libtcl8.4.so
>> #11 0x00007ffff3429990 in vtkSlicerApplication::DoOneTclEvent
>> (this=0xfd4f40)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:655
>> #12 0x00007ffff27618df in vtkKWApplication::Start (this=0xfd4f40, argc=1,
>> argv=0x2835ca0)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1126
>> #13 0x00007ffff2761684 in vtkKWApplication::Start (this=0xfd4f40)
>> ---Type  to continue, or q  to quit---
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3-lib/KWWidgets/vtkKWApplication.cxx:1021
>> #14 0x00007ffff3429940 in vtkSlicerApplication::StartApplication
>> (this=0xfd4f40)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Base/GUI/vtkSlicerApplication.cxx:640
>> #15 0x000000000042d842 in Slicer3_main (argc=@0x7fffffffbd4c,
>> argv=0x7fffffffbe38)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2202
>> #16 0x000000000042fc6e in main (argc=1, argv=0x7fffffffbe38)
>>    at
>> /home/marco/Universita/Slicer/SlicerSourceLast/Slicer3/Applications/GUI/Slicer3.cxx:2583
>>
>>
>> cheers,
>>
>> marco
>>
>> --
>> View this message in context: http://slicer-devel.65872.n3.nabble.com/Automatically-show-an-image-loaded-by-a-background-CLI-tp2645810p2686104.html
>> Sent from the slicer-devel mailing list archive at Nabble.com.
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject