batchmake help?

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

batchmake help?

Lauren O'Donnell
Hello all,
I've been trying to make batchmake modules to script some DTI
processing.  I didn't at first realize you could set up batchmake with
only XML code since I looked at the Gaussian Blur directory after
reading the batchmake/slicer tutorial on the kitware wiki.  So I have
produced one module that works (the complicated way) and then I have
been unable to get the simple method to work. First I have two
questions about the original more complicated method, then a question
about the simpler method.  Thanks!! -- Lauren
1. What is the function of the batchmakemodule.bmm.in? Is this used?
2. To get parameters passed to the slicer module
(DiffusionTensorEstimation) that the batchmake module uses, the
setappoption function seemed to need the full variable name for
required input/output arguments (like inputVolume) that normally use
no flag on the command line. However to assign optional parameters
that normally have a flag, the full variable name did not work, and I
finally got it to work using the flag. This was confusing to me, does
anyone understand it? For example:
// IO information uses variable name
  script += "    setappoption(dtapp.inputVolume ${file})\n";
  script += "    setappoption(dtapp.outputTensor ${outputFilename})\n";
// parameters instead use name of flag on command line
// flag -e, variable name estimationMethod
  script += "    setappoption(dtapp.e " + estimationMethod + ")\n";
// flag -shiftNeg, variable name shiftNegativeEigenvalues
  out1 << ShiftNegativeEigenvalues;
  script += "    setappoption(dtapp.shiftNeg " + out1.str() + ")\n";
3. This is regarding the simple version where you just make the XML
file and use the GenericBatchMakeModule. I get this error when trying
to run my DiffusionTensorMathematicsBatchMake.  It seems the parameter
names are doubled (inputVolume.inputVolume) by the
GenericBatchMakeModule/BatchMakeModule.cxx that is used for the cxx
code for this module. Is this causing the error?
Running = /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
--xml
echo('Starting BatchMake Script')
setapp( app @'Diffusion Tensor Scalar Measurements' )
SetAppFlag( app.enumeration.enumeration 'FractionalAnisotropy' )
Set( inputVolume_Directory '/Users/odonnell/Data/batchDTITest/output9' )
ListFileInDir( inputVolumeFiles  ${inputVolume_Directory} *DTI*.nhdr )
ForEach( inputVolume ${inputVolumeFiles} )
  SetAppOption( app.inputVolume.inputVolume
${inputVolume_Directory}/${inputVolume} )
  Set( outputScalar_Directory
'/Users/odonnell/Data/batchDTITest/output_1/output_2' )
  SetAppOption( app.outputScalar.outputScalar
${outputScalar_Directory}/FA-${inputVolume}.nrrd )
  Run( runOutput ${app} )
EndForEach( outputScalar )
Starting BatchMake Script
Status: Start /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
 run: '/Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics'
Status: Finish: Execution time 1374ms
Status: Start /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
 run: '/Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics'
Status: Finish: Execution time 1332ms
ERROR: In /Users/odonnell/Software/Slicer3-HEAD/Slicer3/Modules/CommandLineModule/vtkCommandLineModuleLogic.cxx,
line 1407
vtkCommandLineModuleLogic (0x1ccbd810): Diffusion Tensor Scalar
Measurements BatchMake standard error:
Error: SetAppOption: Cannot find parameter: inputVolume.inputVolume
Error: SetAppOption: Cannot find parameter: outputScalar.outputScalar
Error: PARSE ERROR:
Error:              One or more required arguments missing!
Error: Brief USAGE:
Error: For complete USAGE and HELP type:
Error:    /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
--help
Diffusion Tensor Scalar Measurements BatchMake completed without errors
_______________________________________________
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: batchmake help?

finetjul
Hi Lauren,

First of all, what is your version of BatchMake ?

1: GaussianBlurImageFilter.bmm.in is used to generate GaussianBlurImageFilter.bmm . This file describes the inputs of the gaussian filter executable. This is used internally by BatchMake to generate the correct command line to call the filter executable. The .bmm file is set in the generated script at the line: setApp( gbapp @GaussianBlurImageFilter)

2: Did you try ?:
script += "    setappoption(dtapp.estimationMethod.estimationMethod " + estimationMethod + ")\n";

3: Maybe there is a pb in BatchMakeModule.cxx::WriteArgInScript... where the condition  arg->isValueRequired() is valid only when arg->isRequired() is false... Can you please try to move the conditional block arg->isValueRequired()  right below the line script << indent << "SetAppFlag( app." ;
If it doesn't work, please send me the generated .bmm file. (should be called NameOfTheModel.bmm).

Feel free to send me a cvs patch with your modifications, I'll give a look...

Thanks,
Julien.

On Mon, Dec 7, 2009 at 4:42 PM, Lauren O'Donnell <[hidden email]> wrote:
Hello all,
I've been trying to make batchmake modules to script some DTI
processing.  I didn't at first realize you could set up batchmake with
only XML code since I looked at the Gaussian Blur directory after
reading the batchmake/slicer tutorial on the kitware wiki.  So I have
produced one module that works (the complicated way) and then I have
been unable to get the simple method to work. First I have two
questions about the original more complicated method, then a question
about the simpler method.  Thanks!! -- Lauren
1. What is the function of the batchmakemodule.bmm.in? Is this used?
2. To get parameters passed to the slicer module
(DiffusionTensorEstimation) that the batchmake module uses, the
setappoption function seemed to need the full variable name for
required input/output arguments (like inputVolume) that normally use
no flag on the command line. However to assign optional parameters
that normally have a flag, the full variable name did not work, and I
finally got it to work using the flag. This was confusing to me, does
anyone understand it? For example:
// IO information uses variable name
  script += "    setappoption(dtapp.inputVolume ${file})\n";
  script += "    setappoption(dtapp.outputTensor ${outputFilename})\n";
// parameters instead use name of flag on command line
// flag -e, variable name estimationMethod
  script += "    setappoption(dtapp.e " + estimationMethod + ")\n";
// flag -shiftNeg, variable name shiftNegativeEigenvalues
  out1 << ShiftNegativeEigenvalues;
  script += "    setappoption(dtapp.shiftNeg " + out1.str() + ")\n";
3. This is regarding the simple version where you just make the XML
file and use the GenericBatchMakeModule. I get this error when trying
to run my DiffusionTensorMathematicsBatchMake.  It seems the parameter
names are doubled (inputVolume.inputVolume) by the
GenericBatchMakeModule/BatchMakeModule.cxx that is used for the cxx
code for this module. Is this causing the error?
Running = /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
--xml
echo('Starting BatchMake Script')
setapp( app @'Diffusion Tensor Scalar Measurements' )
SetAppFlag( app.enumeration.enumeration 'FractionalAnisotropy' )
Set( inputVolume_Directory '/Users/odonnell/Data/batchDTITest/output9' )
ListFileInDir( inputVolumeFiles  ${inputVolume_Directory} *DTI*.nhdr )
ForEach( inputVolume ${inputVolumeFiles} )
  SetAppOption( app.inputVolume.inputVolume
${inputVolume_Directory}/${inputVolume} )
  Set( outputScalar_Directory
'/Users/odonnell/Data/batchDTITest/output_1/output_2' )
  SetAppOption( app.outputScalar.outputScalar
${outputScalar_Directory}/FA-${inputVolume}.nrrd )
  Run( runOutput ${app} )
EndForEach( outputScalar )
Starting BatchMake Script
Status: Start /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
 run: '/Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics'
Status: Finish: Execution time 1374ms
Status: Start /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
 run: '/Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics'
Status: Finish: Execution time 1332ms
ERROR: In /Users/odonnell/Software/Slicer3-HEAD/Slicer3/Modules/CommandLineModule/vtkCommandLineModuleLogic.cxx,
line 1407
vtkCommandLineModuleLogic (0x1ccbd810): Diffusion Tensor Scalar
Measurements BatchMake standard error:
Error: SetAppOption: Cannot find parameter: inputVolume.inputVolume
Error: SetAppOption: Cannot find parameter: outputScalar.outputScalar
Error: PARSE ERROR:
Error:              One or more required arguments missing!
Error: Brief USAGE:
Error: For complete USAGE and HELP type:
Error:    /Users/odonnell/Software/Slicer3-HEAD/Slicer3-build/lib/Slicer3/Plugins/DiffusionTensorMathematics
--help
Diffusion Tensor Scalar Measurements BatchMake completed without errors
_______________________________________________
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