From: <mva...@us...> - 2011-07-26 10:51:42
|
Revision: 368 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=368&view=rev Author: mvanstralen Date: 2011-07-26 10:51:32 +0000 (Tue, 26 Jul 2011) Log Message: ----------- * Added the following ISI modules * Added BuildProjects module * Added CallApplication module * Added CallElastix module * Added Elastix module * Added ElastixParameterFile module * Added Transformix module * Added SendEMail module Modified Paths: -------------- trunk/Community/General/Modules/Groups.def Added Paths: ----------- trunk/Community/General/Modules/Macros/Build/ trunk/Community/General/Modules/Macros/Build/BuildProjects.def trunk/Community/General/Modules/Macros/Build/BuildProjects.mlab trunk/Community/General/Modules/Macros/Build/BuildProjects.py trunk/Community/General/Modules/Macros/Build/BuildProjects.script trunk/Community/General/Modules/Macros/Build/html/ trunk/Community/General/Modules/Macros/Build/html/BuildProjects.html trunk/Community/General/Modules/Macros/Build/html/BuildProjects.mlhelp trunk/Community/General/Modules/Macros/Build/networks/ trunk/Community/General/Modules/Macros/Build/networks/BuildProjectsExample.mlab trunk/Community/General/Modules/Macros/Command/CallApplication.def trunk/Community/General/Modules/Macros/Command/CallApplication.py trunk/Community/General/Modules/Macros/Command/CallApplication.script trunk/Community/General/Modules/Macros/Command/html/CallApplication.html trunk/Community/General/Modules/Macros/Command/html/CallApplication.mlhelp trunk/Community/General/Modules/Macros/Command/networks/CallApplicationExample.mlab trunk/Community/General/Modules/Macros/EMail/ trunk/Community/General/Modules/Macros/EMail/SendEMail.def trunk/Community/General/Modules/Macros/EMail/SendEMail.mlab trunk/Community/General/Modules/Macros/EMail/SendEMail.script trunk/Community/General/Modules/Macros/EMail/SendMail.py trunk/Community/General/Modules/Macros/EMail/networks/ trunk/Community/General/Modules/Macros/EMail/networks/SendEMailExample.mlab trunk/Community/General/Modules/Macros/Elastix/ trunk/Community/General/Modules/Macros/Elastix/CallElastix.def trunk/Community/General/Modules/Macros/Elastix/CallElastix.mlab trunk/Community/General/Modules/Macros/Elastix/CallElastix.mlhelp trunk/Community/General/Modules/Macros/Elastix/CallElastix.py trunk/Community/General/Modules/Macros/Elastix/CallElastix.script trunk/Community/General/Modules/Macros/Elastix/Elastix.def trunk/Community/General/Modules/Macros/Elastix/Elastix.mlab trunk/Community/General/Modules/Macros/Elastix/Elastix.mlhelp trunk/Community/General/Modules/Macros/Elastix/Elastix.py trunk/Community/General/Modules/Macros/Elastix/Elastix.script trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.def trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.py trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.script trunk/Community/General/Modules/Macros/Elastix/Transformix.def trunk/Community/General/Modules/Macros/Elastix/Transformix.mlab trunk/Community/General/Modules/Macros/Elastix/Transformix.py trunk/Community/General/Modules/Macros/Elastix/Transformix.script trunk/Community/General/Modules/Macros/Elastix/html/ trunk/Community/General/Modules/Macros/Elastix/html/CallElastix.html trunk/Community/General/Modules/Macros/Elastix/html/Elastix.html trunk/Community/General/Modules/Macros/Elastix/html/ElastixParameterFile.html trunk/Community/General/Modules/Macros/Elastix/html/ElastixParameterFile.mlhelp trunk/Community/General/Modules/Macros/Elastix/html/Transformix.html trunk/Community/General/Modules/Macros/Elastix/html/Transformix.mlhelp trunk/Community/General/Modules/Macros/Elastix/networks/ trunk/Community/General/Modules/Macros/Elastix/networks/CallElastixExample.mlab trunk/Community/General/Modules/Macros/Elastix/networks/ElastixExample.mlab trunk/Community/General/Modules/Macros/Elastix/networks/ElastixParameterFileExample.mlab trunk/Community/General/Modules/Macros/Elastix/networks/ExampleParameters.txt trunk/Community/General/Modules/Macros/Elastix/networks/ParameterFile.txt trunk/Community/General/Modules/Macros/Elastix/networks/TransformixExample.mlab trunk/Community/General/Modules/Macros/Elastix/networks/parameters_Rigid.txt trunk/Community/General/Modules/Macros/Elastix/parameters_Template.txt Modified: trunk/Community/General/Modules/Groups.def =================================================================== --- trunk/Community/General/Modules/Groups.def 2011-06-30 10:30:53 UTC (rev 367) +++ trunk/Community/General/Modules/Groups.def 2011-07-26 10:51:32 UTC (rev 368) @@ -22,3 +22,11 @@ type = std shy = false } + +ModuleGroup ISI { + owner = "Image Sciences Institute, ISI, Imaging Division, University Medical Center, Utrecht, The Netherlands" + title = "ISI Modules" + comment = "Internally developed modules of ISI" + type = std + shy = false +} \ No newline at end of file Added: trunk/Community/General/Modules/Macros/Build/BuildProjects.def =================================================================== --- trunk/Community/General/Modules/Macros/Build/BuildProjects.def (rev 0) +++ trunk/Community/General/Modules/Macros/Build/BuildProjects.def 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,49 @@ +// +// Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of ISI nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//---------------------------------------------------------------------------------- +//! BuildProjects module definition +/*! +// \file BuildProjects.def +// \author Marijn van Stralen +// \date 2010-09-20 +*/ +//---------------------------------------------------------------------------------- + +MacroModule BuildProjects { + genre = "Special" + group = ISI + author = "Marijn van Stralen" + status = "work-in-progress" + comment = "Builds all mevislab projects in a directory (windows only)" + keywords = "Visual studio, build, compile, batch" + seeAlso = "" + exampleNetwork = "$(LOCAL)/networks/BuildProjectsExample.mlab" + + externalDefinition = "$(LOCAL)/BuildProjects.script" + +} // MacroModule BuildProjects + Added: trunk/Community/General/Modules/Macros/Build/BuildProjects.mlab =================================================================== --- trunk/Community/General/Modules/Macros/Build/BuildProjects.mlab (rev 0) +++ trunk/Community/General/Modules/Macros/Build/BuildProjects.mlab 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,340 @@ +// MDL v1 utf8 +network { + watchlist = "" +} +module FileDirectory { + internal { + frame = "493 377 104 64" + moduleGroupName = "" + windows { + window _default { + geometry = "296 463 501 558" + sizeHint = "501 566" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = proFiles + rootPath = D:/Documents/Mevislab/Packages/ISI/Cardiac + recursive = TRUE + maxRecursionDepth = -1 + fileType = Files + joinImagePairs = FALSE + include = "**.pro*" + includeRegExp = FALSE + predefined = void + exclude = "" + excludeRegExp = FALSE + ignoreCase = TRUE + fileList = "D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISILeftVentricleRemoveMitralRing/ISILeftVentricleRemoveMitralRing.pro +D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro" + dirMode = Absolute + } + internalFields = "" +} +module StringUtils { + internal { + frame = "333 165 88 56" + moduleGroupName = "" + windows { + window _default { + geometry = "190 690 983 331" + sizeHint = "370 331" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = StringUtils + operationType = Concatenate + string1 = / + string2 = Build + string3 = " release " + string4 = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.vcproj + string5 = "" + string6 = "" + stringPrefix = [ + stringPostfix = ] + toggle1 = TRUE + toggle2 = TRUE + toggle3 = TRUE + toggle4 = TRUE + toggle5 = FALSE + toggle6 = FALSE + togglePrefix = FALSE + togglePostfix = FALSE + separator = "" + selectSeparator = 0 + toggleIgnoreCase = FALSE + inPos1 = 0 + inPos2 = 0 + } +} +module CallApplication { + internal { + frame = "481 161 112 64" + moduleGroupName = "" + windows { + window _default { + geometry = "255 275 1110 364" + sizeHint = "277 364" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = buildRelease + executable = "C:/Program Files (x86)/Microsoft Visual Studio 8/Common7/IDE/devenv.exe" + arguments = "/Rebuild debug D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.vcproj" + workingDirectory = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ + outputToLogWindow = FALSE + logWindow = "" + } + internalFields = "" +} +module StringUtils { + internal { + frame = "329 317 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "299 280 1076 331" + sizeHint = "234 204" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = StringUtils1 + operationType = Replace + string1 = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro + string2 = .pro + string3 = .vcproj + string4 = "" + string5 = "" + string6 = "" + stringPrefix = [ + stringPostfix = ] + toggle1 = TRUE + toggle2 = TRUE + toggle3 = FALSE + toggle4 = FALSE + toggle5 = FALSE + toggle6 = FALSE + togglePrefix = FALSE + togglePostfix = FALSE + separator = "" + selectSeparator = 0 + toggleIgnoreCase = FALSE + inPos1 = 0 + inPos2 = 0 + } +} +module StringUtils { + internal { + frame = "329 229 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "235 600 1076 331" + sizeHint = "234 204" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = StringUtils2 + operationType = Replace + string1 = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro + string2 = .pro + string3 = .bat + string4 = "" + string5 = "" + string6 = "" + stringPrefix = [ + stringPostfix = ] + toggle1 = TRUE + toggle2 = TRUE + toggle3 = FALSE + toggle4 = FALSE + toggle5 = FALSE + toggle6 = FALSE + togglePrefix = FALSE + togglePostfix = FALSE + separator = "" + selectSeparator = 0 + toggleIgnoreCase = FALSE + inPos1 = 0 + inPos2 = 0 + } +} +module FieldIterator { + internal { + frame = "497 313 96 64" + moduleGroupName = "" + windows { + window _default { + geometry = "948 286 415 317" + sizeHint = "415 317" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = projectIter + fieldNames = "" + fieldValues = "D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISILeftVentricleRemoveMitralRing/ISILeftVentricleRemoveMitralRing.pro +D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro" + fieldSeparator = [,;] + valueSeparator = "\\n\\r|\\r\\n|[\\n\\r\\\\]" + valueHeader = FALSE + numValues = 2 + indexTranslation = 0 + curIndex = 1 + curValue = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro + newValueEnable = FALSE + verbose = FALSE + delay = 1 + loop = FALSE + running = FALSE + autoReset = FALSE + } + internalFields = "" +} +module FileInformation { + internal { + frame = "665 317 112 56" + moduleGroupName = "" + windows { + window _default { + geometry = "601 237 655 306" + sizeHint = "236 306" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = FileInformation + path = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro + dirname = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ + filename = ISIPointTrackingDP2DT.pro + basename = ISIPointTrackingDP2DT + extension = .pro + type = File + size = 1576 + createDate = 2010-09-24T15:54:11 + exists = TRUE + isDirectory = FALSE + isReadable = TRUE + isWritable = TRUE + } + internalFields = "" +} +module CallApplication { + internal { + frame = "481 97 112 64" + moduleGroupName = "" + windows { + window _default { + geometry = "200 217 1057 364" + sizeHint = "277 364" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = buildDebug + executable = "C:/Program Files (x86)/Microsoft Visual Studio 8/Common7/IDE/devenv.exe" + arguments = "/Rebuild debug D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.vcproj" + workingDirectory = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ + outputToLogWindow = FALSE + logWindow = "" + } + internalFields = "" +} +module StringUtils { + internal { + frame = "329 101 96 56" + moduleGroupName = "" + windows { + window _default { + geometry = "193 246 1075 331" + sizeHint = "370 331" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = StringUtils3 + operationType = Concatenate + string1 = / + string2 = Rebuild + string3 = " debug " + string4 = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.vcproj + string5 = "*"*" + string6 = "" + stringPrefix = [ + stringPostfix = ] + toggle1 = TRUE + toggle2 = TRUE + toggle3 = TRUE + toggle4 = TRUE + toggle5 = FALSE + toggle6 = FALSE + togglePrefix = FALSE + togglePostfix = FALSE + separator = "" + selectSeparator = 0 + toggleIgnoreCase = FALSE + inPos1 = 0 + inPos2 = 0 + } +} +module CallApplication { + internal { + frame = "481 225 112 64" + moduleGroupName = "" + windows { + window _default { + geometry = "939 406 717 364" + sizeHint = "277 364" + wasOpen = no + wasActive = no + } + } + } + fields { + instanceName = callBAT + executable = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.bat + arguments = "" + workingDirectory = D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ + outputToLogWindow = FALSE + logWindow = "" + } + internalFields = "" +} +connections { + StringUtils.string4 = StringUtils1.result + buildRelease.arguments = StringUtils.result + buildRelease.workingDirectory = FileInformation.dirname + StringUtils1.string1 = projectIter.curValue + StringUtils2.string1 = projectIter.curValue + projectIter.fieldValues = proFiles.fileList + FileInformation.path = projectIter.curValue + buildDebug.arguments = StringUtils3.result + buildDebug.workingDirectory = FileInformation.dirname + StringUtils3.string4 = StringUtils1.result + callBAT.executable = StringUtils2.result + callBAT.workingDirectory = FileInformation.dirname +} +networkModel = "" Added: trunk/Community/General/Modules/Macros/Build/BuildProjects.py =================================================================== --- trunk/Community/General/Modules/Macros/Build/BuildProjects.py (rev 0) +++ trunk/Community/General/Modules/Macros/Build/BuildProjects.py 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,171 @@ +#---------------------------------------------------------------------------------- +# +# Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of ISI nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +#---------------------------------------------------------------------------------- + +from mevis import * +import string; +import codecs + +def init(): + ctx.field("directory").value = MLABPackageManager.packageByIdentifier("ISI/General").path().replace("/General", "") + directoryChanged(); + ctx.field("devenvExecutable").value = MLABFileManager.cleanupPath(MLAB.getenv("VS" + MLAB.compilerInfo()[2:MLAB.compilerInfo().find("_")] + "0COMNTOOLS").replace("Tools\\", "IDE\\devenv.exe")) + ctx.field("projectFiles").value = "Create"; + ctx.field("debug").value = "Build"; + ctx.field("release").value = "Build"; + +def directoryChanged(): + ctx.field("proFiles.update").touch(); + return; + +def runBatch(): + ctx.field("buildDebug.executable").value = ctx.field("devenvExecutable").value; + ctx.field("buildRelease.executable").value = ctx.field("devenvExecutable").value; + buildResults = []; + noBatchFile = []; + noProjectFile = []; + ctx.field("progress").value = 0.0; + for i in range(0, ctx.field("projectIter.numValues").value, 1): + ctx.field("projectIter.curIndex").value = i; + projFile = ctx.field("projectIter.curValue").value; projFile = projFile.replace('.pro', '.vcproj'); + basename = ctx.field("FileInformation.basename").value; + if ctx.field("projectFiles").value == "Recreate": + if MLABFileManager.exists(ctx.field("StringUtils2.result").value): #project batch file + ctx.field("callBAT.call").touch(); + else: + print "Error on project " + basename + ": Could not find batch file " + ctx.field("StringUtils2.result").value; + noBatchFile += [basename]; + elif ctx.field("projectFiles").value == "Create": + if not MLABFileManager.exists(projFile): + #print "proj file does not exist: call bat file" + if MLABFileManager.exists(ctx.field("StringUtils2.result").value): #project batch file + ctx.field("callBAT.call").touch(); + else: + print "Error on project " + basename + ": Could not find batch file " + ctx.field("StringUtils2.result").value; + elif MLABFileManager.getLastModifiedDate(ctx.field("projectIter.curValue").value) > MLABFileManager.getLastModifiedDate(projFile): + #print "pro file is newer: call bat file" + ctx.field("callBAT.call").touch(); + if MLABFileManager.exists(projFile): #visual studio project file + if ctx.field("debug").value <> "Skip": + ctx.field("StringUtils3.string2").value = ctx.field("debug").value; + ctx.field("buildDebug.call").touch(); + if ctx.field("debug").value <> "Clear": + ret = checkBuildSuccessful("Debug"); + buildResults += [ret]; + if ctx.field("release").value <> "Skip": + ctx.field("StringUtils.string2").value = ctx.field("release").value; + ctx.field("buildRelease.call").touch(); + if ctx.field("release").value <> "Clear": + ret = checkBuildSuccessful("Release"); + buildResults += [ret]; + else: + print "Error on project " + basename + ": Could not find vcproj file " + projFile; + noProjectFile += [basename]; + ctx.field("progress").value = (i+1.0)/ctx.field("projectIter.numValues").value; + #print buildResults; + debugWithErrors = []; + releaseWithErrors = []; + debugWithWarnings = []; + releaseWithWarnings = []; + for b in buildResults: + if len(b)>0: + if b[1] == 'Debug' and b[2] > 0: + debugWithErrors += [b[0]]; + elif b[1] == 'Release' and b[2] > 0: + releaseWithErrors += [b[0]]; + if b[1] == 'Debug' and b[3] > 0: + debugWithWarnings += [b[0]]; + elif b[1] == 'Release' and b[3] > 0: + releaseWithWarnings += [b[0]]; + print "Build batch completed"; + if ctx.field("projectFiles").value == "Create" or ctx.field("projectFiles").value == "Recreate": + print "--- Project files ----"; + print "The following projects had no batch file (", len(noBatchFile), "):"; + if len(noBatchFile)==0: + print "<none>"; + else: + for p in noBatchFile: + print p; + print "------------------------\n"; + if ctx.field("debug").value == "Build" or ctx.field("debug").value == "Rebuild" or ctx.field("release").value == "Build" or ctx.field("release").value == "Rebuild": + print "-- VCProject files ---"; + print "The following projects had no vcproj file (", len(noProjectFile), "):"; + if len(noProjectFile)==0: + print "<none>"; + else: + for p in noProjectFile: + print p; + print "------------------------\n"; + if ctx.field("debug").value == "Build" or ctx.field("debug").value == "Rebuild": + print "------- Debug --------"; + print "The following projects had errors (", len(debugWithErrors), "):"; + if len(debugWithErrors)==0: + print "<none>"; + else: + for p in debugWithErrors: + print p; + print "The following projects had warnings (", len(debugWithWarnings), "):"; + if len(debugWithWarnings)==0: + print "<none>"; + else: + for p in debugWithWarnings: + print p; + print "------------------------\n"; + if ctx.field("release").value == "Build" or ctx.field("release").value == "Rebuild": + print "------- Release --------"; + print "The following projects had errors (", len(releaseWithErrors), "):"; + if len(releaseWithErrors)==0: + print "<none>"; + else: + for p in releaseWithErrors: + print p; + print "The following projects had warnings (", len(releaseWithWarnings), "):"; + if len(releaseWithWarnings)==0: + print "<none>"; + else: + for p in releaseWithWarnings: + print p; + print "------------------------\n"; + return; + +def checkBuildSuccessful(buildtype): + path = ctx.field("FileInformation.dirname").value; + basename = ctx.field("FileInformation.basename").value; + buildlogFN = path + "/tmp/" + buildtype + "/obj/buildlog.htm"; + try: buildlog = codecs.open(buildlogFN, 'r', 'utf-16'); + except: + print "Error on project " + basename + ": Could not open buildlog for " + buildtype + " build"; + return [basename, buildtype, -1, -1]; + ret = []; + for l in buildlog.readlines(): + words = l.split(); + if len(words) > 0 and str(words[0]) == str(basename): + print int(words[2]), "errors, ", int(words[4]), " warnings"; + ret = [basename, buildtype, int(words[2]), int(words[4])]; + buildlog.close(); + return ret; \ No newline at end of file Added: trunk/Community/General/Modules/Macros/Build/BuildProjects.script =================================================================== --- trunk/Community/General/Modules/Macros/Build/BuildProjects.script (rev 0) +++ trunk/Community/General/Modules/Macros/Build/BuildProjects.script 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,100 @@ +// +// Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of ISI nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +Interface { + Inputs = "" + Outputs = "" + Parameters { + Field directory { internalName = proFiles.rootPath } + Field includeSubDirectories { internalName = proFiles.recursive } + Field recursionDepth { internalName = proFiles.maxRecursionDepth } + Field numberOfProjects { internalName = projectIter.numValues } + Field projectList {internalName = projectIter.fieldValues } + Field devenvExecutable { type = String } + Field run { type = Trigger } + + Field projectFiles { type = Enum values = "Skip, Create, Recreate"} + Field debug {type = Enum values = "Skip, Build, Rebuild, Clean"} + Field release {type = Enum values = "Skip, Build, Rebuild, Clean"} + + Field progress { type = float value = 0 } + } +} + +Commands { + source = $(LOCAL)/BuildProjects.py + + initCommand = init + + FieldListener directory { + command = directoryChanged + } + FieldListener includeSubDirectories { + command = directoryChanged + } + FieldListener recursionDepth { + command = directoryChanged + } + FieldListener run { + command = runBatch + } +} + +Window { + preferredWidth = 600 + preferredHeight = 400 + Vertical { + expandY = Yes + Box "Select project files" { + Field directory { browseButton = Yes browseMode = directory} + Horizontal { + Field includeSubDirectories {} + Field recursionDepth { step = 1 dependsOn = includeSubDirectories } + } + } + Box "Build settings" { + Horizontal { + Field projectFiles { } + Field debug { } + Field release { } + } + Field devenvExecutable { browseButton = Yes browseMode = open browseFilter = "\*.exe" } + Button run { expandX = Yes } + ProgressBar progress {} + } + Box "Projects" { + expandY = Yes + Field numberOfProjects { edit = No} + TextView projectList { + title = "" + edit = no + expandY = Yes + //enabled = False + } + } + } +} \ No newline at end of file Added: trunk/Community/General/Modules/Macros/Build/html/BuildProjects.html =================================================================== --- trunk/Community/General/Modules/Macros/Build/html/BuildProjects.html (rev 0) +++ trunk/Community/General/Modules/Macros/Build/html/BuildProjects.html 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,219 @@ +<!DOCTYPE html> +<html> +<body> +<center> +<a href="#Purpose">Purpose</a> +<a href="#Usage">Usage</a> +<a href="#Parameters">Parameters</a> +<a href="#Known Bugs">Known Bugs</a> + <hr width="100%"> +</center> +<h2>BuildProjects +</h2> +<h3><a name="Purpose"></a>Purpose</h3> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Automatically (re)create project files and compile and link projects for a complete set of MeVisLab packages. <br> +<b>Warning:</b> Only implemented for use on Windows with Visual Studio 2005. With some small changes, it can be used for other compilers in Windows as well. No support for Linux and Mac OS. <br> +</blockquote> +<h3><a name="Usage"></a>Usage</h3> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Select the root directory of the packages that you would like to build. Make sure that the compiler executable is set correctly and configure the way you would like to (re) build your projects. +<b>Warning:</b> It does not check project dependencies. </blockquote> +<h3><a name="Parameters"></a>Parameters</h3> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +The builds can be configured globally, for all projects.</blockquote> +<a name="directory"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Directory</b> + <br> +The root directory of the packages to build.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>D:/Documents/Mevislab/Packages/ISI</b>. +</blockquote> + +<a name="includeSubDirectories"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Include Sub Directories</b> + <br> +Toggle inclusion of subdirectories on/off.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>TRUE</b>. +</blockquote> + +<a name="recursionDepth"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Recursion Depth</b> + <br> +Set the depth of the subdirectory recursion, if applicable.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>-1</b>. +</blockquote> + +<a name="numberOfProjects"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Number Of Projects</b> + <br> +Shows the total number of projects that was found under the root directory.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>83</b>. +</blockquote> + +<a name="projectList"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>(No Title)</b> + <br> +Shows the list of projects to be build.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISILeftVentricleRemoveMitralRing/ISILeftVentricleRemoveMitralRing.pro +D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISILoadTomTecBeutel/ISILoadTomTecBeutel.pro +D:/Documents/Mevislab/Packages/ISI/Cardiac/Sources/ML/ISIPointTrackingDP2DT/ISIPointTrackingDP2DT.pro +D:/Documents/Mevislab/Packages/ISI/Classification/Sources/ML/ISIcvFaceDetection/ISIcvFaceDetection.pro +D:/Documents/Mevislab/Packages/ISI/Classification/Sources/ML/ISIkNN/ISIkNN.pro +D:/Documents/Mevislab/Packages/ISI/Examples/Sources/ML/ISIAddImages/ISIAddImages.pro +D:/Documents/Mevislab/Packages/ISI/Examples/Sources/ML/ISICreateBarcode/ISICreateBarcode.pro +D:/Documents/Mevislab/Packages/ISI/Examples/Sources/ML/ISIMultiThreadSimpleAverage/ISIMultiThreadSimpleAverage.pro +D:/Documents/Mevislab/Packages/ISI/Examples/Sources/ML/ISISubtractMeanExample/ISISubtractMeanExample.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIAreaUnderTheCurve/ISIAreaUnderTheCurve.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIBiasFieldCorrection/ISIBiasFieldCorrection.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIcvSaveAVI/ISIcvSaveAVI.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIDiceSimilarityIndex/ISIDiceSimilarityIndex.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIDynamicProgrammingPath/ISIDynamicProgrammingPath.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIEvaluateMetric/ISIEvaluateMetric.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIImageTo1DImage/ISIImageTo1DImage.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIISIParRecLoad/ISIISIParRecLoad.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIITKPhilipsRecParLoad/ISIITKPhilipsRecParLoad.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISILogValue/ISILogValue.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIMaxFlow/ISIMaxFlow.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIMergeQuadrants2D/ISIMergeQuadrants2D.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISINormalizeCurves/ISINormalizeCurves.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIOneDimensionalStatistics/ISIOneDimensionalStatistics.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIPIP/ISIPIP.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIRadiograph/ISIRadiograph.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIShiftImageForShiftedInterpolation/ISIShiftImageForShiftedInterpolation.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISISIFTnD/ISISIFTnD.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISITextureMatching1D/ISITextureMatching1D.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKArrayArithmetic/ISIVTKArrayArithmetic.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKArrayToMLArray/ISIVTKArrayToMLArray.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKIterativeClosestPointTransform/ISIVTKIterativeClosestPointTransform.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKLandmarkTransform/ISIVTKLandmarkTransform.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKPointSetReplacePoints/ISIVTKPointSetReplacePoints.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKPointSetToXMarkerList/ISIVTKPointSetToXMarkerList.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKPointToPointDistance/ISIVTKPointToPointDistance.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKPolyDataMean/ISIVTKPolyDataMean.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKPolyDataReplacePoints/ISIVTKPolyDataReplacePoints.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIVTKSimpleObjWriter/ISIVTKSimpleObjWriter.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIXMarkerListSave/ISIXMarkerListSave.pro +D:/Documents/Mevislab/Packages/ISI/General/Sources/ML/ISIXMarkerListToVtkPolyData/ISIXMarkerListToVtkPolyData.pro +D:/Documents/Mevislab/Packages/ISI/Hifu/Sources/ML/ISIFUSDriver/ISIFUSDriver.pro +D:/Documents/Mevislab/Packages/ISI/Hifu/Sources/ML/ISINeoptixClient/ISINeoptixClient.pro +D:/Documents/Mevislab/Packages/ISI/Hifu/Sources/ML/ISIPFRTemperatureMap/ISIPFRTemperatureMap.pro +D:/Documents/Mevislab/Packages/ISI/Hifu/Sources/ML/ISIRealTIClient/ISIRealTIClient.pro +D:/Documents/Mevislab/Packages/ISI/Neuro/Sources/ML/ISIFANNSegmentation/ISIFANNSegmentation.pro +D:/Documents/Mevislab/Packages/ISI/Neuro/Sources/ML/ISIStealthLinkWrapper/ISIStealthLinkWrapper.pro +D:/Documents/Mevislab/Packages/ISI/Neuro/Sources/ML/ISITemporalMeanSquaredDifferenceFilter/ISITemporalMeanSquaredDifferenceFilter.pro +D:/Documents/Mevislab/Packages/ISI/Neuro/Sources/ML/ISITIPSFilter/ISITIPSFilter.pro +D:/Documents/Mevislab/Packages/ISI/Registration/Sources/ML/ISIApplyDeformationField/ISIApplyDeformationField.pro +D:/Documents/Mevislab/Packages/ISI/Registration/Sources/ML/ISIApplyDeformationFieldToPolyData/ISIApplyDeformationFieldToPolyData.pro +D:/Documents/Mevislab/Packages/ISI/Registration/Sources/ML/ISIInvertDeformationField/ISIInvertDeformationField.pro +D:/Documents/Mevislab/Packages/ISI/Registration/Sources/ML/ISIVectorFieldToVTKPolyData/ISIVectorFieldToVTKPolyData.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIAAMPoseArrayToMatrix/ISIAAMPoseArrayToMatrix.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIAAMSampleANNLabelArray/ISIAAMSampleANNLabelArray.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIAAMSampleANNPointArray/ISIAAMSampleANNPointArray.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIBuildTextureLookupImage/ISIBuildTextureLookupImage.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIComputeCostsHierarchicalPCAStatisticalShapeModel/ISIComputeCostsHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIComputeCumCostsHierarchicalPCAStatisticalShapeModel/ISIComputeCumCostsHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISICreateAppearance/ISICreateAppearance.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISICreateDeformationFieldWithPolyDatas/ISICreateDeformationFieldWithPolyDatas.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIDecorateHierarchicalPCAStatisticalShapeModel/ISIDecorateHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIGraphCutShapeMatch/ISIGraphCutShapeMatch.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIHierarchicalPCAStatisticalShapeModel/ISIHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIHierarchicalPCAStatisticalShapeModelToPolyData/ISIHierarchicalPCAStatisticalShapeModelToPolyData.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIHierarchicalPolyDataFilter/ISIHierarchicalPolyDataFilter.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIImageMatrixInverse/ISIImageMatrixInverse.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIImageToVTKPolyData/ISIImageToVTKPolyData.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIMatrixMultiplicationOfImages/ISIMatrixMultiplicationOfImages.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIPCAStatisticalShapeModel/ISIPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIProcrustesAlignmentFilter/ISIProcrustesAlignmentFilter.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIProjectPointsOnVTKPolyData/ISIProjectPointsOnVTKPolyData.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIRegularizeHierarchicalPCAStatisticalShapeModel/ISIRegularizeHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISISample1DTextureAtSurfacePoints/ISISample1DTextureAtSurfacePoints.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISISampleTextureWithLookup/ISISampleTextureWithLookup.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISITransformHierarchicalPCAStatisticalShapeModel/ISITransformHierarchicalPCAStatisticalShapeModel.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIVTKArrayVTKPolyDataVV/ISIVTKArrayVTKPolyDataVV.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIVTKPolyDataAddWhiskers/ISIVTKPolyDataAddWhiskers.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIVTKPolyDataRemoveWhiskers/ISIVTKPolyDataRemoveWhiskers.pro +D:/Documents/Mevislab/Packages/ISI/StatisticalModeling/Sources/ML/ISIVTKPolyDataToImage/ISIVTKPolyDataToImage.pro +D:/Documents/Mevislab/Packages/ISI/ThirdParty/Sources/ann_1.1.2/ANN.pro +D:/Documents/Mevislab/Packages/ISI/ThirdParty/Sources/fann-2.1.0/fann.pro +D:/Documents/Mevislab/Packages/ISI/ThirdParty/Sources/gpc/gpc.pro +D:/Documents/Mevislab/Packages/ISI/ThirdParty/Sources/StealthLinkLibrary/StealthLinkLibrary.pro</b>. +</blockquote> + +<a name="devenvExecutable"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Devenv Executable</b> + <br> +The compiler executable. For VS2005 it is devenv.exe, for other compilers it might be a different name.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>C:/Program Files (x86)/Microsoft Visual Studio 8/Common7/IDE/devenv.exe</b>. +</blockquote> + +<a name="run"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Run</b> + <br> +Start building the projects.</blockquote> +<a name="projectFiles"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Project Files</b> + <br> +Choose the mode for project file generation:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not create project files.<br> +<b>Create:</b> Create the project file(s) only if they do not extist yet.<br> +<b>Recreate:</b> Alsways (re)create the project file(s). +</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>Create</b>. +</blockquote> + +<a name="debug"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Debug</b> + <br> +Choose the mode for the debug version:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not build the debug vesrion.<br> +<b>Build:</b> Build the debug version only if it is out-of-date or unexisting.<br> +<b>Rebuild:</b> Alsways (re)build the debug version.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>Build</b>. +</blockquote> + +<a name="release"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Release</b> + <br> +Choose the mode for the release version:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not build the release vesrion.<br> +<b>Build:</b> Build the release version only if it is out-of-date or unexisting.<br> +<b>Rebuild:</b> Alsways (re)build the release version.</blockquote> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +Default is <b>Build</b>. +</blockquote> + +<a name="progress"></a><blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<br> + <b>Progress</b> + <br> +Shows the progress of the total build task.</blockquote> +<h3><a name="Known Bugs"></a>Known Bugs</h3> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +None</blockquote> +<br> +<br> +<br> +<br> +</body> +</html> Added: trunk/Community/General/Modules/Macros/Build/html/BuildProjects.mlhelp =================================================================== --- trunk/Community/General/Modules/Macros/Build/html/BuildProjects.mlhelp (rev 0) +++ trunk/Community/General/Modules/Macros/Build/html/BuildProjects.mlhelp 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,143 @@ +ML_DOC_VERSION = 1.0 +ML_DOC_MODULE_NAME = BuildProjects +ML_DOC_NUM_SECTIONS = 22 +ML_DOC_SECTION { + NAME = Purpose + TYPE = Text + DESC = "Automatically (re)create project files and compile and link projects for a complete set of MeVisLab packages. <br> +<b>Warning:</b> Only implemented for use on Windows with Visual Studio 2005. With some small changes, it can be used for other compilers in Windows as well. No support for Linux and Mac OS. <br> +" +} +ML_DOC_SECTION { + NAME = Usage + TYPE = Text + DESC = "Select the root directory of the packages that you would like to build. Make sure that the compiler executable is set correctly and configure the way you would like to (re) build your projects. +<b>Warning:</b> It does not check project dependencies. " +} +ML_DOC_SECTION { + NAME = Details + TYPE = Text + ON = FALSE +} +ML_DOC_SECTION { + NAME = Inputs + TYPE = Text + ON = FALSE +} +ML_DOC_SECTION { + NAME = Outputs + TYPE = Text + ON = FALSE +} +ML_DOC_SECTION { + NAME = Parameters + TYPE = Text + DESC = "The builds can be configured globally, for all projects." +} +ML_DOC_SECTION { + NAME = instanceName + TYPE = Parameter + ON = FALSE + SHOW_INFO_LINE = FALSE +} +ML_DOC_SECTION { + NAME = directory + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "The root directory of the packages to build." +} +ML_DOC_SECTION { + NAME = includeSubDirectories + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Toggle inclusion of subdirectories on/off." +} +ML_DOC_SECTION { + NAME = recursionDepth + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Set the depth of the subdirectory recursion, if applicable." +} +ML_DOC_SECTION { + NAME = numberOfProjects + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Shows the total number of projects that was found under the root directory." +} +ML_DOC_SECTION { + NAME = projectList + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Shows the list of projects to be build." +} +ML_DOC_SECTION { + NAME = devenvExecutable + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "The compiler executable. For VS2005 it is devenv.exe, for other compilers it might be a different name." +} +ML_DOC_SECTION { + NAME = run + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Start building the projects." +} +ML_DOC_SECTION { + NAME = projectFiles + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Choose the mode for project file generation:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not create project files.<br> +<b>Create:</b> Create the project file(s) only if they do not extist yet.<br> +<b>Recreate:</b> Alsways (re)create the project file(s). +" +} +ML_DOC_SECTION { + NAME = debug + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Choose the mode for the debug version:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not build the debug vesrion.<br> +<b>Build:</b> Build the debug version only if it is out-of-date or unexisting.<br> +<b>Rebuild:</b> Alsways (re)build the debug version." +} +ML_DOC_SECTION { + NAME = release + TYPE = Parameter + SHOW_INFO_LINE = FALSE + DESC = "Choose the mode for the release version:<br> +<blockquote style='margin-top:2.0pt;margin-bottom:2.0pt'> +<b>Skip:</b> Do not build the release vesrion.<br> +<b>Build:</b> Build the release version only if it is out-of-date or unexisting.<br> +<b>Rebuild:</b> Alsways (re)build the release version." +} +ML_DOC_SECTION { + NAME = progress + TYPE = Parameter + SHOW_INFO_LINE = FALSE + ADD_DEFAULT = FALSE + DESC = "Shows the progress of the total build task." +} +ML_DOC_SECTION { + NAME = "Events And Interaction" + TYPE = Text + ON = FALSE +} +ML_DOC_SECTION { + NAME = Example + TYPE = Text + ON = FALSE + DESC = "See example network" +} +ML_DOC_SECTION { + NAME = "Tips And Tricks" + TYPE = Text + ON = FALSE +} +ML_DOC_SECTION { + NAME = "Known Bugs" + TYPE = Text + DESC = None +} Added: trunk/Community/General/Modules/Macros/Build/networks/BuildProjectsExample.mlab =================================================================== --- trunk/Community/General/Modules/Macros/Build/networks/BuildProjectsExample.mlab (rev 0) +++ trunk/Community/General/Modules/Macros/Build/networks/BuildProjectsExample.mlab 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,7 @@ +module BuildProjects { + fields { + instanceName = BuildProjects + } + +} + Added: trunk/Community/General/Modules/Macros/Command/CallApplication.def =================================================================== --- trunk/Community/General/Modules/Macros/Command/CallApplication.def (rev 0) +++ trunk/Community/General/Modules/Macros/Command/CallApplication.def 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,50 @@ +//---------------------------------------------------------------------------------- +// +// Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of ISI nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//---------------------------------------------------------------------------------- +//! CallApplication module definition +/*! +// \file CallApplication.def +// \author Marijn van Stralen +// \date 2009-10-19 +*/ +//---------------------------------------------------------------------------------- + +MacroModule CallApplication { + genre = "Special" + author = "Marijn van Stralen" + status = "work-in-progress" + comment = "Calls an application using a command line call" + keywords = "call, command line, executable" + seeAlso = "ISICallElastix" + exampleNetwork = "$(LOCAL)/networks/CallApplicationExample.mlab" + + externalDefinition = "$(LOCAL)/CallApplication.script" + scriptOnly = yes + +} // MacroModule CallApplication + Added: trunk/Community/General/Modules/Macros/Command/CallApplication.py =================================================================== --- trunk/Community/General/Modules/Macros/Command/CallApplication.py (rev 0) +++ trunk/Community/General/Modules/Macros/Command/CallApplication.py 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,106 @@ +#---------------------------------------------------------------------------------- +# +# Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of ISI nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +#---------------------------------------------------------------------------------- +#! Macro module CallApplication +#/*! +# \file CallApplication.py +# \author Marijn van Stralen +# \date 2009-10-19 +# +# Calls an application using a command line call +#*/ +#---------------------------------------------------------------------------------- + +from mevis import * + +import os.path +import os +import glob +import string + +def processOut(p): + m = p.readStdOut(); + ctx.field("logWindow").value += m; + return + +def processExit(p): + MLAB.log("The following process has finished: " + p.userInfo() ); + return; + +def clear(): + ctx.field("logWindow").value = ""; + return + +def call(): + success = False; + ctx.field("callSucceeded").value = success; + prog = ctx.field("executable").value; + args = str(ctx.field("arguments").value).split(" "); + workingdir = ctx.field("workingDirectory").value; + g_Process = MLAB.newProcess(); + #global g_Process; + MLAB.processEvents(False); + MLAB.log( prog + " is started with the following options:"); + MLAB.log(args); + if g_Process: + g_Process.kill(); + if g_Process: + MLAB.deleteProcess( g_Process ); + g_Process = MLAB.newProcess(); + g_Process.clearArguments(); + g_Process.addArgument(prog); + g_Process.addArguments(args); + g_Process.setWorkDir(workingdir); + if ctx.field("outputToLogWindow").value: + g_Process.setStdOutHandler(ctx,"processOut"); + g_Process.setStdErrHandler(ctx,"processOut"); + g_Process.setExitedHandler(ctx,"processExit"); + g_Process.setUserInfo( prog ); + g_Process.run(); + g_Process.waitForLaunch(); + if g_Process.isRunning(): + MLAB.log(prog + " is running"); + success = True; + else: + MLAB.log(prog + " failed to start"); + success = False; + MLAB.processEvents(True); + if g_Process: + g_Process.waitForExit(); + if g_Process: + MLAB.deleteProcess( g_Process ); + ctx.field("callSucceeded").value = success; + return ; + +#//# MeVis signature v1 +#//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBANEfsmYse2e1dRhkQ9AQbreCq9uxwzWLoGom13MNYmyfwoJqQOEXljLFAgw2eEjaT12G4CdqKWhRxh9ANP6n7GMCARE=:VI/mB8bT4u+mRtf/ru8yUQi8BzpaS3UeL2x62YxsUYnVqCWuLrVNLiukIIjnJMKQXlc8ezmgOIcVAV7pgvgKpQ== +#//# owner: MeVis +#//# date: 2009-06-10T03:33:37 +#//# hash: lks83XOD1rwLpts/0uROAT66Ocrko+7LhFbofqmeuxV1ZH30HY6fhGIHF+HZNbHAg04QggrC+0bSlk6r3GDj5Q== +#//# MeVis end + Added: trunk/Community/General/Modules/Macros/Command/CallApplication.script =================================================================== --- trunk/Community/General/Modules/Macros/Command/CallApplication.script (rev 0) +++ trunk/Community/General/Modules/Macros/Command/CallApplication.script 2011-07-26 10:51:32 UTC (rev 368) @@ -0,0 +1,89 @@ +//---------------------------------------------------------------------------------- +// +// Copyright (c) 2011, Image Sciences Institute, UMC Utrecht. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of ISI nor the names of its contributors +// may be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ISI BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +// OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +//---------------------------------------------------------------------------------- +//! Macro module CallApplication +/*! +// \file CallApplication.script +// \author Marijn van Stralen +// \date 2009-10-19 +// +// Calls an application using a command line call +*/ +//---------------------------------------------------------------------------------- + + +Interface { + Inputs {} + Outputs {} + Parameters { + // The executable file to be called + Field executable { type = string value = "" } + // The program arguments + Field arguments { type = string value = "" } + // The working diectory for the application + Field workingDirectory { type = string value = "" } + + Field outputToLogWindow { type = bool value = True } + Field call { type = trigger } + Field logWindow { type = string value = ""} + Field clear {type = trigger} + Field callSucceeded {type = Bool value = False} + } +} + + +Commands { + source = $(LOCAL)/CallApplication.py + FieldListener call { + command = call + } + FieldListener clear { + command = clear + } +} + +Window { + Vertical { + expandY = 1 + Field executable { browseButton = True browseMode = open browseFilter = "\*.exe" } + Field arguments {} + Field workingDirectory { browseButton = True browseMode = directory } + Field outputToLogWindow {} + Field callSucceeded { edit = False} + Horizontal { Field call {} Field clear{} } + TextView logWindow { console = True edit = False expandY = 1 } + } +} + +//# MeVis signature v1 +//# key: MFowDQYJKoZIhvcNAQEBBQADSQAwRgJBANEfsmYse2e1dRhkQ9AQbreCq9uxwzWLoGom13MNYmyfwoJqQOEXljLFAgw... [truncated message content] |