[slicer-users] Displaying stdout in a packaged Slicer on Windows

Steve Pieper pieper at bwh.harvard.edu
Tue Apr 20 08:43:15 EDT 2010

Hi Ali -

I see what you mean - did you try using the launch to create a shell 
with the right paths set?

./Slicer3 --launch rxvt &

Inside the newly launched window, you can run:


There's some more information on debugging here:



On Apr/19/10 1:01 AM, Ali Uneri wrote:
> Hello Steve,
> Thank you for your response, here are some of my experiences with this issue:
>   * I was previously using Slicer3.exe in the bin directory, which was
> popping up command prompt and working nicely, until I realized
> interesting bugs (possibly) due to some paths not being set.
>   * Using rxvt does sort of work, but it fails to correctly receive
> some stdio, e.g. python parsing errors are not displayed, print
> statements arrive on exit, etc.
>   * Adding "console show" line in launch.tcl has the same effect as
> rxvt, and suffers from the same issues, but at least does not require
> Cygwin.
>   * I also tried using "exec" and redirecting the output to a log file;
> same results as above.
> I'm not sure of the exact drawbacks (or the actual purpose) in using
> bin/Slicer3.exe as opposed to the default Slicer3 launcher. It would
> be nice to be able to use bin/Slicer.exe and bypass TCL, at least for
> development purposes. Using "Slicer Messages" are very useful, but
> catching the unhandled errors would be a time saver, especially when
> scripting CLI modules on the fly.
> Thank you,
> Ali
> On Fri, Apr 16, 2010 at 10:28, Steve Pieper<pieper at bwh.harvard.edu>  wrote:
>> Hi Ali -
>> Stdio on windows is tricky, and I don't think there's a general solution for
>> what you need.  The interaction between a windows command prompt vs. the
>> unix concepts of stdin and stdout isn't always well defined in my
>> experience.
>> On thing I would strong suggest is using rxvt on cygwin rather than the cmd
>> prompt or the standard windows console.  You can get rxvt (basically a port
>> of xterm) through the cygwin setup.exe interface.
>> For code in slicer I would suggest using one of the methods below - the
>> print to stdout, but also add to the slicer log window from which you can
>> save them out to a file.  They also call a native window print function that
>> will try to get the message into the console.
>> Best,
>> Steve
>> vtkSlicerApplication::InformationMessage(const char* message)
>> vtkSlicerApplication::WarningMessage(const char* message)
>> vtkSlicerApplication::ErrorMessage(const char* message)
>> vtkSlicerApplication::DebugMessage(const char* message)
>> On Apr/7/10 8:18 PM, Ali Uneri wrote:
>>> Hello,
>>> It seems that launch.tcl is suppressing stdout on Windows.
>>> Running bin/Slicer3.exe through launcher (as opposed to
>>> bin/Slicer3-real.exe) seems to pop up a Slicer3-real command prompt
>>> screen, but nothing is displayed, and there is no clear way to
>>> redirect the actual stdout to this console window. FYI, our package
>>> has been built against a version of Slicer with win32-console enabled.
>>> On the same line of thought, would it be possible to also redirect
>>> stdout to a log file?
>>> Thank you,
>>> Ali
>>> _______________________________________________
>>> slicer-users mailing list
>>> slicer-users at bwh.harvard.edu
>>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-users
>>> To unsubscribe: send email to
>>> slicer-users-request at massmail.spl.harvard.edu with unsubscribe as the
>>> subject

More information about the slicer-users mailing list