From: <mva...@us...> - 2011-09-08 18:26:42
|
Revision: 378 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=378&view=rev Author: mvanstralen Date: 2011-09-08 18:26:32 +0000 (Thu, 08 Sep 2011) Log Message: ----------- Small bugfixes Modified Paths: -------------- trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.py trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.script trunk/Community/General/Modules/Macros/Elastix/Transformix.py trunk/Community/General/Modules/Macros/Elastix/Transformix.script Modified: trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.py =================================================================== --- trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.py 2011-09-08 18:24:20 UTC (rev 377) +++ trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.py 2011-09-08 18:26:32 UTC (rev 378) @@ -651,9 +651,9 @@ readArrayParameter(lines, ctx.field("SP_a")); readArrayParameter(lines, ctx.field("SP_capa"), "SP_A"); readArrayParameter(lines, ctx.field("SP_alpha")); - readFloatParameter(lines, ctx.field("SigmoidMin")); - readFloatParameter(ctx.field("SigmoidMax")); - readFloatParameter(ctx.field("SigmoidScale")); + readArrayParameter(lines, ctx.field("SigmoidMin")); + readArrayParameter(ctx.field("SigmoidMax")); + readArrayParameter(ctx.field("SigmoidScale")); readArrayParameter(lines, ctx.field("SigmoidInitialTime")); readBoolParameter(lines, ctx.field("UseAdaptiveStepSizes")); ctx.field("DefineMinimumStepLength").value = readArrayParameter(lines, ctx.field("MaximumStepLength")); @@ -758,9 +758,9 @@ text += arrayParameterToString(ctx.field("SP_a"), numRes); text += arrayParameterToString(ctx.field("SP_capa"), numRes, "SP_A"); text += arrayParameterToString(ctx.field("SP_alpha"), numRes); - text += parameterToString(ctx.field("SigmoidMin")); - text += parameterToString(ctx.field("SigmoidMax")); - text += parameterToString(ctx.field("SigmoidScale")); + text += arrayParameterToString(ctx.field("SigmoidMin"), numRes); + text += arrayParameterToString(ctx.field("SigmoidMax"), numRes); + text += arrayParameterToString(ctx.field("SigmoidScale"), numRes); text += arrayParameterToString(ctx.field("SigmoidInitialTime"), numRes); text += boolParameterToString(ctx.field("UseAdaptiveStepSizes")); if ctx.field("DefineMinimumStepLength").value: Modified: trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.script =================================================================== --- trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.script 2011-09-08 18:24:20 UTC (rev 377) +++ trunk/Community/General/Modules/Macros/Elastix/ElastixParameterFile.script 2011-09-08 18:26:32 UTC (rev 378) @@ -152,9 +152,9 @@ Field UseAdaptiveStepSizes { type = Bool value = True} Field DefineMaximumStepLength {type = Bool value = False} Field MaximumStepLength {type = Double value = 1.0} - Field SigmoidMin {type = Double value = -0.8} - Field SigmoidMax {type = Double value = 1.0} - Field SigmoidScale {type = Double value = 0.00000001} + Field SigmoidMin {type = String value = "-0.8"} + Field SigmoidMax {type = String value = "1.0"} + Field SigmoidScale {type = String value = "0.00000001"} Field SigmoidInitialTime {type = String value = "0"} Field DefineNumberOfGradientMeasurements { type = Bool value = False} Field NumberOfGradientMeasurements { type = Int value = 10} Modified: trunk/Community/General/Modules/Macros/Elastix/Transformix.py =================================================================== --- trunk/Community/General/Modules/Macros/Elastix/Transformix.py 2011-09-08 18:24:20 UTC (rev 377) +++ trunk/Community/General/Modules/Macros/Elastix/Transformix.py 2011-09-08 18:26:32 UTC (rev 378) @@ -91,4 +91,24 @@ MLABFileManager.remove( mhd ); MLABFileManager.remove( raw ); MLABFileManager.remove( zraw ); - \ No newline at end of file + +def inputChanged(): + if ctx.field("updateImageDimension").value: + if ctx.field("input0").isValid(): + if ctx.field("input0").sizeU() > 1: + ctx.field("imageDimension").value = 6; + elif ctx.field("input0").sizeT() > 1: + ctx.field("imageDimension").value = 6; + elif ctx.field("input0").sizeC() > 1: + ctx.field("imageDimension").value = 4; + elif ctx.field("input0").sizeZ() > 1: + ctx.field("imageDimension").value = 3; + else : + ctx.field("imageDimension").value = 2; + +def imageDimensionChanged(): + ctx.field("itkImageFileReader.fileDimension").value = ctx.field("imageDimension").value; + ctx.field("itkImageFileReader1.fileDimension").value = ctx.field("imageDimension").value; + ctx.field("itkImageFileReader2.fileDimension").value = ctx.field("imageDimension").value; + ctx.field("itkImageFileReader3.fileDimension").value = ctx.field("imageDimension").value; + \ No newline at end of file Modified: trunk/Community/General/Modules/Macros/Elastix/Transformix.script =================================================================== --- trunk/Community/General/Modules/Macros/Elastix/Transformix.script 2011-09-08 18:24:20 UTC (rev 377) +++ trunk/Community/General/Modules/Macros/Elastix/Transformix.script 2011-09-08 18:26:32 UTC (rev 378) @@ -72,6 +72,8 @@ Field createJacobianMatrixField { type = Bool value = False } Field update { type = Trigger } Field deleteFiles { type = Trigger } + Field imageDimension { type = Enum values = "2, 3, 4, 6" } + Field updateImageDimension { type = Bool value = True } } } @@ -86,20 +88,27 @@ FieldListener deleteFiles { command = deleteFiles } + FieldListener input0 { + command = inputChanged + } } Window { Vertical { Box Transformix { Field tranformixExecutable { browseMode = open browseButton = On} - Separator {} - Field workingDirectory { browseMode = directory browseButton = On} - Field autoUpdateTransformationFile {} + Field workingDirectory { browseMode = directory browseButton = On} } Box Input { - Field transformationFile { browseButton = On browseMode = open browseFilter = "\*.txt"} + Field autoUpdateTransformationFile { title = "Auto update from working directory:"} + Field transformationFile { browseButton = On browseMode = open browseFilter = "\*.txt"} } Box Output { + Horizontal { + alignX = Left + Field imageDimension { } + Field updateImageDimension { title = "Auto update from input image:" } + } Field createImage { edit = False} Field createDeformationField {} Field createJacobianField {} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |