adams.data.imagej.transformer
Class PlugInFilter

java.lang.Object
  extended by adams.core.ConsoleObject
      extended by adams.core.option.AbstractOptionHandler
          extended by adams.data.image.AbstractImageTransformer<ImagePlusContainer>
              extended by adams.data.imagej.transformer.AbstractImageJTransformer
                  extended by adams.data.imagej.transformer.PlugInFilter
All Implemented Interfaces:
CleanUpHandler, Debuggable, Destroyable, OptionHandler, SizeOfHandler, Serializable, Comparable

public class PlugInFilter
extends AbstractImageJTransformer

A transformer that allows the use of ImageJ's plug-in filters.
Notes:
- the filter must implement 'ij.plugin.filter.PlugInFilter'
- the filter can pop-up a window to enter additional parameters,
the first time it is executed, depending on the filter implementation
(you can suppress this with supplying the options manually)
- the manual options string can be obtained when recording macros
in ImageJ
- the filter must be in the classpath of the application

Valid options are:

-D <int> (property: debugLevel)
    The greater the number the more additional info the scheme may output to
    the console (0 = off).
    default: 0
    minimum: 0
 
-filter <java.lang.String> (property: plugInFilter)
    The classname of the plug-in filter to use.
    default: ij.plugin.filter.FFTFilter
 
-suppress-plugin-dialog (property: suppressPlugInDialog)
    If enabled, the plugin dialog is suppressed using the supplied plugin options.
 
-plugin-options <java.lang.String> (property: plugInOptions)
    The options for the plug-in if the dialog gets suppressed.
    default:
 

Version:
$Revision: 4753 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  ij.plugin.filter.PlugInFilter m_ActualFilter
          the actual filter.
protected  String m_PlugInFilter
          the classname of the plugin-filter.
protected  String m_PlugInOptions
          the options for the plugin (if dialog suppressed).
protected  boolean m_SuppressPlugInDialog
          whether to suppress the plugin dialog.
 
Fields inherited from class adams.core.option.AbstractOptionHandler
m_DebugLevel, m_OptionManager
 
Constructor Summary
PlugInFilter()
           
 
Method Summary
 void cleanUp()
          Cleans up data structures, frees up memory.
 void defineOptions()
          Adds options to the internal list of options.
protected  ImagePlusContainer[] doTransform(ImagePlusContainer img)
          Performs no transformation at all, just returns the input.
protected  ij.plugin.filter.PlugInFilter getFilter(ImagePlusContainer img)
          Returns the filter to use.
 String getPlugInFilter()
          Returns the classname of the plugin filter in use.
 String getPlugInOptions()
          Returns the options for the plug-in if the dialog gets suppressed.
 boolean getSuppressPlugInDialog()
          Returns whether to suppress the plugin dialog.
 String globalInfo()
          Returns a string describing the object.
 String plugInFilterTipText()
          Returns the tip text for this property.
 String plugInOptionsTipText()
          Returns the tip text for this property.
protected  void reset()
          Resets the scheme.
 void setPlugInFilter(String value)
          Sets the classname of the plugin filter to use.
 void setPlugInOptions(String value)
          Sets the options for the plug-in if the dialog gets suppressed.
 void setSuppressPlugInDialog(boolean value)
          Sets whether to suppress the plugin dialog.
 String suppressPlugInDialogTipText()
          Returns the tip text for this property.
 
Methods inherited from class adams.data.imagej.transformer.AbstractImageJTransformer
checkImage, forCommandLine, forName, getTransformations
 
Methods inherited from class adams.data.image.AbstractImageTransformer
compareTo, destroy, equals, shallowCopy, shallowCopy, transform
 
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, debug, debug, debugLevelTipText, finishInit, getDebugLevel, getOptionManager, initialize, isDebugOn, newOptionManager, setDebugLevel, toCommandLine, toString
 
Methods inherited from class adams.core.ConsoleObject
getDebugging, getSystemErr, getSystemOut, sizeOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_PlugInFilter

protected String m_PlugInFilter
the classname of the plugin-filter.


m_ActualFilter

protected ij.plugin.filter.PlugInFilter m_ActualFilter
the actual filter.


m_SuppressPlugInDialog

protected boolean m_SuppressPlugInDialog
whether to suppress the plugin dialog.


m_PlugInOptions

protected String m_PlugInOptions
the options for the plugin (if dialog suppressed).

Constructor Detail

PlugInFilter

public PlugInFilter()
Method Detail

globalInfo

public String globalInfo()
Returns a string describing the object.

Specified by:
globalInfo in class AbstractOptionHandler
Returns:
a description suitable for displaying in the gui

defineOptions

public void defineOptions()
Adds options to the internal list of options.

Specified by:
defineOptions in interface OptionHandler
Overrides:
defineOptions in class AbstractOptionHandler

reset

protected void reset()
Resets the scheme.

Overrides:
reset in class AbstractOptionHandler

setPlugInFilter

public void setPlugInFilter(String value)
Sets the classname of the plugin filter to use.

Parameters:
value - the classname

getPlugInFilter

public String getPlugInFilter()
Returns the classname of the plugin filter in use.

Returns:
the classname

plugInFilterTipText

public String plugInFilterTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setSuppressPlugInDialog

public void setSuppressPlugInDialog(boolean value)
Sets whether to suppress the plugin dialog.

Parameters:
value - true if to suppress the dialog

getSuppressPlugInDialog

public boolean getSuppressPlugInDialog()
Returns whether to suppress the plugin dialog.

Returns:
true if the dialog is suppressed

suppressPlugInDialogTipText

public String suppressPlugInDialogTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

setPlugInOptions

public void setPlugInOptions(String value)
Sets the options for the plug-in if the dialog gets suppressed.

Parameters:
value - the options

getPlugInOptions

public String getPlugInOptions()
Returns the options for the plug-in if the dialog gets suppressed.

Returns:
the options

plugInOptionsTipText

public String plugInOptionsTipText()
Returns the tip text for this property.

Returns:
tip text for this property suitable for displaying in the GUI or for listing the options.

getFilter

protected ij.plugin.filter.PlugInFilter getFilter(ImagePlusContainer img)
Returns the filter to use.

Parameters:
img - the image used for setting up
Returns:
the filter

doTransform

protected ImagePlusContainer[] doTransform(ImagePlusContainer img)
Performs no transformation at all, just returns the input.

Automating an ImageJ dialog taken from here.

Specified by:
doTransform in class AbstractImageTransformer<ImagePlusContainer>
Parameters:
img - the image to process (can be modified, since it is a copy)
Returns:
the copy of the image

cleanUp

public void cleanUp()
Cleans up data structures, frees up memory.

Specified by:
cleanUp in interface CleanUpHandler
Overrides:
cleanUp in class AbstractImageTransformer<ImagePlusContainer>


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.