edu.jhu.ece.iacl.jist.pipeline
Class ProcessingAlgorithm

java.lang.Object
  extended by AlgorithmBase
      extended by edu.jhu.ece.iacl.jist.pipeline.ProcessingAlgorithm
Direct Known Subclasses:
AddingNoise, AddToFileCollection, AlgorithmComputeConnectivityMatrix, AlgorithmGradientTableCorrection, AlgorithmJointROIStats, AlgorithmLogOdds, AlgorithmROIStats, AlgorithmSimulateSurfaceRater, AlgorithmSimulateVolumeRater, AlgorithmVolumeFileCollectionTo3D, CESTAsymmetry, CFARIEstimation, CFARIEstimation2, ChebyShevFitting, CombinedSlabCollectionToVolumeCollection, ComputeMeanB0, ComputeMeanDW, CreateCrossingFiber, CreateMask, CreatePlatonicSolidSurface, CreateTesselatedSurface, DefineCFARIScheme, DivideReference, DWIBallStickEstCamino, DWIBallStickEstCaminoFileCollection, DWICombineBvalTables, DWICombineGradTables, DWIDefineCaminoScheme, DWITensorColorEncodedMap, DWITensorContrasts, DWITensorEstCamino, DWITensorEstCaminoFileCollection, DWITensorEstCaminoRESTOREVariableNoiseField, DWITensorEstLikelihood, DWITensorEstLLMSE, DWIThreeTensorEstCamino, DWIThreeTensorEstCaminoFileCollection, DWITwoTensorEstCamino, DWITwoTensorEstCaminoFileCollection, EstimateMTR, EstimateMTRseries, EstimateT1FromDoubleAngle, EstimateT2FromDualEcho, ExtractBvalGradFromPAR, Fiber2Volume, FileCollectionToPins, FileCollectionToVolumeCollection, FirstPluginTest, FunkRadonTransform, GenerateTensors, GetImageDimensions, GradToSurf, ImageAlgebra, ImageArithmetic, ImageCollectionAlgebra, JistMSWASSR, LocalNoiseEstimate, MedicAlgorithmApplyFiberROI, MedicAlgorithmArithmetic, MedicAlgorithmAtlasSelection, MedicAlgorithmChooseFileRegEx, MedicAlgorithmChooseVolumeRegEx, MedicAlgorithmCleanSurfLabels, MedicAlgorithmCombineSurfaceComponents, MedicAlgorithmCombineSurfaces, MedicAlgorithmCombineVolumeComponents, MedicAlgorithmConcatArrayDoubleTextLists, MedicAlgorithmConstrainedFLIRT, MedicAlgorithmCopyEmbeddedData, MedicAlgorithmCreateSimilarityMetricVol, MedicAlgorithmCrop, MedicAlgorithmDeformFibers, MedicAlgorithmDemo, MedicAlgorithmDimensions, MedicAlgorithmEfficientFileCollectionRegistration, MedicAlgorithmEmbedSurface, MedicAlgorithmExecutableAdapter, MedicAlgorithmExtractAllComponents, MedicAlgorithmExtractFileCollectionComponents, MedicAlgorithmExtractSurfaceComponent, MedicAlgorithmExtractVolumeComponent, MedicAlgorithmFiberComparison, MedicAlgorithmFibersFromSurfaceROI, MedicAlgorithmFibersToVtk, MedicAlgorithmFiberTracker, MedicAlgorithmFiberVolumeStatistics, MedicAlgorithmFindEqualVolume, MedicAlgorithmFlipVectorTable, MedicAlgorithmFlipVectorVolume, MedicAlgorithmFLIRT, MedicAlgorithmFLIRTCollection, MedicAlgorithmFloatsToPoint, MedicAlgorithmFMLabelExtension, MedicAlgorithmFormatVectorImage, MedicAlgorithmIdentifySubject, MedicAlgorithmImageCalculator, MedicAlgorithmImageCalculatorBatch, MedicAlgorithmImageCalculatorModified, MedicAlgorithmImageMath, MedicAlgorithmIsotropicReslice, MedicAlgorithmJistLayoutAdapter, MedicAlgorithmKLDivergence, MedicAlgorithmMatchAllImages, MedicAlgorithmMipavAdapter, MedicAlgorithmMipavReorient, MedicAlgorithmMultiAtlasLabeling, MedicAlgorithmMultiAtlasReg, MedicAlgorithmMultiAtlasSurfaceLabeling, MedicAlgorithmMultiCrop, MedicAlgorithmMultiDeformVolume, MedicAlgorithmMultiGradientTableCreator, MedicAlgorithmMultiParV3Info, MedicAlgorithmMultiParV4Info, MedicAlgorithmReshapePoints, MedicAlgorithmReshapeSurface, MedicAlgorithmReverseComponents, MedicAlgorithmSerializeSurfaces, MedicAlgorithmSerializeVolumes, MedicAlgorithmSetHeaders, MedicAlgorithmSTAPLE, MedicAlgorithmSTAPLEgeneral, MedicAlgorithmSTAPLEsurface, MedicAlgorithmSubsampleFibers, MedicAlgorithmSurfaceConverter, MedicAlgorithmSurfaceHistogram, MedicAlgorithmSurfaceSplitter, MedicAlgorithmSurfaceToVolumeConverter, MedicAlgorithmTableFormat, MedicAlgorithmTensorFormatConvert, MedicAlgorithmThreshold, MedicAlgorithmTransformFibers, MedicAlgorithmTransformVolume, MedicAlgorithmUncrop, MedicAlgorithmVABRA, MedicAlgorithmValueEquals, MedicAlgorithmValueGreaterThan, MedicAlgorithmValueInRange, MedicAlgorithmValueLessThan, MedicAlgorithmVolumeConverter, MedicAlgorithmVolumeConverter2, MedicAlgorithmVolumeConverter4D, MedicAlgorithmVolumeHistogram, MedicAlgorithmVolumeListOrganizer, MedicAlgorithmVolumeSplitter, MedicAlgorithmVolumeToSurfaceLabeling, MedicAlgorithmWildBootTrac, MedicAlgorithmZip, MemoryDemo, MipavPluginParser, NameTest, NormalizeToUnitMagnitude, PlugInCircleLevelSet, PluginCombineVolumes, PlugInFuzzyMembershipThreshold2D, PlugInGeodesicActiveContour2D, PlugInGradientVectorFlow2D, PlugInIsoContourGenerator, PlugInIsoSurfaceGenerator, PlugInTestDataSelector, PlugInVisualizeActiveContour2D, PlugInVisualizeImage, PlugInVisualizeSurface, Process3DMRIImages, QBallEstimation, QBallModifiedRealProjection, QBallProjection, RandomVol, RegularizeNoiseField, ScaleImageDemo, SelectUniqueDiffusionDirections, SImageTractAnalysis, SimFramework, SurfToGrad, TesselateSurface, TractMapping, VolumeCensorRange, VolumeCollectionToCombinedSlabCollection, VolumeDirectoryNoIter

public abstract class ProcessingAlgorithm
extends AlgorithmBase

Processing Algorithm for MAPS. This class should be extended for each particular algorithm implementation. Methods createInputParameters(), createOutputParameters() and execute() should be overridden for each algorithm. createInputParameters() and createOutputParameters() are executed in the default constructor for ProcessingAlgorithm. execute() is executed after the user presses "OK" and all the input parameters validate.

Author:
Blake Lucas

Field Summary
protected  AlgorithmInformation algorithmInformation
          Algorithm information associated with all algorithms.
protected  ParamCollection inputParams
          The input parameters.
static float JIST_VERSION
          The Constant MAPS version.
protected  ParamCollection outputParams
          The output parameters.
protected  ParamPerformance performance
          Algorithm performance information.
protected  boolean runningInSeparateProcess
          Run in separate process.
 
Constructor Summary
ProcessingAlgorithm()
          Constructor creates input and output parameters and assigns the title of this algorithm to be the label for the input parameters.
 
Method Summary
protected abstract  void createInputParameters(ParamCollection inputParams)
          Create input parameters.
protected abstract  void createOutputParameters(ParamCollection outputParams)
          Create output parameters.
protected abstract  void execute(CalculationMonitor monitor)
          Execute your algorithm.
 java.io.File getAboutFile()
          Location of file that describes the algorithm.
 AlgorithmInformation getAlgorithmInformation()
          Get algorithm information for this algorithm.
 java.lang.String getAlgorithmLabel()
          Get algorithm label from input parameters.
 java.lang.String getAlgorithmName()
          Get algorithm name from input parameters.
 java.lang.String[] getDefaultJVMArgs()
          Default JVM Arguments --- currently only the Sun VM is supported
 ParamCollection getInput()
          Get input parameters.
 java.io.File getMapFile()
          Get module definition file.
 ParamCollection getOutput()
          Get output parameters.
 java.io.File getOutputDirectory()
          Get output directory.
 java.awt.Dimension getPreferredSize()
          Get preferred size for algorithm The default is null.
 long getTimeStamp()
          Get cpu timestamp for this thread in msec.
 java.io.File getUsageFile()
          Location of file that describes how to use the algorithm.
 void init(java.io.File pipeFile)
          Initialize parameters and algorithm.
 void init(PipeAlgorithm pipe)
          Initialize parameters and algorithm.
 boolean isRunningInSeparateProcess()
          Checks if is running in separate process.
 boolean load(java.io.File f)
          Load input parameters from file and execute algorithm.
 void runAlgorithm()
          Run algorithm with new calculation monitor.
 boolean runAlgorithm(CalculationMonitor monitor)
          Run algorithm with calculation monitor.
 void saveResources(boolean overrideSubdirectories)
           
 void setInput(ParamCollection inputParams)
          Set input parameters.
 void setMapFile(java.io.File mapFile)
          Set module definition file.
 void setOutput(ParamCollection outputParams)
          Set output parameters.
 void setOutputDirectory(java.io.File outputDir)
          Set output directory.
 void setOutputMetaFile(java.io.File file)
           
 void setPreferredSize(java.awt.Dimension d)
          Get preferred size for algorithm The default is null.
 void setRunningInSeparateProcess(boolean runningInSeperateProcess)
          Sets the running in separate process.
 void writeSummaryFile()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIST_VERSION

public static final float JIST_VERSION
The Constant MAPS version.

See Also:
Constant Field Values

inputParams

protected ParamCollection inputParams
The input parameters.


outputParams

protected ParamCollection outputParams
The output parameters.


performance

protected ParamPerformance performance
Algorithm performance information.


algorithmInformation

protected AlgorithmInformation algorithmInformation
Algorithm information associated with all algorithms.


runningInSeparateProcess

protected boolean runningInSeparateProcess
Run in separate process.

Constructor Detail

ProcessingAlgorithm

public ProcessingAlgorithm()
Constructor creates input and output parameters and assigns the title of this algorithm to be the label for the input parameters.

Method Detail

getDefaultJVMArgs

public java.lang.String[] getDefaultJVMArgs()
Default JVM Arguments --- currently only the Sun VM is supported


createInputParameters

protected abstract void createInputParameters(ParamCollection inputParams)
Create input parameters.

Parameters:
inputParams - the input parameters

createOutputParameters

protected abstract void createOutputParameters(ParamCollection outputParams)
Create output parameters.

Parameters:
outputParams - the output parameters

execute

protected abstract void execute(CalculationMonitor monitor)
                         throws AlgorithmRuntimeException
Execute your algorithm.

Parameters:
monitor - progress monitor
Throws:
AlgorithmRuntimeException - the algorithm runtime exception

getAboutFile

public java.io.File getAboutFile()
Location of file that describes the algorithm.

Returns:
the about file

getAlgorithmInformation

public AlgorithmInformation getAlgorithmInformation()
Get algorithm information for this algorithm.

Returns:
algorithm information

getAlgorithmLabel

public java.lang.String getAlgorithmLabel()
Get algorithm label from input parameters.

Returns:
algorithm label

getAlgorithmName

public java.lang.String getAlgorithmName()
Get algorithm name from input parameters.

Returns:
algorithm name

getInput

public ParamCollection getInput()
Get input parameters.

Returns:
input parameters

getMapFile

public java.io.File getMapFile()
Get module definition file.

Returns:
module file

getOutput

public ParamCollection getOutput()
Get output parameters.

Returns:
output parameters

getOutputDirectory

public java.io.File getOutputDirectory()
Get output directory.

Returns:
output directory

getPreferredSize

public java.awt.Dimension getPreferredSize()
Get preferred size for algorithm The default is null.

Returns:
preferred dimension

getTimeStamp

public long getTimeStamp()
Get cpu timestamp for this thread in msec.

Returns:
the time stamp

getUsageFile

public java.io.File getUsageFile()
Location of file that describes how to use the algorithm.

Returns:
the usage file

init

public void init(java.io.File pipeFile)
Initialize parameters and algorithm.

Parameters:
pipeFile - the pipe file

init

public void init(PipeAlgorithm pipe)
Initialize parameters and algorithm.

Parameters:
pipe - the pipe

load

public boolean load(java.io.File f)
Load input parameters from file and execute algorithm.

Parameters:
f - input parameter file
Returns:
true if algorithm executed

runAlgorithm

public void runAlgorithm()
Run algorithm with new calculation monitor.


runAlgorithm

public boolean runAlgorithm(CalculationMonitor monitor)
Run algorithm with calculation monitor.

Parameters:
monitor - calculation monitor
Returns:
true if algorithm successful

setInput

public void setInput(ParamCollection inputParams)
Set input parameters.

Parameters:
inputParams - input parameters

setMapFile

public void setMapFile(java.io.File mapFile)
Set module definition file.

Parameters:
mapFile - module file

setOutput

public void setOutput(ParamCollection outputParams)
Set output parameters.

Parameters:
outputParams - output parameters

setOutputDirectory

public void setOutputDirectory(java.io.File outputDir)
Set output directory.

Parameters:
outputDir - output directory

setPreferredSize

public void setPreferredSize(java.awt.Dimension d)
Get preferred size for algorithm The default is null.

Parameters:
d - the dimension

isRunningInSeparateProcess

public boolean isRunningInSeparateProcess()
Checks if is running in separate process.

Returns:
the runninInSeperateProcess

setRunningInSeparateProcess

public void setRunningInSeparateProcess(boolean runningInSeperateProcess)
Sets the running in separate process.

Parameters:
runningInSeperateProcess - the runInSeperateProcess to set

setOutputMetaFile

public void setOutputMetaFile(java.io.File file)

saveResources

public void saveResources(boolean overrideSubdirectories)

writeSummaryFile

public void writeSummaryFile()
                      throws java.io.IOException
Throws:
java.io.IOException