[slicer-users] How to run external file from Slicer Scripted Module Example?

Madan Rao rao.lms at gmail.com
Thu Feb 18 10:36:09 EST 2010

Hello all,

I am trying to run a simple hello.cpp program from slicer3:

#include <string.h>
#include <stdlib.h>
#include <stdio.h>

void main(){
FILE *fp1;

fprintf(fp1,"Hello how are you?\n");

hello.exe file is in C:\vmtktest\plugin folder.

I changed the following code in ScriptedModuleExampleGUI.tcl

proc ScriptedModuleExampleApply {this} {

  exec c:/vmtktest/plugin/hello

When I click the apply button in Scripted Module Example module there is no
error but the hello.txt is not printed.

I can run successfully:

exec c:/windows/system32/cmd.exe /c start /min c:/windows/system32/notepad
/p myfile.txt

What is the correct tcl code to print hello.txt?

AM Mohan Rao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://massmail.spl.harvard.edu/pipermail/slicer-users/attachments/20100218/01e26602/attachment.html>

More information about the slicer-users mailing list