public class FormatConverter extends Object
The following conversion are supported:
paQP->QCONF
[+] paQP->QCONF
[+] snQP->QCONF
[+] maQP->QCONF
[+] stQP->QCONF
QCONF->paQP
[+] QCONF->paQP
[+] QCONF->snQP
[+] QCONF->maQP
[+] QCONF->stQP
[-] QCONF->tiffs
This class can be also used to extract data from QCONF DataContainer
and save them as
plain csv files.
Note
Images are generated regardless used file format in QuimP Q module.
This method is related to fields that are non-transient and any change in serialised classes should be reflected here.
Due to randomness during creating Snakes or Outlines (head node is picked randomly on
Shape.removePoint(PointsList, boolean)
these objects stored in QCONF may differ from snQP
representation. There are the following rules (DataContainer
):
SnakeHandler.getLiveSnake()
) is filled but should not be
usedSnakeHandler.getStoredSnake(int)
) is filled and it is converted from
outlines (which are read from snQP file).
Starting node may be different than in snQP due to conversion between Snakes and Outlines.
DataContainer.getEcmmState()
) contains data read from
snQP file if ECMM has been run (-ECMM string in snQP file header).
DataContainer.getANAState()
) is created only if ECMM data is available.
DataContainer.getStats()
- read from stQP.csv file if present. If not present
empty structure is created in QCONF but that file should be considered as defective.
SnakeHandler.getStoredSnake(int)
) if there is no ECCM data
(position is used)
DataContainer.getEcmmState()
) if there is ECMM data (coord is
used)
Generally converter expects correct structure of paQP experiment, e.g. if there are many cells (_0.paQP, _1.paQP, etc), all cases should have other modules run on them with the same parameters (e.g. map resolution). There should be the same set of files for each case.
See doConversion()
for supported files.
Modifier and Type | Field and Description |
---|---|
static String[] |
headerEcmmOutline
Order of parameters saved by
saveOutline(Outline, CsvWritter) . |
protected static ch.qos.logback.classic.Logger |
logger |
Constructor and Description |
---|
FormatConverter()
Do nothing.
|
FormatConverter(File fileToConvert)
Construct FormatConverter from provided file.
|
FormatConverter(QconfLoader qcL)
Construct conversion object from QconfLoader.
|
Modifier and Type | Method and Description |
---|---|
void |
attachFile(File fileToConvert)
Attach file for conversion.
|
void |
doConversion()
Perform conversion depending on which file has been loaded.
|
int |
isFileLoaded()
Return type of loaded file or 0 if not loaded yet.
|
void |
saveBoaCentroids()
Save each snake centroid for each frame.
|
void |
saveBoaSnakes(boolean separateFiles)
Save all data associated with BOA analysis.
|
void |
saveEcmmCentroids()
Save each outline centroid for each frame.
|
void |
saveEcmmOutlines(boolean separateFiles)
Save all data associated with ECMM and ANA analysis.
|
void |
saveMaps(int maps)
Save selected maps to files.
|
static void |
saveOutline(Outline outline,
CsvWritter csv)
Save specified outline to
CsvWritter . |
void |
saveStatFluores()
Save statistic data associated with ANA analysis for all three channels.
|
void |
saveStatGeom()
Save statistic data associated with ECMM analysis for all three channels.
|
void |
saveStats()
Create stQP file using internally stored Stats from QCONF.
|
void |
showConversionCapabilities(Frame frame)
Show message with conversion capabilities.
|
String |
toString() |
protected static ch.qos.logback.classic.Logger logger
public static final String[] headerEcmmOutline
saveOutline(Outline, CsvWritter)
.public FormatConverter()
attachFile(File)
public FormatConverter(File fileToConvert) throws QuimpException
fileToConvert
- file to convertQuimpException
- if input file can not be loadedpublic FormatConverter(QconfLoader qcL)
qcL
- reference to QconfLoaderpublic void attachFile(File fileToConvert) throws QuimpException
Do the same job as FormatConverter(File)
but can be used if
FormatConverter()
was used.
fileToConvert
- file to convertQuimpException
- if input file can not be loadedpublic void showConversionCapabilities(Frame frame)
frame
- parent framepublic void saveMaps(int maps) throws QuimpException
IllegalArgumentException
when run from object constructed from old format.
Follow naming convention: ROOT_N_MAPNAME.maQP, where ROOT is corename of QCONF file,(ROOT.QCONF), N is cell number and MAPNAME follows supported map extensions.
maps
- map defined in STmap
QuimpException
- if maps are not availablepublic void saveBoaCentroids() throws QuimpException
Produce files /path/core_cellNo_boacentroid.csv
QuimpException
- if BOA structure is not availablepublic void saveBoaSnakes(boolean separateFiles) throws QuimpException
Produce files /path/core_cellNo_snake-frame_no.csv with snake data for each frame separately or files /path/core_cellNo_snake.csv with all data in one file (for same snake).
Output file contain only parameters directly included in QCONF in contrary to e.g. snQP files (or results of QCONF->paQP conversion) that contain some extra data calculated.
separateFiles
- Control whether files should be broken into separate files for each frame
(true) and for each object or store all frames in one file (false).QuimpException
- if BOA structure is not availablepublic void saveEcmmOutlines(boolean separateFiles) throws QuimpException
Produce files /path/core_cellNo_outline-frame_no.csv with snake data for each frame separately or files /path/core_cellNo_outline.csv with all data in one file (for same snake).
Output file contain only parameters directly included in QCONF in contrary to e.g. snQP files (or results of QCONF->paQP conversion) that contain some extra data calculated.
separateFiles
- Control whether files should be broken into separate files for each frame
(true) and for each object or store all frames in one file (false).QuimpException
- if ECMM has not been runpublic static void saveOutline(Outline outline, CsvWritter csv)
CsvWritter
.outline
- outline to savecsv
- opened csv objectpublic void saveStatFluores() throws QuimpException
Produce files /path/core_cellNo_fluostats.csv with ANA data data for each cell along frames.
Output file contains raw parameters that are also available in stQP file but not exactly the same as some of stQP parameters are computed from those raw.
QuimpException
- if stats are not available. Note that if ANA has not been run this
method can still produce valid but empty output.saveStats()
,
saveStatGeom()
public void saveStatGeom() throws QuimpException
Produce files /path/core_cellNo_geomstats.csv with ANA data data for each cell along frames.
Output file contains raw parameters that are also available in stQP file but not exactly the same as some of stQP parameters are computed from those raw.
QuimpException
- if stats are not available. Note that if ANA has not been run this
method can still produce valid but empty output.saveStats()
,
saveStatFluores()
public void saveEcmmCentroids() throws QuimpException
Produce files /path/core_cellNo_ecmmcentroid.csv
QuimpException
- if ECMM has not been runpublic void saveStats() throws QuimpException
QuimpException
- when write of stQP file failedsaveStatFluores()
,
saveStatGeom()
public void doConversion() throws QuimpException
Supported conversions: QCONF->paQP -- paQP, snQP, stQP, maQP files are generated (if data present in QCONF) paQP->QCONF -- paQP, snQP, stQP, maQP are supported
QuimpException
- on every error redirected to GUI. This is final method called from
caller. All exceptions during conversion are collected and converted here to GUI.public int isFileLoaded()
QconfLoader.QCONF_INVALID
or QParams.NEW_QUIMP
,
QParams.QUIMP_11
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.