public class Q_Analysis extends AbstractPluginQconf
In principle this object loads and process name_X.paQP file generated by ECMM. X in
this
case means number of cell outline. The same result can be achieved by loading QCONF file that
contains all outlines for given case. This class is designed to process one outline in one time.
Thus most of methods operate on current status private fields (such as qp, oh).
The main analysis runner method is runPlugin()
, whereas support for both input formats
is
covered by runFromPaqp()
and runFromQconf()
(similarly to ECMM_Mapping
)
fileExt, qconfLoader
apiCall, errorSink, logger, options
Constructor and Description |
---|
Q_Analysis()
Main constructor and runner - class entry point.
|
Q_Analysis(File paramFile)
Parameterised constructor for tests.
|
Modifier and Type | Method and Description |
---|---|
String |
about()
Return plugin description.
|
void |
executer()
Executed if
AbstractPluginBase.run(String) got parsable parameter string. |
protected void |
loadFile(String paramFile)
Load specified configuration file and execute plugin depending on file type.
|
void |
run(String arg)
Called on plugin run by ImageJ or from API.
|
protected void |
runFromPaqp()
Called if loaded file is paQP.
|
protected void |
runFromQconf()
Called if loaded file is QCONF.
|
void |
showUi(boolean val)
Open plugin UI.
|
protected void |
validate()
Override this method to pass your own validation of QCONF structure.
|
getQconfLoader, unload
setPluginName
getOptions, parseArgumentString, publishMacroString
public Q_Analysis()
Left in this form for backward compatibility
public Q_Analysis(File paramFile) throws QuimpException
paramFile
- paQP or QCONF file to process. If null user is asked for this fileQuimpException
- on error in loadFile(String)
ECMM_Mapping.ECMM_Mapping(File)
protected void loadFile(String paramFile) throws QuimpException
AbstractPluginQconf
This method executes only once, if AbstractPluginQconf.getQconfLoader()
is null. Should be overridden
if there is any additional configuration needed before execution.
If file is QCONF then AbstractPluginQconf.runFromQconf()
is executed, if it is paQP then
AbstractPluginQconf.runFromPaqp()
. Validate loaded QCONF file by AbstractPluginQconf.validate()
.
loadFile
in class AbstractPluginQconf
paramFile
- path to the file. It can be null or empty string to allow user pick the file.QuimpException
- When configuration file could not be loaded or it does not meet
requirements.AbstractPluginQconf.validate()
public void executer() throws QuimpException
AbstractPluginBase
AbstractPluginBase.run(String)
got parsable parameter string.executer
in class AbstractPluginQconf
QuimpException
- on any error. Exception is handled depending on
AbstractOptionsParser.errorSink
set by AbstractPluginBase.run(String)
public void run(String arg)
AbstractPluginBase
Overrides PlugIn.run(String)
. If input string is null or empty it sets
AbstractOptionsParser.errorSink
to
QuimpException.MessageSinkTypes.GUI
. Note that AbstractOptionsParser.apiCall
is set by
choosing proper constructor. Then it tries to parse specified parameter string, if it succeeds,
AbstractOptionsParser.options
is set and deserialised and AbstractPluginBase.executer()
method is
executed. If parsing fails, AbstractPluginBase.showUi(boolean)
is called with option true. If there is
parsable string AbstractOptionsParser.errorSink
is set to
QuimpException.MessageSinkTypes.IJERROR
Finally, macro string is published to ImageJ that represents current state of
AbstractOptionsParser.options
.
All exceptions thrown by plugin logic (from AbstractPluginBase.executer()
) are handled here depending
on AbstractOptionsParser.errorSink
value.
run
in interface ij.plugin.PlugIn
run
in class AbstractPluginBase
AbstractOptionsParser.parseArgumentString(String)
protected void validate() throws QuimpException
AbstractPluginQconf
validate
in class AbstractPluginQconf
QuimpException
- if file can not be validated.public String about()
IQuimpPlugin
protected void runFromQconf() throws QuimpException
AbstractPluginQconf
This method expects that AbstractPluginQconf.qconfLoader
is already set up (AbstractPluginBase.run(String)
. In
macro or IJ mode exceptions will be handled in place and displayed as IJERROR or GUI message.
For API call (only if initialised by
AbstractPluginQconf.AbstractPluginQconf(String, AbstractPluginOptions, String)
)
exceptions are re-thrown.
runFromQconf
in class AbstractPluginQconf
QuimpException
- on errorprotected void runFromPaqp() throws QuimpException
AbstractPluginQconf
This method expects that AbstractPluginQconf.qconfLoader
is already set up (AbstractPluginBase.run(String)
. In
macro or IJ mode exceptions will be handled in place and displayed as IJERROR or GUI message.
For API call (only if initialised by
AbstractPluginQconf.AbstractPluginQconf(String, AbstractPluginOptions, String)
)
exceptions are re-thrown.
runFromPaqp
in class AbstractPluginQconf
QuimpException
- on errorpublic void showUi(boolean val) throws Exception
AbstractPluginBase
Executed if AbstractPluginBase.run(String)
could not parse parameters.
showUi
in class AbstractPluginBase
val
- true to show UIException
- on any error. Handled by AbstractPluginBase.run(String)
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.